small update
This commit is contained in:
parent
2fa13dffd8
commit
3db6438022
@ -21,6 +21,7 @@ public void OnPluginStart()
|
|||||||
HookEvent("player_death", OnPlayerDeath);
|
HookEvent("player_death", OnPlayerDeath);
|
||||||
HookEvent("round_start", OnRoundStart);
|
HookEvent("round_start", OnRoundStart);
|
||||||
HookEvent("round_end", OnRoundEnd);
|
HookEvent("round_end", OnRoundEnd);
|
||||||
|
HookEvent("player_team", OnPlayerTeam);
|
||||||
|
|
||||||
RegConsoleCmd("sm_currentvip", WhoIsVIP);
|
RegConsoleCmd("sm_currentvip", WhoIsVIP);
|
||||||
}
|
}
|
||||||
@ -42,7 +43,7 @@ public Action WhoIsVIP(int client, int args)
|
|||||||
public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
|
public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
|
||||||
{
|
{
|
||||||
g_iVIPClient = -1;
|
g_iVIPClient = -1;
|
||||||
CreateTimer(30.5, SelectVIP, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
CreateTimer(15.0, SelectVIP, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action OnRoundEnd(Event event, const char[] name, bool dontBroadcast)
|
public Action OnRoundEnd(Event event, const char[] name, bool dontBroadcast)
|
||||||
@ -110,4 +111,15 @@ public void OnClientDisconnect(int client)
|
|||||||
g_iVIPClient = -1;
|
g_iVIPClient = -1;
|
||||||
PerformVIPSelection(true);
|
PerformVIPSelection(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action OnPlayerTeam(Event event, const char[] name, bool dontBroadcast)
|
||||||
|
{
|
||||||
|
int client = GetClientOfUserId(GetEventInt(event, "userid"));
|
||||||
|
|
||||||
|
if(client == g_iVIPClient)
|
||||||
|
{
|
||||||
|
g_iVIPClient = -1;
|
||||||
|
PerformVIPSelection(true);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user