can someone edit this so a command can be issued to "spectators team"
--file attached at bottom
//----------------------------------------------------------------------------------------------
#include <amxmodx>
#include <amxmisc>
#include <fun>
//----------------------------------------------------------------------------------------------
public plugin_init()
{
register_plugin("Admin Revive II","0.1","SniperBeamer")
register_cvar("amx_revivemsg","1")
register_concmd("amx_revive","admin_revive",A DMIN_LEVEL_A,"<authid, nick, @team or #userid>")
}
//----------------------------------------------------------------------------------------------
public admin_revive(id,level,cid)
{
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
if (arg[0]=='@')
{
new plist[32],pnum
get_players(plist,pnum,"e",arg[1])
if (pnum==0)
{
console_print(id,"[AMXX] No clients in such team @CT or @TERRORIST")
return PLUGIN_HANDLED
}
for (new i=0; i<pnum; i++)
{
if (!(get_user_flags(plist[i])&ADMIN_IMMUNITY))
{
new ids[3]
num_to_str(plist[i],ids,2)
spawn(plist[i])
set_task(0.1,"revivePl",0,ids,2)
}
}
console_print(id,"[AMXX] Revived the %ss",arg[1])
if (get_cvar_num("amx_revivemsg"))
{
if (equali(arg[1],"CT")) set_hudmessage(0,20,220,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
else set_hudmessage(220,20,0,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
show_hudmessage(0,"The %ss have been revived!",arg[1])
}
}
else
{
new pName[32],player = cmd_target(id,arg,3)
if (!player) return PLUGIN_HANDLED
new ids[3]
num_to_str(player,ids,2)
spawn(player)
set_task(0.1,"revivePl",0,ids,2)
get_user_name(player,pName,31)
console_print(id,"[AMXX] Revived %s",pName)
if (get_cvar_num("amx_revivemsg"))
{
set_hudmessage(0,200,0,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
show_hudmessage(0,"%s has been revived!",pName)
}
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public revivePl(ids[])
{
new id = str_to_num(ids)
spawn(id)
if (get_user_team(id)==1)
{
give_item(id,"weapon_knife")
give_item(id,"weapon_glock18")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
}
else
{
give_item(id,"weapon_knife")
give_item(id,"weapon_usp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
}
}
//----------------------------------------------------------------------------------------------
|