Textdraw doesn't show
#1

Hello,

I have many textdraws in my server,
and some of them dont show up or are bugged.

but my real problem is my speed textdraw.

it doesnt show up, and fuel does
pawn Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        Speedometer_Setup(playerid);
    }
    else
    {
        Speedometer_Cleanup(playerid);
    }
pawn Код:
Speedometer_Setup(playerid)
{
    Player[playerid][SpeedometerText] = TextDrawCreate(485.000000, 370.000000, "_");
    Player[playerid][FuelText] = TextDrawCreate(485.000000, 390.000000, "_");
   
    TextDrawBackgroundColor(Player[playerid][SpeedometerText], 255);
    TextDrawFont(Player[playerid][SpeedometerText], 1);
    TextDrawLetterSize(Player[playerid][SpeedometerText], 0.500000, 1.800000);
    TextDrawColor(Player[playerid][SpeedometerText], -1);
    TextDrawSetOutline(Player[playerid][SpeedometerText], 1);
    TextDrawSetProportional(Player[playerid][SpeedometerText], 1);

    TextDrawBackgroundColor(Player[playerid][FuelText], 255);
    TextDrawFont(Player[playerid][FuelText], 1);
    TextDrawLetterSize(Player[playerid][FuelText], 0.500000, 1.800000);
    TextDrawColor(Player[playerid][FuelText], -1);
    TextDrawSetOutline(Player[playerid][FuelText], 1);
    TextDrawSetProportional(Player[playerid][FuelText], 1);
   
   
    TextDrawShowForPlayer(playerid, Player[playerid][SpeedometerText]);
    TextDrawShowForPlayer(playerid, Player[playerid][FuelText]);

    Player[playerid][SpeedometerTimer] = SetTimerEx("Speedometer", 500, true, "i", playerid);

    return 1;
}

Speedometer_Cleanup(playerid)
{
    TextDrawDestroy(Player[playerid][SpeedometerText]);
    TextDrawDestroy(Player[playerid][FuelText]);
    KillTimer(Player[playerid][SpeedometerTimer]);

    return 1;
}
pawn Код:
public Speedometer(playerid)
{
    new string[60],str[60];
    new PCar = GetPlayerVehicleID(playerid);
    format(string, sizeof(string), "Speed: %i KM/H", GetPlayerSpeed(playerid, 0));
    TextDrawSetString(Player[playerid][SpeedometerText], string);
    format(str, sizeof(str), "Fuel: %i", Vehicles[PCar][Fuel]);
    TextDrawSetString(Player[playerid][FuelText], str);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)