AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amx_command #userid (userid to index) (https://forums.alliedmods.net/showthread.php?t=88749)

elpouletorange 03-28-2009 19:37

amx_command #userid (userid to index)
 
Hello, I forgot how to get the index of the player with the #userid, exemple amx_kick #userid... Can anybody tell me how please..?

Thanks..:)

Arkshine 03-28-2009 19:38

Re: amx_command #userid (userid to index)
 
cmd_target() ?

ConnorMcLeod 03-28-2009 19:50

Re: amx_command #userid (userid to index)
 
status ?

alan_el_more 03-28-2009 19:56

Re: amx_command #userid (userid to index)
 
example
PHP Code:

server_cmd("kick #%d ^"Sorry but you have too high ping, try later...^"",get_user_userid(id)) 


ILUSION 03-28-2009 20:28

Re: amx_command #userid (userid to index)
 
Hmmm...

PHP Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init() 
{
    
register_concmd("amx_test""command"ADMIN_KICK"<nick> or <#id>")
}

public 
command(idlevelcid)
{
    if (!
cmd_access(idlevelcid1)) // 1 without example || 2 for get the example of usage
        
return PLUGIN_HANDLED

    
new arg[32
    
read_argv(1arg31// read the nick or #id

    
new target cmd_target(idargCMDTARGET_OBEY_IMMUNITY CMDTARGET_ALLOW_SELF)
    
    if (!
target) return PLUGIN_HANDLED
        
    server_cmd
("kick #%d"get_user_userid(target)) // get the user id of target
    
    
return PLUGIN_HANDLED



Owyn 03-29-2009 06:25

Re: amx_command #userid (userid to index)
 
Quote:

Originally Posted by alan_el_more (Post 791699)
example
PHP Code:

server_cmd("kick #%d ^"Sorry but you have too high ping, try later...^"",get_user_userid(id)) 


btw why doesn't it sometimes work? when it doesn't i have to replace #%d with #%i and it works fine, why?


All times are GMT -4. The time now is 08:53.

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