fix multiple vips issue counting on motherzombies

This commit is contained in:
DoganGFL 2018-11-21 17:08:31 +01:00
parent b87be0bfdb
commit 9ed4c43ced

View File

@ -7,6 +7,7 @@
#include <zombiereloaded> #include <zombiereloaded>
int g_iVIPClient = -1; int g_iVIPClient = -1;
bool g_bmotherInfect = false;
public Plugin myinfo = public Plugin myinfo =
{ {
@ -43,8 +44,9 @@ public Action WhoIsVIP(int client, int args)
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn) public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
{ {
if(motherInfect) if(motherInfect && g_bmotherInfect == false)
{ {
g_bmotherInfect = true;
CreateTimer(5.0, SelectVIP, _, TIMER_FLAG_NO_MAPCHANGE); CreateTimer(5.0, SelectVIP, _, TIMER_FLAG_NO_MAPCHANGE);
} }
} }
@ -52,11 +54,13 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo
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;
g_bmotherInfect = false;
} }
public Action OnRoundEnd(Event event, const char[] name, bool dontBroadcast) public Action OnRoundEnd(Event event, const char[] name, bool dontBroadcast)
{ {
g_iVIPClient = -1; g_iVIPClient = -1;
g_bmotherInfect = false;
} }
public Action SelectVIP(Handle timer) public Action SelectVIP(Handle timer)