Raised This Month: $ Target: $400
 0% 

amx_kick help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-10-2010 , 01:33   amx_kick help
Reply With Quote #1

I'm a complete newb at scripting, and I can't get my amx_kick plugin to work. I don't want the user to be able to put the userid of the user or anything. Just part of the name. When I test it out, nothing happens, it doesn't kick. Can you tell me what's wrong with the code?
Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "amx_kick"
#define AUTHOR "nikhilgupta345"
#define VERSION "1.0"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_kick", "cmd_kick", ADMIN_KICK, "<nick>")
}

public cmd_kick(id, level, cid)

{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED


new arg[32]
read_argv(1, arg, 31)

new player=cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
if(!player)
{

    console_print(id, "Cannot find player %s", arg)
}
else {
server_cmd("kick %s", arg)
}
return PLUGIN_HANDLED
}
P.S. I took some of the code from the admincmd.sma
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 


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 07:08.


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