Raised This Month: $ Target: $400
 0% 

get_user_authid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jordan
Veteran Member
Join Date: Aug 2005
Old 04-05-2007 , 15:33   get_user_authid
Reply With Quote #1

How do I find out what the ID I'm getting is when I use get_user_authid?

Like lets say I want to do something only if a certain ID is in the server?

Thanks a lot
Jordan is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-05-2007 , 16:02   Re: get_user_authid
Reply With Quote #2

hmm...maybe...
PHP Code:
 register_concmd("amx_command""command"ADMIN_KICK,"<#User ID>")
 
public 
command(id,level,cid
{
 if(!
cmd_access(idlevelcid2))
  return 
PLUGIN_HANDLED;
 
 static 
arg[32];
 
read_argv(1arg31);
 
 new 
player cmd_target(idarg2);
 
 if(!
player)
  return 
PLUGIN_HANDLED;
 
 static 
userid[24];
 
get_user_authid(id,userid,23);
 
set_user_health(id,200); //Just an Ex:
//bla
//bla bla

So when you use amx_command you must enter User ID like : amx_command STEAM_0:1:213123!
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 04-05-2007 at 16:12.
Alka is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 04-05-2007 , 16:15   Re: get_user_authid
Reply With Quote #3

No no I don't want to have to enter anything I kind of want it to be automatic.
Jordan is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-05-2007 , 16:18   Re: get_user_authid
Reply With Quote #4

hmm....more specific...!
I Think,i get it!

hmm... =>>
PHP Code:
public plugin_init() {
  
register_event("HLTV","checkauthid""a","1=0""2=0"); // Called on New round!
//bla bla 
}
 
public 
checkauthid() {
 
 for(new 
i=1;i<32;i++)
 { 
  if(!
is_user_alive(i))
   return 
PLUGIN_CONTINUE;
 
get_user_authid(i)
if(
get_user_authid(i) == STEAM_0:1:123321) {
//things...
//bla...
set_user_health(i,200//Ex:

This should work.... "STEAM_0:1:123321" <-You'r authid
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 04-05-2007 at 16:43.
Alka is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 04-05-2007 , 23:37   Re: get_user_authid
Reply With Quote #5

get_players instead of "32"
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-05-2007 , 23:43   Re: get_user_authid
Reply With Quote #6

i belive it is something like this
PHP Code:
public plugin_init() {
    
register_event("HLTV","checkauthid""a","1=0""2=0"); // Called on New round!
    //bla bla 
}
 
public 
checkauthid() {
    new 
steamid[32]
    for(new 
i=1;i<32;i++){ 
    
        if(!
is_user_alive(i))
            continue;
 
        
get_user_authid(id,steamid,32)
        if(
equali(steamid,"STEAM_0:1:123321")) {
            
//things...
            //bla...
            
set_user_health(i,200//Ex:
        
}
    }  

__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
SAMURAI16
BANNED
Join Date: Sep 2006
Old 04-05-2007 , 23:52   Re: get_user_authid
Reply With Quote #7

this is better :
Code:
#include <amxmodx> new g_maxplayers; public plugin_init() {     register_plugin("","","");         register_event("HLTV","checkauthid", "a","1=0", "2=0");         g_maxplayers = get_maxplayers(); } public checkauthid() {     new i;     for(i = 1; i <= g_maxplayers; i++)     {         if(!is_user_connected(i))         continue;                     new authid[32]         get_user_authid(i,authid,31);                 if(equali(authid,"STEAM_0:1:123321"))         {                 //stuff                 // ...                         }     } }

Because steamid is called on loop, only if is necessary, len for authid is 31 not 32.
And istead of 32 get_maxplayers

Last edited by SAMURAI16; 04-06-2007 at 01:06.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
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 15:29.


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