Fuel And Speedometer [Help]
#1

Hi friends!
i have a problem with my fuel and speedometer textdraws
when a player seat in a vehicle it will work good but when when two players drive in same time fuel meter and speedometer will start blinking!
PHP код:
    // Fuelmeter
    
fuelmeter TextDrawCreate(200.000000432.000000"Fuel:");
    
TextDrawBackgroundColor(fuelmeter255);
    
TextDrawFont(fuelmeter1);
    
TextDrawLetterSize(fuelmeter0.5000001.000000);
    
TextDrawColor(fuelmeter16777215);
    
TextDrawSetOutline(fuelmeter0);
    
TextDrawSetProportional(fuelmeter1);
    
TextDrawSetShadow(fuelmeter1);
    
TextDrawSetSelectable(fuelmeter0);
    
// Speedometer
    
speedometer TextDrawCreate(301.000000432.000000"MPH:");
    
TextDrawBackgroundColor(speedometer255);
    
TextDrawFont(speedometer1);
    
TextDrawLetterSize(speedometer0.5000001.000000);
    
TextDrawColor(speedometer16777215);
    
TextDrawSetOutline(speedometer0);
    
TextDrawSetProportional(speedometer1);
    
TextDrawSetShadow(speedometer1);
    
TextDrawSetSelectable(speedometer0); 
i put it under onplayerupdate
PHP код:
        if(Speedo[playerid] && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new 
string[64], speed GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
            
format(string,sizeof(string),"MPH: %d"speed);
            
TextDrawSetString(speedometerstring);
        }
        if(
fMeter[playerid] && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new 
string[64];
               
format(string,sizeof(string),"Fuel: %d%"Fuel[GetPlayerVehicleID(playerid)]);
            
TextDrawSetString(fuelmeterstring);
        } 
and put it under onplayerstatechange
PHP код:
    if(newstate == PLAYER_STATE_DRIVER)
    {
     
fMeter[playerid] =1;
     
Speedo[playerid] = 1;
     
TextDrawShowForPlayer(playerid,speedometer);
     
TextDrawShowForPlayer(playerid,fuelmeter);
    } 
Help for +rep
Reply


Messages In This Thread
Fuel And Speedometer [Help] - by Airblog - 07.03.2015, 19:00
Re: Fuel And Speedometer [Help] - by PowerPC603 - 07.03.2015, 19:03
Re: Fuel And Speedometer [Help] - by Airblog - 08.03.2015, 10:27

Forum Jump:


Users browsing this thread: 1 Guest(s)