Raised This Month: $ Target: $400
 0% 

amx_disarm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[nFb]GraveKeeper
Senior Member
Join Date: Mar 2004
Location: Connecticut, U.S.A.
Old 04-25-2004 , 16:46   amx_disarm
Reply With Quote #1

I want to convert this plugin to work with amxx. The errors that I get are highlighted in bold. Anyone know what they need to be changed to?

This plugin rocks and I want to convert it to amxx.

Thanks in advance.

/* AMX Mod script.
*
* (c) Copyright 2002-2003, Mike Cao ([email protected])
* This file is provided as is (no warranties).
*/

#include <amxmodx>
#include <amxmisc>

/*
*
* This plugin allows admins to disarm players. It teleports
* them offscreen, removes their weapons, and teleports them
* back.
*
* Usage: amx_disarm <authid, nick, @team or #userid>
* Examples:
* amx_disarm @CT
* amx_disarm @TERRORIST
* amx_disarm #213
*
*/

disarm_player(id,victim){
new name[32], origin[3]
get_user_origin(victim,origin)
origin[2] -= 2000
set_user_origin(victim,origin)
new iweapons[32], wpname[32], inum
get_user_weapons(victim,iweapons,inum)
for(new a=0;a<inum;++a){
get_weaponname(iweapons[a],wpname,31)
engclient_cmd(victim,"drop",wpname)
}
engclient_cmd(victim,"weapon_knife")
origin[2] += 2005
set_user_origin(victim,origin)
get_user_name(victim,name,31)
console_print(id,"Client ^"%s^" has been disarmed",name)
}

public admin_disarm(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 players[32], /*name[32],*/ inum
get_players(players,inum,"ae",arg[1])
if (inum==0){
console_print(id,"No alive clients in such team")
return PLUGIN_HANDLED
}
for(new a=0;a<inum;++a){
/*if (get_user_flags(players[a])&ADMIN_IMMUNITY){
get_user_name(players[a],name,31)
console_print(id,"Skipping ^"%s^" because client has immunity",name)
continue
}*/
disarm_player(id,players[a])
}
}
else {
new player = cmd_target(id,arg,5)
if (!player) return PLUGIN_HANDLED
disarm_player(id,player)
}
return PLUGIN_HANDLED
}

public plugin_init(){
register_plugin("Admin Disarm","1.1","mike_cao")
register_concmd("amx_disarm","admin_disarm",A DMIN_LEVEL_A,"<authid, nick, @team or #userid>")
return PLUGIN_CONTINUE
}
[nFb]GraveKeeper is offline
Send a message via AIM to [nFb]GraveKeeper
Hangman5386
Member
Join Date: Mar 2004
Old 04-25-2004 , 16:52  
Reply With Quote #2

Use
Code:
#include <fun>
. The native is to find in $moddir/addons/amxx/scripting/includes/fun.inc.

BTW: Please use Small-tags when posting small-code.
Hangman5386 is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 04-25-2004 , 17:48  
Reply With Quote #3

disarm's part of the all in one plugin
__________________
Please do NOT PM for support.

Only ask for support in plugin threads.

TunedChaos.com - Precision Tuned Game Servers
FlyingMongoose is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 04-25-2004 , 17:53  
Reply With Quote #4

Quote:
Originally Posted by FlyingMongoose
disarm's part of the all in one plugin
yep

Admin All in ONe commands that I posted just a while back has disarm included with quite a few other plugins such as slay2 and rocket.
__________________

BigBaller is offline
[nFb]GraveKeeper
Senior Member
Join Date: Mar 2004
Location: Connecticut, U.S.A.
Old 04-25-2004 , 19:52  
Reply With Quote #5

Ah most excellent. Thanks fellows.
[nFb]GraveKeeper is offline
Send a message via AIM to [nFb]GraveKeeper
Reply


Thread Tools
Display Modes

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 22:44.


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