Quote:
Originally Posted by SuperViper
If you want to keep using the custom function to gather names, you could use:
pawn Code:
new playersName[MAX_PLAYERS][MAX_PLAYER_NAME];
public OnPlayerDisconnect(playerid) { playersName[playerid][0] = '\0'; return 1; }
GetPlayersName(playerid) { if(isnull(playersName)) { GetPlayerName(playerid, playersName, MAX_PLAYER_NAME); }
return playersName; }
This would be a better alternative for users who have a big script using this function already.
|
Defining it would make it easier I believe.
pawn Code:
#define GetName(%0) Player_Name[%0]
static
Player_Name[MAX_PLAYERS][MAX_PLAYER_NAME];
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, Player_Name[playerid], MAX_PLAYER_NAME);
return 1;
}