VIPMode: smaller adjustements

This commit is contained in:
dogan 2020-09-26 15:24:17 +02:00
parent 2be068eb14
commit 23b9a6ae67

View File

@ -90,6 +90,12 @@ public void PerformVIPSelection(bool reselect)
} }
} }
if(PotentialVIPCount < 1)
{
CPrintToChatAll("{purple}VIP Mode:{red} Couldn't find a valid client to set as VIP. Aborting on this round.", g_iVIPClient);
return;
}
g_iVIPClient = PotentialVIPClient[GetRandomInt(0, PotentialVIPCount - 1)]; g_iVIPClient = PotentialVIPClient[GetRandomInt(0, PotentialVIPCount - 1)];
CPrintToChatAll("{purple}VIP Mode:{red} {white}%N{red} is the current VIP! Protect him.", g_iVIPClient); CPrintToChatAll("{purple}VIP Mode:{red} {white}%N{red} is the current VIP! Protect him.", g_iVIPClient);
@ -120,19 +126,22 @@ public Action PerformAdminVIPSelection(int client, int args)
{ {
if (IsClientInGame(player) && IsPlayerAlive(player) && ZR_IsClientHuman(player)) if (IsClientInGame(player) && IsPlayerAlive(player) && ZR_IsClientHuman(player))
{ {
if(IsFakeClient(client)) if(IsFakeClient(player))
continue; continue;
PotentialVIPClient[PotentialVIPCount] = player; PotentialVIPClient[PotentialVIPCount] = player;
PotentialVIPCount++; PotentialVIPCount++;
} }
} }
g_iVIPClient = PotentialVIPClient[GetRandomInt(0, PotentialVIPCount - 1)]; g_iVIPClient = PotentialVIPClient[GetRandomInt(0, PotentialVIPCount - 1)];
CPrintToChatAll("{purple}VIP Mode:{red} {white}%N{red} is the current VIP! Protect him.", g_iVIPClient); ReplyToCommand(client, "[SM] You have randomly chosen another VIP.");
PrintToChatAll("[SM] %N randomly chose another VIP!", client);
CReplyToCommand(client, "{purple}VIP Mode:{red} You have randomly chosen another VIP."); CPrintToChatAll("{purple}VIP Mode:{red} {white}%N{red} is the current VIP! Protect him.", g_iVIPClient);
} }
return Plugin_Handled; return Plugin_Handled;
} }