SA-MP Forums Archive
PlayerTextDraw bug (?) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerTextDraw bug (?) (/showthread.php?tid=624261)



PlayerTextDraw bug (?) - Dayrion - 13.12.2016

Hi'.
I've a problem. When I try the Wiki's code. Nothing happens:
pawn Код:
new PlayerText:Font[MAX_PLAYERS];

public OnFilterScriptExit()
{
    foreach(new i : Player)
        PlayerTextDrawDestroy(i, Font[i]);
    return 1;
}

CMD:testb(playerid)
{
    Font[playerid] = CreatePlayerTextDraw(playerid, 40.0, 140.0, "_~N~Example text!~N~_");
    PlayerTextDrawUseBox(playerid, Font[playerid], 1);
    PlayerTextDrawBoxColor(playerid, Font[playerid], 0x00000066); // Set the box color to a semi-transparent blac
    return 1;
}



Re: PlayerTextDraw bug (?) - Amads - 13.12.2016

https://sampwiki.blast.hk/wiki/PlayerTextDrawShow


Re: PlayerTextDraw bug (?) - Rdx - 13.12.2016

Quote:

new PlayerText:Font[MAX_PLAYERS];

And this is wrong. No need to use array.

Correct :
Quote:

new PlayerText:Font;
Font = CreatePlayerTextDraw(playerid, 40.0, 140.0, "_~N~Example text!~N~_");




Re: PlayerTextDraw bug (?) - X337 - 13.12.2016

That's because you didn't show the textdraw to specified player, use PlayerTextDrawShow.


Re: PlayerTextDraw bug (?) - Dayrion - 13.12.2016

I'm so retarded those days... god.
Thanks.