AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Use something if SteamID matching? (https://forums.alliedmods.net/showthread.php?t=12104)

LynX 04-05-2005 07:30

Use something if SteamID matching?
 
I would like to make that you can use one function only if your SteamID matches with those in plugin.
So, can you show me an example of that ( an array with stored SteamID's and restriction if not using same SteamID ) ? Thanks.

FeuerSturm 04-05-2005 11:32

here's the easiest example:

Code:
new steamid[32] get_user_authid(id,steamid,31) if(equal(steamid,"STEAM_0:1:23456")){     client_print(id,print_chat,"You have been recognized by the plugin with SteamID: %s",steamid) } else {     client_print(id,print_chat,"Your SteamID: %s is unknown by the plugin!",steamid) }

hope that helps

stigma 04-05-2005 11:48

Hmm FireStorm - How does the plugin know what SteamID should match to? Reading from a file?

FeuerSturm 04-05-2005 11:53

in my example i simply wrote the steamid into the code,
but you can make the plugin read steamids from file
and make it compare them like this:


Code:
new steamid[32] get_user_authid(id,steamid,31) new steamidlist[64] get_configsdir(steamidlist,64) format(steamidlist,63,"%s/steamidlist.cfg",steamidlist) if(file_exists(steamidlist)){     new steamidline[128],a,line = 0     while(read_file(steamidlist,line++,steamidline,128,a)){         if(equal(steamid,steamidline)){             client_print(id,print_chat,"You have been recognized by the plugin with SteamID: %s",steamid)         }         else {                 client_print(id,print_chat,"Your SteamID: %s is unknown by the plugin!",steamid)         }     } } else if(!file_exists(steamidlist)){     log_amx("SteamID List not found!") }

stigma 04-05-2005 11:55

Ooh okay :)


All times are GMT -4. The time now is 09:52.

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