Eu baixei o plugin na NET, so que não ta pegando
Função do Plugin: renascer player de zm nos mods infection e multiple infection apenas quando connectar-se ao servidor (para evitar ficar renascendo os retry)
zp50_respawn_on_connect.sma
Última edição por guh._.rds em 30/4/2012, 5:38 pm, editado 1 vez(es)
Função do Plugin: renascer player de zm nos mods infection e multiple infection apenas quando connectar-se ao servidor (para evitar ficar renascendo os retry)
zp50_respawn_on_connect.sma
Código:
#include < amxmodx >
#include < hamsandwich >
#include < zp50_core >
#include < zp50_gamemodes >
#include < zp50_random_spawn >
new const PLUGIN_VERSION[] = "1.0.0"
#define RESPAWN_AS_ZOMBIE true
#define USE_CSDM_SPAWNS false
#define TASK_RESPAWN 65639
new CvarRespawnDelay
new g_bsJustConnected;
new g_szGamemode1, g_szGamemode2
new g_iCurrentModeID
public plugin_init()
{
register_plugin("[ZP] Addon: Respawn on connect", PLUGIN_VERSION, "Excalibur.007")
register_clcmd( "jointeam", "_JoinTeam_" );
register_clcmd( "chooseteam", "_JoinTeam_" );
CvarRespawnDelay = register_cvar("zp_respawn_delay_on_connect", "3.0")
g_szGamemode1 = zp_gamemodes_get_id("Infection Mode")
g_szGamemode2 = zp_gamemodes_get_id("Multiple Infection Mode")
}
public client_putinserver(player)
{
g_iCurrentModeID = zp_gamemodes_get_current()
if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
{
g_bsJustConnected |= ( 1 << player );
}
}
public client_disconnect(player)
{
g_bsJustConnected &= ~( 1 << player );
remove_task(player+TASK_RESPAWN)
}
public _JoinTeam_(player)
{
if (~g_bsJustConnected & (1<<player))
return;
new team = get_user_team(player);
if (team == 0 || team == 3)
return;
g_bsJustConnected &= ~(1<<player);
set_task(get_pcvar_float(CvarRespawnDelay), "RespawnPlayer", player+TASK_RESPAWN);
}
public RespawnPlayer(taskid)
{
g_iCurrentModeID = zp_gamemodes_get_current()
if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
{
static player
player = (taskid - TASK_RESPAWN)
new team = get_user_team(player);
if(is_user_alive(player) || team == 0 || team == 3 )
return
zp_core_respawn_as_zombie(player, RESPAWN_AS_ZOMBIE)
ExecuteHamB(Ham_Spawn, player)
zp_random_spawn_do(player, USE_CSDM_SPAWNS)
}
}
Última edição por guh._.rds em 30/4/2012, 5:38 pm, editado 1 vez(es)