Raised This Month: $ Target: $400
 0% 

amx plugin revert error!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
tarin
Member
Join Date: May 2005
Old 09-06-2005 , 23:36  
Reply With Quote #8

it was the same plugin but thanx for helping!

Code:
/* AMX Mod script.
* Settings: amx_revivemsg (0/1) - announces when a player is revived
* Usage: amx_revive <authid, nick, @team or #userid>
*/

#include <amxmodx>
#include <fun>

public plugin_init()
{
	register_plugin("Admin Revive II","0.1","Mattcook")
	register_cvar("amx_revivemsg","0")
	register_concmd("amx_revive","admin_revive",ADMIN_SLAY,"<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,"[AMX] No clients in such team")
			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)
				user_spawn(plist[i])
				set_task(0.1,"revivePl",0,ids,2)
			}
		}
		console_print(id,"[AMX] 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)
		user_spawn(player)
		set_task(0.1,"revivePl",0,ids,2)
		get_user_name(player,pName,31)
		console_print(id,"[AMX] 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)
	user_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")
	}
}
__________________
tarin is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode