Don't be mean guys!
Here you go:
PHP Code:
#include <sourcemod>
#include <cstrike>
new tries[MAXPLAYERS+1];
public Plugin:myinfo =
{
name = "Deathrun respawn",
author = "necavi",
description = "Deathrun respawn",
version = "0.1",
url = "http://necavi.com/"
}
public OnPluginStart()
{
HookEvent("player_death",Event_PlayerDeath);
}
public Event_PlayerDeath(Handle:event,const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (GetClientTeam(client) == 2)
{
return;
}
else if(GetClientTeam(client) == 3 && GetGameTime() <= 20.0 && tries[client] << 0)
{
CreateTimer(5.0, Timer_Respawn, client);
PrintToChat(client, "Respawning in 5 seconds.");
}
else
{
return;
}
}
public Action:Timer_Respawn(Handle:timer, any:client)
{
PrintToChat(client, "Second Chance!");
CS_RespawnPlayer(client);
tries[client]++;
}
Let me know if you need any more additions to it and I'll be willing to do it for you, or if you actually want to learn how to do this (And how I did this).
I haven't tested this but it
should work.
The plugin has also been attached.
Rename the plugin if necessary.
P.S. I haven't changed the author section because I was lazy, if you actually need me doing this, then just tell me and I'll do it (Wow, it takes more time to actually type this than go ahead and change the author field)