SA-MP Forums Archive
TextDraw not showing - 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: TextDraw not showing (/showthread.php?tid=498138)



TextDraw not showing - Mike.FTW - 02.03.2014

So... one of my textdraws (ESITextdraw0) is not showing and i don't know why.
I checked everything. TextDraw string is working good(Tested with SendClientMessage-string), position is not outside the screen (I'm sure. I used a in-game TextDraw Creator and I changed it position too), TextDraw color is -1(others textdraws worked like that), the PlayerTextDrawShow looks good and i don't know any other reason for this.
Someone has an ideea of why this is happening?
PS: The rest of the TextDraws i maked at the same timer are showing and working perfectly.

My CODE:

pawn Код:
new PlayerText:ESITextdraw0[MAX_PLAYERS], PlayerText:ESITextdraw1[MAX_PLAYERS], //... ETC
pawn Код:
public OnPlayerConnect(playerid)
{
ESITextdraw0[playerid] = CreatePlayerTextDraw(playerid, 588.750000, 161.000015, "100 HP");
PlayerTextDrawLetterSize(playerid, ESITextdraw0[playerid], 0.338750, 1.220831);
PlayerTextDrawAlignment(playerid, ESITextdraw0[playerid], 1);
PlayerTextDrawColor(playerid, ESITextdraw0[playerid], -1);
PlayerTextDrawSetShadow(playerid, ESITextdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, ESITextdraw0[playerid], 2);
PlayerTextDrawBackgroundColor(playerid, ESITextdraw0[playerid], 51);
PlayerTextDrawFont(playerid, ESITextdraw0[playerid], 1);
PlayerTextDrawSetProportional(playerid, ESITextdraw0[playerid], 1);
//...
// Others TextDraws and stuff
}
At 1 secoun timer
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new targetplayer = GetPlayerTargetPlayer(i);
        if(IsPlayerConnected(targetplayer))
        {
            new string0[8], string1[MAX_PLAYER_NAME], string2[30], string3[25], Float:pHealth, pName[MAX_PLAYER_NAME], pGunName[30], Float:targetX, Float:targetY, Float:targetZ;
            GetPlayerHealth(targetplayer, pHealth);
            format(string0, sizeof(string0), "%.0f HP", pHealth);
            SendClientMessage(i, -1, string0); //TEST
            PlayerTextDrawSetString(i, ESITextdraw0[i], string0);
                        //....
                        //code of others textdraws strings
                        //....
            PlayerTextDrawShow(i, ESITextdraw0[i]);
            PlayerTextDrawShow(i, ESITextdraw1[i]);
            PlayerTextDrawShow(i, ESITextdraw2[i]);
            PlayerTextDrawShow(i, ESITextdraw3[i]);
        }
        else
        {
            PlayerTextDrawHide(i, ESITextdraw0[i]);
            PlayerTextDrawHide(i, ESITextdraw1[i]);
            PlayerTextDrawHide(i, ESITextdraw2[i]);
            PlayerTextDrawHide(i, ESITextdraw3[i]);
        }
    }