AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Kicking help (https://forums.alliedmods.net/showthread.php?t=28529)

allenwr 05-16-2006 22:28

Kicking help
 
can some one throw me a bone (a code snipet)

Code:
public cmdkick(id, level, cid) {     if (!cmd_access(id, level, cid, 2))         return PLUGIN_CONTINUE
now, i just need the finished code in the most basic form to kick someone.

KoST 05-16-2006 22:32

Code:
    new userid = get_user_userid(id)     server_cmd("kick #%d",userid) }

allenwr 05-16-2006 22:35

no no no... i mean, i am creating my own amx_kick thing... it does a different option, i was reading admincmd.sma... but i was wondering if there was a simpler way to make an amx_kick thing.

KoST 05-16-2006 22:41

i updated my post, this is the easiest way to kick sb., i guess.

Xanimos 05-16-2006 22:46

that would kick whoever used the command.

allenwr 05-16-2006 22:49

can you help me then?

Xanimos 05-16-2006 22:51

if you use 'your_cmd' followed by a person this is how you kick them.
Code:
new arg[36] read_argv(1 , arg , 35) new target = cmd_target(id , arg , 11) if(!target)     return PLUGIN_HANDLED new userid = get_user_userid(target) server_cmd("kick #%d",userid)

allenwr 05-16-2006 23:00

im a newb, but the code is pulling up a lot of errors... im not sure how, or what i should do to fix it.

KoST 05-16-2006 23:05

Code:
public cmdKick(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, 1)     if (!player)         return PLUGIN_HANDLED     new userid2     userid2 = get_user_userid(player)         server_cmd("kick #%d", userid2)     return PLUGIN_HANDLED }


All times are GMT -4. The time now is 16:27.

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