 |
|
New Member
|

08-01-2009
, 08:52
Re: My first plugin
|
#6
|
Quote:
Originally Posted by fysiks
To make the disconnected player see some info you need to use the Half-Life engine command "kick" with a reason.
Also, very important, Learn to indent your code. It makes it much more easy for us (or anyone) to read and understand code.
Here ya go, try this:
PHP Code:
/*This plugin was made by SpArTaNN ! *With this plugin you can disconnect a specified player ! *Command: amx_disconnect HF*/
#include <amxmodx> #include <amxmisc> public plugin_init() { register_plugin("Disconnect Player","1.0","SpArTaNN"); register_concmd("amx_disconnect","disconnect_ cmd",ADMIN_KICK,"- <jucator>"); } public disconnect_cmd(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,9); if(!player) return PLUGIN_HANDLED;
new adminname[32],playername[32]; get_user_name(id,adminname,31); get_user_name(player,playername,31); new userid_target = get_user_userid(player)
// client_cmd(player,"disconnect"); server_cmd("kick #%d ^"%s^"", userid_target, "You have been kicked by an admin") client_print(0,print_chat,"Admin %s: l-a deconnect pe %s",adminname,playername);
return PLUGIN_HANDLED; }
I added the "server_cmd()" command and commented your client_cmd() command. Oh, and indented your code  .
|
Thanks   Now I know some function 
Thanks everybody for help
|
|
|
|