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.
__________________