Blinking textdraw
#1

Hi.

I tried to make a clock speedometer with 2D model preview rotation, but textdraw always blinking...
Code:

Quote:

if(IsPlayerInAnyVehicle(playerid))
{
TextDrawSetPreviewRot(Spidom[25], 0.0, -50-GetVehicleSpeed(GetPlayerVehicleID(playerid), true), 180.0, 1.0);
TextDrawShowForPlayer(playerid, Spidom[25]);
}

Under OnPlayerUpdate. It blinks: black box - object - black box - object - black box - object and etc...

Thanks for solutions
Reply
#2

u should put under on player change state

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
    {
        TextDrawSetPreviewRot(Spidom[25], 0.0, -50-GetVehicleSpeed(GetPlayerVehicleID(playerid), true), 180.0, 1.0);
        TextDrawShowForPlayer(playerid, Spidom[25]);
    }
    return 1;
}
Reply
#3

Yes, but object will be in same angle allways... I want it to spin, so I put it in OnPlayerUpdate
Reply
#4

use SetTimer or SetTimerEx which ever one suits the occasion
Reply
#5

Same...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)