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?
|
Thats again the argument of speed vs. memory, calling a variable or array is faster than calling a function, even a native one, so first one is faster, and second one uses less memory, then there is your personal reference of what path you choose to go.