04.07.2011, 20:45
Yes, and just -very old- a PlayerName(playerid); function (or just use: playerName[playerid] (var). The most PlayerName functions looks like this:
My script has the global variable "playerName[playerid]". (new playerName[MAX_PLAYERS][MAX_PLAYER_NAME];). When a player connects, the script automatic gets the name, store it into playerName[playerid] so you can safe it later (yes it's being changed when you use SetPlayerName).
And so, the PlayerName function of mine looks like this:
:P
pawn Код:
stock PlayerName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName)); //Or instead of 'sizeof(pName)' just 'MAX_PLAYER_NAME' (my style)
return pName;
}
And so, the PlayerName function of mine looks like this:
pawn Код:
stock PlayerName(playerid)
return playerName[playerid];