PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta_util >
#include < biohazard >
new cvar_respawn, cvar_enf_sec, cvar_godmode, cvar_godmode_timer
public plugin_init()
{
register_plugin("[BIO] RESPAWN","1.0","LVNDR")
register_event("DeathMsg","olum","a")
register_event("ShowMenu","menusecim","b","4&Team_Select")
register_event("VGUIMenu","menusecim","b","1=2")
register_forward(FM_ClientKill, "kill_komut")
RegisterHam(Ham_Spawn, "player", "Ham_Sspawn", 1)
cvar_enf_sec = register_cvar("bh_enfeksiyon_tipi", "1")
cvar_respawn = register_cvar("bh_respawn","1")
cvar_godmode = register_cvar("bh_godmode", "1")
cvar_godmode_timer = register_cvar("bh_godmode_timer", "3.0")
return PLUGIN_CONTINUE
}
public kill_komut()
{
if(get_pcvar_num(cvar_respawn))
return FMRES_SUPERCEDE
return FMRES_IGNORED;
}
public olum()
{
if(get_pcvar_num(cvar_respawn))
{
new id = read_data(2)
new o_id[2]
o_id[0] = id
set_task(0.5,"respawn",0,o_id,2)
}
return PLUGIN_CONTINUE
}
public menusecim(id)
{
if(get_pcvar_num(cvar_respawn))
{
new o_Id[2]
o_Id[0] = id
set_task(10.0,"respawn",0,o_Id,2)
}
return PLUGIN_CONTINUE
}
public respawn(o_id[])
{
new id = o_id[0]
if (!is_user_connected(id))
return PLUGIN_HANDLED
if(cs_get_user_team(id) == CS_TEAM_UNASSIGNED || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
return PLUGIN_HANDLED
if (!is_user_alive(id))
{
set_task(3.0,"Respawn_Player", id)
}
return PLUGIN_CONTINUE
}
public Respawn_Player(id)
{
if (!is_user_connected(id))
return PLUGIN_HANDLED
if(cs_get_user_team(id) == CS_TEAM_UNASSIGNED || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
return PLUGIN_HANDLED
if (!is_user_alive(id))
{
ExecuteHamB(Ham_CS_RoundRespawn, id)
}
return PLUGIN_CONTINUE
}
public Ham_Sspawn(id)
{
if(game_started())
{
if(is_user_connected(id))
set_task(0.5, "enfeksiyon_tipi", id)
}
}
public enfeksiyon_tipi(id)
{
if(is_user_connected(id))
{
switch(get_pcvar_num(cvar_enf_sec))
{
case 1: insan(id)
case 2: zombie(id)
case 3:
{
switch(random_num(1,2))
{
case 1: insan(id)
case 2: zombie(id)
}
}
}
if(get_pcvar_num(cvar_godmode))
{
fm_set_user_godmode(id, 1)
set_task(get_pcvar_float(cvar_godmode_timer), "stop_god", id)
}
}
}
public stop_god(id)
{
fm_set_user_godmode(id, 0)
}
public zombie(id)
{
if(is_user_zombie(id))
{
infect_user(id, 0)
cs_set_user_team(id, CS_TEAM_T)
}
}
public insan(id)
{
if(!is_user_zombie(id))
{
cure_user(id)
cs_set_user_team(id, CS_TEAM_CT)
}
fm_give_item(id, "weapon_m4a1")
fm_give_item(id, "weapon_deagle")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_smokegrenade")
fm_give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_M4A1, 200)
cs_set_user_bpammo(id, CSW_DEAGLE, 200)
cs_set_user_bpammo(id, CSW_HEGRENADE, 1)
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1)
cs_set_user_bpammo(id, CSW_FLASHBANG, 1)
}