SA-MP Forums Archive
GetPlayerName and ID stock - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetPlayerName and ID stock (/showthread.php?tid=417230)



GetPlayerName and ID stock - emokidx - 20.02.2013

Can I make a stock that returns both the Name and ID of the player?
I made this but doesn't work ingame.
pawn Код:
stock GetPnameid()
{
    new pname[52],pid;
    GetPlayerName(pid, pname, sizeof(pname));
   
    return pname, pid;
}



Re : GetPlayerName and ID stock - lelemaster - 20.02.2013

I don't think you can, but why not just making this?

pawn Код:
stock GetPnameid(pid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(pid, pname, sizeof(pname));
    return pname;
}
Anyways, you will still need to have the good player id. With your stock, it will always return name of the player id 0.


Re: GetPlayerName and ID stock - emokidx - 20.02.2013

Alright, thanks.