Raised This Month: $ Target: $400
 0% 

amx_command #userid (userid to index)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elpouletorange
Senior Member
Join Date: Oct 2007
Old 03-28-2009 , 19:37   amx_command #userid (userid to index)
Reply With Quote #1

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..
__________________
I am 42% addicted to Counterstrike. What about you?

No more CS for me....
elpouletorange is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-28-2009 , 19:38   Re: amx_command #userid (userid to index)
Reply With Quote #2

cmd_target() ?
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-28-2009 , 19:50   Re: amx_command #userid (userid to index)
Reply With Quote #3

status ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-28-2009 , 19:56   Re: amx_command #userid (userid to index)
Reply With Quote #4

example
PHP Code:
server_cmd("kick #%d ^"Sorry but you have too high ping, try later...^"",get_user_userid(id)) 
__________________
alan_el_more is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-28-2009 , 20:28   Re: amx_command #userid (userid to index)
Reply With Quote #5

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

__________________
ILUSION is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 03-29-2009 , 06:25   Re: amx_command #userid (userid to index)
Reply With Quote #6

Quote:
Originally Posted by alan_el_more View Post
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?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Reply



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


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