AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SteamID Check (https://forums.alliedmods.net/showthread.php?t=50982)

tripc 02-08-2007 11:41

SteamID Check
 
i want to do only the SteamID like STEAM_0:0:563272
can do the command like this:

Code:


 {
  if (get_user_authid(players[i], STEAM_0:0:563272))
  client_print(players[i], print_chat, "%s", message)
 }

but its doesn't work, please help me

Sorry of my bad english

[ --<-@ ] Black Rose 02-08-2007 13:09

Re: SteamID Check
 
Code:
new pAuth[17] get_user_authid(id, pAuth, 16) if ( equal(pAuth, "STEAM_0:0:563272") ) {     // do stuff here }

MaximusBrood 02-08-2007 16:36

Re: SteamID Check
 
Max length of a steamid is 32.
Although such long steamids do not exist, (yet) they might reach the 20 character boundary soon.

I know it doesn't apply to this situation because you are only evaluating it. Just wanted to make clear :wink:

[ --<-@ ] Black Rose 02-09-2007 01:57

Re: SteamID Check
 
The longest I've seen is 18 long, I highly doubt they will reach even 19 or over 19.
Highest I've ever seen is "STEAM_0-0-138xxxxx"

tripc 02-12-2007 14:23

Re: SteamID Check
 
Code:

public cmdChat(id, level, cid)
{
 new message[192], name[32], players[32], inum, authid[32], userid
 
 read_args(message, 191)
 remove_quotes(message)
 get_user_authid(id, authid, 31)
 get_user_name(id, name, 31)
 userid = get_user_userid(id)
 get_players(players, inum)
 
 log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
 log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
 
 format(message, 191, "(Steam) %s :  %s", name, message)
 
 new pAuth[17]
 get_user_authid(id, pAuth, 16)
 
 for (new i = 0; i < inum; ++i)
 {
  if (equal(pAuth, "STEAM_0:1:4063234"))
  client_print(players[i], print_chat, "%s", message)
  }
 
 return PLUGIN_HANDLED
}

i did this code and its dont working,
can someone please fix it to my SteamID (STEAM_0:1:4063234)

[ --<-@ ] Black Rose 02-12-2007 14:30

Re: SteamID Check
 
You're getting id's auth 2 times.

Code:
 new pAuth[17]  get_user_authid(id, pAuth, 16)    for (new i = 0; i < inum; ++i)  {   if (equal(pAuth, "STEAM_0:1:4063234"))    client_print(players[i], print_chat, "%s", message)   }
-->
Code:
 new pAuth[17]    for (new i = 0; i < inum; ++i)  {   get_user_authid(players[i], pAuth, 16)   if (equal(pAuth, "STEAM_0:1:4063234"))    client_print(players[i], print_chat, "%s", message)   }
or even...
Code:
new g_id public client_putinserver(id) {     new pAuth[32]     get_user_authid(id, pAuth, 31)     if ( equal(pAuth, "STEAM_0:1:4063234") )         g_id = id } public client_disconnect(id) {     if ( id = g_id )         g_id = 0; } public cmdChat(id, level, cid) {     new message[192], name[32], authid[32], userid       read_args(message, 191)     remove_quotes(message)     get_user_authid(id, authid, 31)     get_user_name(id, name, 31)     userid = get_user_userid(id)       log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)     log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)     if ( g_id )         client_print(g_id, print_chat, "(Steam) %s :   %s", name, message)       return PLUGIN_HANDLED }

tripc 02-12-2007 15:22

Re: SteamID Check
 
the last one works but if i want to 2/3/4 SteamIDs?

can you write me the code of 2/3/4 SteamIDs?

and btw i got 1 warnning on this

Code:


public client_disconnect(id) {
if ( id = g_id )
g_id = 0;
}


XxAvalanchexX 02-12-2007 16:35

Re: SteamID Check
 
Code:
if ( id = g_id )
should become
Code:
if ( id == g_id )

[ --<-@ ] Black Rose 02-12-2007 16:46

Re: SteamID Check
 
Oh, yeah, sry. Wrote it here, not in AMXx Studio. ^^

tripc 02-12-2007 16:57

Re: SteamID Check
 
but you didnt answer about he SteamIDs
i want put few SteamID not only one

how i do this?


All times are GMT -4. The time now is 00:41.

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