-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfunci.sp
40 lines (32 loc) · 964 Bytes
/
funci.sp
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
// by cherry
#pragma semicolon 1
#pragma newdecls required
#include <sdkhooks>
bool g_bClientHideFuncI[MAXPLAYERS +1];
public void OnPluginStart()
{
RegConsoleCmd("sm_funci", CMD_EntityMenu, "EntityMenu");
}
public Action CMD_EntityMenu(int client, int args )
{
if(client == 0)
{
ReplyToCommand(client, "[SM] This command can only be used in-game.");
return Plugin_Handled;
}
g_bClientHideFuncI[client] = !g_bClientHideFuncI[client];
ReplyToCommand(client, "[SM] func_illusionary: %s!", g_bClientHideFuncI[client] ? "invisible" : "visible");
return Plugin_Handled;
}
public void OnEntityCreated(int entity, const char[] classname)
{
if(StrEqual(classname, "func_illusionary"))
{
SDKHook(entity, SDKHook_SetTransmit, SetTransmitfunci);
}
}
public Action SetTransmitfunci(int entity, int client)
{
if(g_bClientHideFuncI[client]) return Plugin_Handled;
return Plugin_Continue;
}