What am i doing wrong? (Weird Warning)
#6

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;
}
Reply


Messages In This Thread
What am i doing wrong? (Weird Warning) - by $Marco$ - 24.02.2014, 16:52
AW: What am i doing wrong? (Weird Warning) - by Nero_3D - 24.02.2014, 16:55
Re: What am i doing wrong? (Weird Warning) - by Guest4390857394857 - 24.02.2014, 16:56
Re: What am i doing wrong? (Weird Warning) - by Renaldasj - 24.02.2014, 16:56
Re: What am i doing wrong? (Weird Warning) - by $Marco$ - 24.02.2014, 16:56
Re: What am i doing wrong? (Weird Warning) - by Konstantinos - 24.02.2014, 17:02

Forum Jump:


Users browsing this thread: 1 Guest(s)