forked from VANCOLD/fm_drive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FM_ENTMOD_NOCLIP.sma
44 lines (38 loc) · 890 Bytes
/
FM_ENTMOD_NOCLIP.sma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "feckinmad/fm_global"
#include "feckinmad/entmod/fm_entmod_access" // fm_CheckUserEntAccess()
#include <fakemeta>
public plugin_init()
{
fm_RegisterPlugin()
register_clcmd("+fm_ent_noclip", "Player_StartNoclip")
register_clcmd("-fm_ent_noclip", "Player_StopNoclip")
register_clcmd("fm_ent_noclip", "Player_ToggleNoclip")
}
public Player_StartNoclip(id)
{
if (fm_CheckUserEntAccess(id) && is_user_alive(id))
{
set_pev(id, pev_movetype, MOVETYPE_NOCLIP)
}
}
public Player_StopNoclip(id)
{
if (pev(id, pev_movetype) == MOVETYPE_NOCLIP && is_user_alive(id))
{
set_pev(id, pev_movetype, MOVETYPE_WALK)
}
}
public Player_ToggleNoclip(id)
{
if (is_user_alive(id))
{
if (pev(id, pev_movetype) == MOVETYPE_NOCLIP)
{
set_pev(id, pev_movetype, MOVETYPE_WALK)
}
else if (fm_CheckUserEntAccess(id))
{
set_pev(id, pev_movetype, MOVETYPE_NOCLIP)
}
}
}