HI,
This is a method i am using to respawn players ,
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta_util>
#include <hamsandwich>
#define PLUGIN "testn"
#define VERSION "1.0"
#define AUTHOR "sam"
new PcvarProtectionTime
new g_itimeleft[33]
new PcvarRespawnTime
const RESPAWNTIME = 2
const PROTECTIONTIME = 0
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam( Ham_Killed, "player", "fw_PlayerKilled" )
PcvarRespawnTime = register_cvar( "respawntime", "" )
set_pcvar_num( PcvarRespawnTime, RESPAWNTIME )
// Add your code here...
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
set_task( get_pcvar_float(PcvarRespawnTime), "PlayerRespawn", victim )
}
public PlayerRespawn( id )
{
if( is_user_alive(id) )
return
entity_set_int(id, EV_INT_deadflag, DEAD_RESPAWNABLE)
entity_set_int(id, EV_INT_iuser1, 0)
call_think(id)
DispatchSpawn(id)
fm_set_user_health( id, 100 )
g_itimeleft[id] = get_pcvar_num( PcvarProtectionTime )
set_task( 3.0, "PlayerProtection", id )
}
I want only Terrorists to respawn ... but i cant seem to be able to do that .. , either both ct and T respawn , or neither respawn ... little help , and explain to my how you get it fixed
__________________