10.10.2013, 10:37
Quote:
Not a bad tutorial
![]() Off topic now. Why don't people stock the GetPlayerName function instead of having to get the player name each time. pawn Code:
pawn Code:
![]() |
Let's say in a command you need to show 4 messages with the playerid's name. By using his method, he would call GetPlayerName only 1 time and your stock would call GetPlayerName 4 times. I hope you get what I mean.
The best way is to get the name ONLY 1 time on connect and use it later on.
pawn Code:
new
Name[ MAX_PLAYERS ][ MAX_PLAYER_NAME ]
;
// OnPlayerConnect:
GetPlayerName( playerid, Name[ playerid ], MAX_PLAYER_NAME );
// Everywhere else:
format(string,124,"[ADMIN] %s (%d) has reported %s (%d)",Name[playerid],playerid,Name[pid],pid);