24.02.2014, 17:02
There are many problems with your code. You want to use per-player textdraws and you use TextDrawSetString instead of PlayerTextDrawSetString. You don't have an array for each player-text ID but instead you use 1 variable. And the last one is just a pointless thing you do. You get the name and you copy a string to another using format instead of directly use it as a text.
pawn Code:
// global:
new PlayerText: HUDNAMESTR[MAX_PLAYERS];
// OnPlayerConnect:
HUDNAMESTR[playerid] = PlayerText: INVALID_TEXT_DRAW;
// create per-player textdraw..
public OnPlayerSpawn(playerid)
{
PlayerInfo[playerid][pLogged] = 1;
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
PlayerTextDrawSetString(playerid, HUDNAMESTR[playerid], playername);
PlayerTextDrawShow(playerid, HUDNAMESTR[playerid]);
return 1;
}