AlliedModders

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

Burnzy 07-09-2004 23:19

get_user_steamid
 
how do u get the steam id?
get_user_steamid
is there a different way to use it... and if so... in which include is it in?

Ryan 07-09-2004 23:31

Code:
new szSteamId[35]; get_user_authid( id, szSteamId, 34 );

this function does not return an integer, but rather inserts the steamid into the string you pass with it (szSteamId).

you can also use this forward (event) to catch when a player actually receives their steamid.

Code:
new g_szSteamIds[33][35];    // stores all player's steamids public client_authorized( id ) {     get_user_authId( id, g_szSteamIds[id], 34 );     return PLUGIN_CONTINUE; }

Hope this helps :)

Dygear 07-09-2004 23:48

Code:
/* Gets player authid. */ native get_user_authid(index, authid[] ,len);

This will return the wonid or the steamid.

Burnzy 07-10-2004 01:15

Code:
#include <amxmodx> #include <amxmisc> new usersfile[40] = "" public amx_user_add(id,level,cid) { if (!cmd_access(id,level,cid,2))       return PLUGIN_HANDLED new arg[32] new AUTHID new player new f_admin[15] new f_password[15] new f_access[25] new f_flags[15] new line = 1 new RF_line[100] new found = 0 new user_name[32] read_argv(1,arg,32) player = cmd_target(id,arg,0) if(!player)    return PLUGIN_HANDLED AUTHID = get_user_authid(player) get_user_name(player,user_name,32)     while(line != 0) {    line = read_file(usersfile,line,RF_line,100,line)    parse(RF_line,f_admin,15,f_password,15,f_access,25,f_flags,15)    if (str_to_num(f_admin) == AUTHID){       found = 1       break    } } if(found) {    console_print(id,"Player: %s, is already in the users.ini!",user_name)    return PLUGIN_HANDLED } new WF_name[32] new WF_line[100] format(WF_line,100,"^"%d^" ^"*^" ^"bcdefghijkmnopqrstuz^" ^"ce^"",AUTHID) format(WF_name,32,"^n//%s",user_name) write_file(usersfile,WF_name,-1) write_file(usersfile,WF_line,-1) set_user_flags(AUTHID,read_flags("bcdefghijkmnopqrstuz")) client_print(id,print_console,"%s(%d) added as an admin!",user_name,AUTHID) return PLUGIN_HANDLED } public amx_user_edit(id,level,cid) { if (!cmd_access(id,level,cid,2))       return PLUGIN_HANDLED
thats the plugin i got now... im trying to make it so AuthId will work... i tried that way i gto it now... but i get a warning.

Code:
new AUTHID

Code:
AUTHID = get_user_authid(player)

SidLuke 07-10-2004 02:46

native get_user_authid(index, authid[] ,len);

so in code use:
Code:

new AUTHID[32]
get_user_authid(index, AUTHID ,31)

[] tells you that this is an array and using len you can tell function how many fields you want to write.

Ryan 07-10-2004 02:48

Quote:

Originally Posted by Ryan
Code:
new szSteamId[35]; get_user_authid( id, szSteamId, 34 );

this function does not return an integer, but rather inserts the steamid into the string you pass with it (szSteamId).

dont know if you saw it, but i did mention that it doesnt return a value...

Burnzy 07-10-2004 09:40

thx guys


All times are GMT -4. The time now is 14:43.

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