| Dark Kingdom |
04-15-2007 12:03 |
Re: [Respawn] Crash my server ...
Try this, you need fun module and cstrike module activated.
But if you want this for another game PM me and we can get this sorted out.
PHP Code:
#include <amxmodx> #include <fun> #include <cstrike>
#define DISABLE_CS 0
#define UNASSIGNED 0 #define TS 1 #define CTS 2 #define AUTO_TEAM 5
new bool:g_PistolsDisabled = false new const VERSION[] = "1.1"
public plugin_init(){
register_plugin("Respawn Forever", VERSION, "respawn")
register_event("DeathMsg","on_Death","a") register_cvar("sv_checkpistols", "1") register_cvar("sv_respawn", "1") register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)
register_clcmd("say","on_Chat") register_clcmd("say_team","on_Chat") }
public on_Chat(id) { if ( !get_cvar_num("sv_respawn") ) { client_print(id, print_chat, "* Respawn plugin disabled") return PLUGIN_CONTINUE }
new szSaid[32] read_args(szSaid, 31)
if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^"")) { spawn_func(id) } }
public check_pistols() { if ( get_cvar_num("sv_checkpistols") ) { set_task(1.0, "check_pistols") new mapname[32] get_mapname(mapname,31) if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 ) g_PistolsDisabled = true } }
public spawn_func(id) { new parm[1] parm[0]=id set_task(0.5,"player_spawn",72,parm,1) set_task(0.7,"player_spawn",72,parm,1)
set_task(0.9,"player_giveitems",72,parm,1) }
public on_Death() { if ( !get_cvar_num("sv_respawn") ) return PLUGIN_CONTINUE new victim_id = read_data(2) spawn_func( victim_id )
return PLUGIN_CONTINUE }
public player_giveitems(parm[1]) { new id = parm[0]
give_item(id, "item_suit") give_item(id, "weapon_knife")
if ( !g_PistolsDisabled ) { new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false get_user_weapons(id,wpnList,number) for (new i = 0;i < number;i++) { if (wpnList[i] == CSW_GLOCK18) foundGlock = true if (wpnList[i] == CSW_USP) foundUSP = true } if ( get_user_team(id)==TS && !foundGlock ) { give_item(id,"weapon_glock18") give_item(id,"ammo_9mm") give_item(id,"ammo_9mm") } else if ( get_user_team(id)==CTS && !foundUSP ) { give_item(id,"weapon_usp") give_item(id,"ammo_45acp") give_item(id,"ammo_45acp") } }
return PLUGIN_CONTINUE }
public player_spawn(parm[1]) { spawn(parm[0]) }
|