Короче дело такое, мы с другом поставили плагин respawn но есле человек заходит послетого как карта поменялась его не воскрешает, и есле написать /respawn то тоже не воскрешает... Зделайте плиз так чтобы когда я напишу /respawn меня воскрешало.
IP сервера 91.211.118.18:27025
Code
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Respawn"
#define VERSION "1.1"
#define AUTHOR "st0ka"
new respawned[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("amx_respawn","1")
register_cvar("amx_autorespawn","1")
register_cvar("amx_autorespawn_players","1")
register_event("DeathMsg","event_death","a")
register_clcmd("say /respawn","p_respawn")
register_clcmd("say_team /respawn","p_respawn")
}
public event_death()
{
new id = read_data(2)
if(get_cvar_num("amx_autorespawn") == 0 && get_cvar_num("amx_respawn") == 0)
{
return PLUGIN_HANDLED
}
else if(get_cvar_num("amx_autorespawn") == 1 && get_cvar_num("amx_respawn") == 1)
{
set_task(0.1,"respawn",id)
set_task(2.0,"r_check",id)
}
return PLUGIN_HANDLED
}
public respawn(id)
{
new num = get_playersnum()
if(num >= get_cvar_num("amx_autorespawn_players"))
{
new CsTeams:team = cs_get_user_team(id)
if(team == CS_TEAM_CT)
{
cs_user_spawn(id)
give_item(id,"weapon_knife")
give_item(id,"weapon_usp")
cs_set_user_bpammo(id,CSW_USP,24)
respawned[id] = true
}
else if(team == CS_TEAM_T)
{
cs_user_spawn(id)
give_item(id,"weapon_knife")
give_item(id,"weapon_glock18")
cs_set_user_bpammo(id,CSW_GLOCK18,40)
respawned[id] = true
}
}
else
{
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public p_respawn(id)
{
if(get_cvar_num("amx_respawn") == 1)
{
new CsTeams:team = cs_get_user_team(id)
if(team == CS_TEAM_CT && !is_user_alive(id))
{
cs_user_spawn(id)
give_item(id,"weapon_knife")
give_item(id,"weapon_usp")
cs_set_user_bpammo(id,CSW_USP,24)
}
else if(team == CS_TEAM_T && !is_user_alive(id))
{
cs_user_spawn(id)
give_item(id,"weapon_knife")
give_item(id,"weapon_glock18")
cs_set_user_bpammo(id,CSW_GLOCK18,40)
}
}
}
public r_check(id)
{
if(!respawned[id])
{
respawn(id)
}
}