When player is death and joins spectator team then joins again terrorist team player will respawn i wan't to disable that (only happnes in hg_ maps)
Code:
new specrev = 0
public void OnPluginStart()
{
HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
HookEvent("player_team", EventPlayerTeam);
}
public Action EventPlayerTeam(Event event, const char[] name, bool dontBroadcast)
{
if (team == 2) {
if (specrev = 0) {
ServerCommand("say test");
}
}
}
public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
decl String:mapname[128];
GetCurrentMap(mapname, sizeof(mapname));
if (StrContains(mapname, "hg_", false) == 0)
{
specrev = 1;
CreateTimer(30.0, hg);
}
}
public Action hg(Handle timer)
{
specrev = 0
}
Not works