Textdraw comes back....
#1

Since a few mins ago im using textdraws.

I made a textdraw for my speedometer.



But when i exit the vehicle it have to disapears.
It is gone when i presh enter, but then when i close the door its back..


pawn Код:
//Speed
    TDBox = TextDrawCreate(471.000000, 330.000000, "_");
    TextDrawBackgroundColor(TDBox, 255);
    TextDrawFont(TDBox, 1);
    TextDrawLetterSize(TDBox, 0.500000, 7.100000);
    TextDrawColor(TDBox, -1);
    TextDrawSetOutline(TDBox, 0);
    TextDrawSetProportional(TDBox, 1);
    TextDrawSetShadow(TDBox, 1);
    TextDrawUseBox(TDBox, 1);
    TextDrawBoxColor(TDBox, 150);
    TextDrawTextSize(TDBox, 600.000000, 0.000000);
   
    TDText = TextDrawCreate(533.000000, 336.000000, "Vehicle Speed");
    TextDrawAlignment(TDText, 2);
    TextDrawBackgroundColor(TDText, 255);
    TextDrawFont(TDText, 2);
    TextDrawLetterSize(TDText, 0.329999, 2.200001);
    TextDrawColor(TDText, -1);
    TextDrawSetOutline(TDText, 1);
    TextDrawSetProportional(TDText, 1);
pawn Код:
public OnPlayerConnect(playerid)
{

    TextDrawHideForAll(Text:TDBox);
    TextDrawHideForAll(Text:TDText);
    TextDrawHideForAll(Text:TDTime[playerid]);
   
    TDTime[playerid] = TextDrawCreate(533.000000, 361.000000, "");
    TextDrawAlignment(TDTime[playerid], 2);
    TextDrawBackgroundColor(TDTime[playerid], 255);
    TextDrawFont(TDTime[playerid], 2);
    TextDrawLetterSize(TDTime[playerid], 0.329999, 2.200001);
    TextDrawColor(TDTime[playerid], -16776961);
    TextDrawSetOutline(TDTime[playerid], 1);
    TextDrawSetProportional(TDTime[playerid], 1);
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    TextDrawHideForPlayer(playerid, TDBox);
    TextDrawHideForPlayer(playerid, TDText);
    TextDrawHideForPlayer(playerid, TDTime[playerid]);
    return 1;
}
Someone help me?
Reply
#2

Try this
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
         TextDrawHideForPlayer(playerid, TDBox);
         TextDrawHideForPlayer(playerid, TDText);
         TextDrawHideForPlayer(playerid, TDTime[playerid]);
         return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)