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

SOLVED, Thanks.
Reply
#2

What line cases this warning ? and show us the declaration of HUDNAMESTR
Reply
#3

line
Reply
#4

you have to create HUDNAMESTR [ MAX_PLAYERS ] ;then:

PlayerTextDrawShow( playerid, HUDNAMESTR [ playerid ] ) ;
Reply
#5

Thanks for the quick answer but i solved it myself, apparently SA-MP Wiki is a liar.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)