Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
new Float:g_round_start;
public plugin_init()
{
register_plugin("Respawn", "0.1", "Exolent");
register_logevent("EventRoundStart", 2, "1=Round_Start");
register_logevent("EventRoundEnd", 2, "1=Round_End");
register_event("TextMsg", "EventRoundEnd", "a", "2&#Game_C", "2&#Game_w");
RegisterHam(Ham_Killed, "player", "FwdPlayerKilled", 1);
}
public EventRoundStart()
{
g_round_start = get_gametime();
}
public EventRoundEnd()
{
g_round_start = 0.0;
}
public FwdPlayerKilled(client, killer, shouldgib)
{
if( (get_gametime() - g_round_start) < 30.0 )
{
set_task(1.0, "TaskRespawn", client);
}
}
public TaskRespawn(client)
{
if( is_user_connected(client) )
{
ExecuteHamB(Ham_CS_RoundRespawn, client);
}
}
__________________