AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting an ID (https://forums.alliedmods.net/showthread.php?t=40503)

tsilenzio 06-28-2006 12:37

Getting an ID
 
Hello, I am VERY new to scripting. I was wondering how you obtain an authid, and if its a string like a steam ID like STEAM:0:0:123456 or if its a 3 digit number like 124 or just a single digit number. Also I was wondering if you do or dont include the # infront of it.

And if you dont keep the # infront of it, then how do u seperate it from it?. If you dont mind can you give me a small example? And explain a little bit. Sorry to ask for so much, I am just really confused on this part of scripting.

Thank you SO much in advance!

- tsilenzio

edit: Also if possible show how to detect if there is no player ID by the number the user provides?

Dizzy 06-28-2006 13:02

Re: Getting an ID
 
get_user_authid ( index, authid[], len )

Get more on that here...

http://www.amxmodx.org/funcwiki.php?go=func&id=166

tsilenzio 06-28-2006 13:06

Re: Getting an ID
 
yea but does that give me their ID, or search for them by their id? I get confused very easily sorry :(

Dizzy 06-28-2006 13:12

Re: Getting an ID
 
When you do this command whoever triggers the function by what ever means the plugin uses such as a client command or console command it will take their AuthID, as in the person who triggered the event.

tsilenzio 06-28-2006 15:26

Re: Getting an ID
 
Yea, but thats not what i want, I want it where if i type amx_blah #314 . how could i get it to search for this ID? And return a value for it?

BetaX 06-28-2006 18:31

Re: Getting an ID
 
You mean like if you wanted to vote someone off? :O I donno if anyone has ever wanted to do that... hm.

tsilenzio 06-28-2006 20:11

Re: Getting an ID
 
I am making a plugin called amx_delhacker which takes the parameters <name, or #authid> And then it will figure out if that was the name of the person or the authid,.. i was wondering how to search for people by authid.. or is that the id's that it fills up when u run the command: get_players()?

Hawk552 06-30-2006 13:09

Re: Getting an ID
 
Quote:

Originally Posted by tsilenzio
I am making a plugin called amx_delhacker which takes the parameters <name, or #authid> And then it will figure out if that was the name of the person or the authid,.. i was wondering how to search for people by authid.. or is that the id's that it fills up when u run the command: get_players()?

You'll have to manually scan through. Here's a function that'll do it for you:
Code:
stock find_player_authid(szAuthid[]) {     static szPlayerAuthid[36],iPlayers[32],iPlayersnum     get_players(iPlayers,iPlayersnum)         for(new iCount = 0;iCount < iPlayersnum;iCount++)     {         iPlayer = iPlayers[iCount]                 get_user_authid(iPlayer,szPlayerAuthid,35)         if(equal(szAuthid,szPlayerAuthid))             return iPlayer     }         return 0 }

If it finds a player, it'll return something > 0, otherwise it'll return 0.


All times are GMT -4. The time now is 08:02.

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