small update

This commit is contained in:
DoganGFL 2018-11-21 00:03:26 +01:00
parent 2fa13dffd8
commit 3db6438022

View File

@ -21,6 +21,7 @@ public void OnPluginStart()
HookEvent("player_death", OnPlayerDeath);
HookEvent("round_start", OnRoundStart);
HookEvent("round_end", OnRoundEnd);
HookEvent("player_team", OnPlayerTeam);
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)
{
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)
@ -110,4 +111,15 @@ public void OnClientDisconnect(int client)
g_iVIPClient = -1;
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);
}
}