VIPMode: select new VIP when old one goes to spec

This commit is contained in:
neon 2018-11-21 00:25:15 +01:00
parent e9ffb6ceab
commit 277da2945a

View File

@ -3,6 +3,7 @@
#include <sourcemod>
#include <sdktools>
#include <multicolors>
#include <Spectate>
#include <zombiereloaded>
int g_iVIPClient = -1;
@ -119,7 +120,21 @@ public Action OnPlayerTeam(Event event, const char[] name, bool dontBroadcast)
if(client == g_iVIPClient)
{
g_iVIPClient = -1;
PerformVIPSelection(true);
g_iVIPClient = -1;
RequestFrame(RequestFrame_Callback);
}
}
public void OnPlayerSwitchedToSpectateByCommand(int client)
{
if(client == g_iVIPClient)
{
g_iVIPClient = -1;
RequestFrame(RequestFrame_Callback);
}
}
void RequestFrame_Callback(int iPacked)
{
PerformVIPSelection(true);
}