From b87be0bfdb354f018342bd2aa57217ebf7dcdd0e Mon Sep 17 00:00:00 2001 From: DoganGFL Date: Wed, 21 Nov 2018 16:17:45 +0100 Subject: [PATCH] Update VIPMode timer for vip selection scales after motherzombies + the slay is delayed after the message by 2 seconds --- VIPMode/scripting/VIPMode.sp | 37 ++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/VIPMode/scripting/VIPMode.sp b/VIPMode/scripting/VIPMode.sp index 9c957943..9eb9f431 100644 --- a/VIPMode/scripting/VIPMode.sp +++ b/VIPMode/scripting/VIPMode.sp @@ -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); + } + } } \ No newline at end of file