Textdraw does not update
#1

Textdraw Name: DMG (Damage) assigned to Textdraw14
Description: When the vehicle has a health of more than 75, then the textdraw color will be WHITE(0xFFFFFFFF), when it's Less or equal to 75 but more than 50 the textdraw will be YELLOW, and if 50 and below it'll be red

With that said I came up with this:
pawn Код:
forward Damage(playerid);
public Damage(playerid)
{
    new Float:health;
    new veh;
    new dmgstr[10];
    veh = GetPlayerVehicleID(playerid);
    GetVehicleHealth(veh, health);
    if(IsPlayerInAnyVehicle(playerid))
    {
    if(health > 75)
    {
        format(dmgstr, 10, "DMG");
        TextDrawSetString(Textdraw14,dmgstr);
        TextDrawColor(Textdraw14, 0xFFFFFFFF);
    }
    else if(health <= 75 && health > 50)
    {
        format(dmgstr, 10, "DMG");
        TextDrawSetString(Textdraw14, dmgstr);
        TextDrawColor(Textdraw14, 0xFFFF00FF);
    }
    else if(health <= 50)
    {
       format(dmgstr, 10, "DMG");
       TextDrawSetString(Textdraw14, dmgstr);
       TextDrawColor(Textdraw14, 0xFF0000FF);
    }
    }
    else {
    TextDrawSetString(Textdraw14, "DMG");
    TextDrawColor(Textdraw14, 0xD3D3D3FF);
    }
return 1;
}
Got this on the OnPlayerSpawn callback
pawn Код:
TextDrawShowForPlayer(playerid, Text:Textdraw14);
And on the OnPlayerDisconnect callback
pawn Код:
TextDrawDestroy(Textdraw14);
The timer to update the TD: (I'm not using this on OnPlayerUpdate, but it's on the OnPlayerConnect callback)
pawn Код:
SetTimer("Damage", 2000, true);


The problem is, it does not update. Even though the vehicle's already smoking.


EDIT:
The Textdraw itself
pawn Код:
Textdraw14 = TextDrawCreate(617.510925, 259.583068, " ");
TextDrawLetterSize(Textdraw14, 0.155300, 0.911665);
TextDrawAlignment(Textdraw14, 1);
TextDrawSetShadow(Textdraw14, 0);
TextDrawSetOutline(Textdraw14, 1);
TextDrawBackgroundColor(Textdraw14, 51);
TextDrawFont(Textdraw14, 1);
TextDrawSetProportional(Textdraw14, 1);
Reply


Messages In This Thread
Textdraw does not update - by Neil. - 04.02.2013, 05:48
Re: Textdraw does not update - by JaKe Elite - 04.02.2013, 06:53
Re: Textdraw does not update - by Neil. - 04.02.2013, 07:08
Re: Textdraw does not update - by Neil. - 04.02.2013, 08:17
Re: Textdraw does not update - by Vince - 04.02.2013, 08:18
Re: Textdraw does not update - by Neil. - 04.02.2013, 08:23
Re: Textdraw does not update - by denNorske - 04.02.2013, 08:33
Re: Textdraw does not update - by Threshold - 04.02.2013, 08:46
Re: Textdraw does not update - by Neil. - 04.02.2013, 10:03
Re: Textdraw does not update - by Neil. - 04.02.2013, 10:21

Forum Jump:


Users browsing this thread: 1 Guest(s)