SA-MP Forums Archive
Warning 202:... - 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: Warning 202:... (/showthread.php?tid=503293)



Warning 202:... - Mriss - 28.03.2014

Nevermind!, FIXED


Re: Warning 202:... - Vince - 28.03.2014

GetPlayerName doesn't work like that. See here for correct usage: https://sampwiki.blast.hk/wiki/GetPlayerName

However, I find that the easy way of inserting names is to simply get it once into a global variable in OnPlayerConnect and use that variable throughout the script.


Re: Warning 202:... - Konstantinos - 28.03.2014

I will make it easier for you to understand what Vince meant.

pawn Код:
// global:
new Player_Name[MAX_PLAYERS][21];

#define GetName(%0) Player_Name[%0]

// OnPlayerConnect:
GetPlayerName(playerid, Player_Name, 21);
Now, replace "GetPlayerName(playerid)" with "GetName(playerid)" and you're done.