PHP Code:
#include <sourcemod>
#include <cstrike>
public Plugin:myinfo =
{
name = "Deathrun respawn",
author = "necavi + Dr. McKay",
description = "Deathrun respawn",
version = "0.2",
url = "http://necavi.com/"
}
new bool:respawned[MAXPLAYERS + 1] = {false, ...};
public OnPluginStart()
{
HookEvent("player_death",Event_PlayerDeath);
HookEvent("teamplay_round_start", Event_RoundStart);
}
public Event_PlayerDeath(Handle:event,const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event,"userid"));
if(GetGameTime()<=20.0 && !respawned[client])
{
respawned[client] = true;
CS_RespawnPlayer(client);
}
}
public Event_RoundStart(Handle:event, const STring:name[], bool:dontBroadcast)
{
for(new i = 0; i <= MaxClients; i++)
{
respawned[i] = false;
}
}
public OnClientConnected(client)
{
respawned[client] = false;
}
__________________