Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

[BUG] Flashing textdraw (and radio stations)

$
0
0
Hello,
i create this speedometer and see in video. Its flashing. Flashing red part and flashing radio station's name.

Video:
https://www.youtube.com/watch?v=QwyhzYKKR1g

Code:
Code:

new Text:tachometr,Text:rucicka;

public OnPlayerUpdate(playerid)
{
        new Float:rot,Float:rychlost,Float:x,Float:y,Float:z,vehicleid = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
                GetVehicleVelocity(vehicleid,x,y,z);
                rychlost = VectorSize(x,y,z)*100.0*1.61;

                new s[128];
                format(s,128,"%f",rychlost);
                SendClientMessage(playerid,-1,s);

                if(rychlost < 30.0) rot = 51.0+(rychlost*1.2);
                else if(rychlost < 140.0) rot = 51.0+(rychlost*1.4);
                else  rot = 51.0+(rychlost*1.5);
                TextDrawSetPreviewRot(rucicka,90.0,0.0,rot,1.5);
                TextDrawShowForPlayer(playerid,rucicka);
        }
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp(cmdtext,"/tachometr",true) == 0)
        {
                tachometr = TextDrawCreate(450.0, 300.0, "mdl-2014:tachometr");
                TextDrawFont(tachometr, 4);
                TextDrawColor(tachometr,0xFFFFFFFF);
                TextDrawTextSize(tachometr,100.0,100.0);
                TextDrawShowForPlayer(playerid,tachometr);

                rucicka = TextDrawCreate(450.0, 300.0, "_");
                TextDrawFont(rucicka,TEXT_DRAW_FONT_MODEL_PREVIEW);
                TextDrawColor(rucicka,0xFFFFFFFF);
                TextDrawBackgroundColor(rucicka,0xFFFFFF00);
                TextDrawTextSize(rucicka,100.0,100.0);
                TextDrawSetPreviewModel(rucicka,-2014);
                TextDrawSetPreviewRot(rucicka,90.0,0.0,51.0,1.5);
                TextDrawShowForPlayer(playerid,rucicka);
                return 1;
        }
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>