forked from ugurbayraktarr/Plugins-for-CSGO-Servers
-
Notifications
You must be signed in to change notification settings - Fork 3
/
elBasiSilahKaldirici.sp
67 lines (57 loc) · 1.56 KB
/
elBasiSilahKaldirici.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <sourcemod>
#include <smlib>
public Plugin:myinfo =
{
name = "El Başı Silah Kaldırıcı",
author = "ImPossibLe`",
description = "DrK # GaminG",
version = "1.0"
};
public OnPluginStart()
{
//HookEvent("player_spawn", Event_Spawn);
HookEvent("round_end", Event_End);
HookEvent("round_start", Event_RoundStart);
}
Handle silahTimer;
/*public Action:Event_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new i = GetClientOfUserId(GetEventInt(event, "userid"));
RemoveWeapons(i);
}*/
public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
if(silahTimer != INVALID_HANDLE)
KillTimer(silahTimer);
}
public Action:Event_End(Handle:event, const String:name[], bool:dontBroadcast)
{
new Float:fDelay;
new Handle:g_hCvarDelay = INVALID_HANDLE;
g_hCvarDelay = FindConVar("mp_round_restart_delay");
if (g_hCvarDelay != INVALID_HANDLE)
{
fDelay = GetConVarFloat(g_hCvarDelay);
}
fDelay = fDelay - 0.1;
silahTimer = CreateTimer(fDelay, SilahlariKaldir);
/*GetConVarFloat()
new i = GetClientOfUserId(GetEventInt(event, "userid"));
RemoveWeapons(i);*/
}
public Action SilahlariKaldir(Handle timer)
{
new i;
for(i=1;i<=MaxClients;i++)
{
if(!IsClientConnected(i)) continue;
if(!IsClientInGame(i)) continue;
if(GetClientTeam(i) < 2) continue;
if(!IsPlayerAlive(i)) continue;
Client_RemoveAllWeapons(i, "", true);
}
}
/*RemoveWeapons(client)
{
Client_RemoveAllWeapons(client, "", true); // Removes all the weapons ; Add a weapon name into the "" to exclude that weapon.
} */