For Insurency 2014 : created a respawn plugin based on "Jared Ballou's Respawn plugin". Whenever player dies after 5 seconds respawn to happen, code is passing thru defined functions but player is not spawning.
Code:
new Handle:g_hPlayerRespawn;
Handle B2LTimers[MAXPLAYERS+1];
public OnPluginStart()
{
HookEvent("player_death", DeathEvent);
g_hPlayerRespawn = EndPrepSDKCall();
}
public Action:DeathEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
B2LTimers[client] = CreateTimer(5.0, MakeAlive, client);
}
public Action MakeAlive(Handle timer, any client)
{
decl String:game[40];
GetGameFolderName(game, sizeof(game));
if(IsClientInGame(client) && (!IsFakeClient(client)))
{
SDKCall(g_hPlayerRespawn, client);
}
B2LTimers[client] = null;
}
public void OnClientDisconnect(int client)
{
if (B2LTimers[client] != null)
{
KillTimer(B2LTimers[client]);
B2LTimers[client] = null;
}
}
Any help why player not re-spawning.