Re spawns player 3 times. no additional checks. If you play with bots they stand still after the bombs planted. atleast in cz they do. (cz bots are stupid)
Untested but in theory it works. same basic concept that is in my plugin for custom DM
PHP Code:
#include <amxmodx>
#include <hamsandwich>
const MAX_PLAYERS = 32;
new g_iToggle, g_iSpawnsAllowed, g_iMaxPlayers, g_iRespawnedTimes[MAX_PLAYERS+1];
public plugin_init()
{
register_plugin("Respawn Ticketing", "0.0.1", "ME!!!");
register_event("HLTV", "eNewRound", "a", "1=0", "2=0");
RegisterHam(Ham_Killed, "player", "fwdPlayerDeath", 1);
g_iToggle = register_cvar("rt_toggle", "1");
g_iSpawnsAllowed = register_cvar("rt_spawntimes", "3");
g_iMaxPlayers = get_maxplayers();
}
public eNewRound()
{
for(new i=1; i<g_iMaxPlayers; i++)
{
g_iRespawnedTimes[i] = 0;
}
}
public fwdPlayerDeath(iVictim, iKiller, iDmgBits)
{
if(get_pcvar_num(g_iToggle))
return HAM_IGNORED;
if(is_user_connected(iVictim) && g_iRespawnedTimes[iVictim] < get_pcvar_num(g_iSpawnsAllowed))
{
++g_iRespawnedTimes[iVictim];
ExecuteHamB(Ham_Spawn, iVictim);
return HAM_IGNORED;
}
return HAM_IGNORED;
}