AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A way to read a admin access by steamid? (https://forums.alliedmods.net/showthread.php?t=54097)

mysticssjgoku4 04-17-2007 01:30

A way to read a admin access by steamid?
 
Hey there, I was wondering,...you can do get_user_flags(id), but can you get user flags by steamid without having to read the files and such?

Thanks

Styles 04-17-2007 02:40

Re: A way to read a admin access by steamid?
 
I don't understand the question. please re-prase.

pRED* 04-17-2007 06:13

Re: A way to read a admin access by steamid?
 
He wants an equivalent to get_user_flags(id) that works with a steamid input instead of a player id. This would allow you to check for admin even if the player isn't connect.. not quite sure why you would want to do that but anyway..

The answer is no, you would have code it to read the admins.ini file yourself. I think..

[ --<-@ ] Black Rose 04-17-2007 13:20

Re: A way to read a admin access by steamid?
 
When the admin is offline I don't think you can get admin info from anything but the file.

Read the file, it's not a bad way.

Something like:
Code:
stock get_offline_flags(const SteamID[]) {         new file[64];     new len = get_localinfo("amxx_configsdir", file, 63);     copy(file[len], 63-len, "/users.ini");         new fh = fopen(file, "r");         new data[128];     new data2[32];         while( ! feof(fh) ) {                 fgets(fh, data, 127);                 trim(data);                 if ( ! data[0] || data[0] == '^n' || data[0] == ';' )             continue;                 if ( containi(data, SteamID) != -1 ) {             strbreak(data, data2, 31, data, 127);             strbreak(data, data2, 31, data, 127);             strbreak(data, data2, 31, data, 127);                         fclose(fh);             return read_flags(data2);         }     }         fclose(fh);     return 0; }

mysticssjgoku4 04-17-2007 21:40

Re: A way to read a admin access by steamid?
 
Alright thanks bud. :)


All times are GMT -4. The time now is 06:34.

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