Update VIPMode

timer for vip selection scales after motherzombies + the slay is delayed after the message by 2 seconds
This commit is contained in:
DoganGFL 2018-11-21 16:17:45 +01:00
parent 277da2945a
commit b87be0bfdb

View File

@ -41,10 +41,17 @@ public Action WhoIsVIP(int client, int args)
}
}
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
{
if(motherInfect)
{
CreateTimer(5.0, SelectVIP, _, TIMER_FLAG_NO_MAPCHANGE);
}
}
public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
g_iVIPClient = -1;
CreateTimer(15.0, SelectVIP, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
}
public Action OnRoundEnd(Event event, const char[] name, bool dontBroadcast)
@ -57,6 +64,11 @@ public Action SelectVIP(Handle timer)
PerformVIPSelection(false);
}
public Action SlayHumans(Handle timer)
{
PerformCTSlay();
}
public void PerformVIPSelection(bool reselect)
{
int PotentialVIPCount;
@ -94,15 +106,9 @@ public Action OnPlayerDeath(Event event, const char[] name, bool dontBroadcast)
CPrintToChatAll("{purple}VIP Mode:{red} The VIP died! It's over.");
CPrintToChatAll("{purple}VIP Mode:{red} The VIP died! It's over.");
CPrintToChatAll("{purple}VIP Mode:{red} The VIP died! It's over.");
for (int player = 1; player <= MaxClients; player++)
{
if (IsClientInGame(player) && IsPlayerAlive(player) && ZR_IsClientHuman(player))
{
ForcePlayerSuicide(player);
}
}
}
CreateTimer(2.0, SlayHumans, _, TIMER_FLAG_NO_MAPCHANGE);
}
public void OnClientDisconnect(int client)
@ -134,7 +140,18 @@ public void OnPlayerSwitchedToSpectateByCommand(int client)
}
}
void RequestFrame_Callback(int iPacked)
public void RequestFrame_Callback(int iPacked)
{
PerformVIPSelection(true);
}
public void PerformCTSlay()
{
for (int player = 1; player <= MaxClients; player++)
{
if (IsClientInGame(player) && IsPlayerAlive(player) && ZR_IsClientHuman(player))
{
ForcePlayerSuicide(player);
}
}
}