So this block is intended to select a random player, but does not.
PHP Code:
public Action GetZombieTimer(Handle timer)
{
int Zombie = GetZombie();
PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010%N a the zombie leader!", Zombie);
CreateTimer(0.5, RespawnPlayer, GetClientUserId(Zombie), TIMER_FLAG_NO_MAPCHANGE);
}
int GetZombie()
{
HasRoundStarted = true;
int[] Players = new int[MaxClients +1];
int ClientCount;
for (int IGC = 1; IGC <= MaxClients; IGC++)
{
if (IsClientInGame(IGC))
{
if (PlayerTeam[IGC] == TFTeam_Blue && bIsPlayerAlive[IGC])
Players[ClientCount++] = IGC;
}
}
return (ClientCount == 0) ? -1 : Players[GetRandomInt(0, ClientCount - 1)];
}
Secondly this block is supposed to respawn players w/o a waiting period. "Instant respawn"
PHP Code:
CreateTimer(0.5, RespawnPlayer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
public Action RespawnPlayer(Handle timer, int Client) //No client passing though timer
{
int iClient = GetClientOfUserId(Client);
if (!IsClientConnected(iClient))
return
else if (IsClientConnected(iClient))
TF2_RespawnPlayer(iClient);
PrintToChat(iClient, "You've been respawned");
}