Quote:
Originally Posted by PawnHunter
PHP Code:
new pName[MAX_PLAYERS][MAX_PLAYER_NAME]; // global array
// OnPlayerConnect
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
// Anywhere in the script
... pName[playerid]
PHP Code:
// anywhere in the script
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
... pName
which is more preferred first method or second? And why?
|
I think the second one safer than other. I have experienced with global array sometimes names can be mixed other player's name. You should use that as stock.