SpeedoMeter Help.
#1

Hello all. i created a Textdraw based Speedometer system. but i am having some trouble with it.
1> Engine,Speed,Gas and Car ID Text Draws does not get showed. idk what is wrong.
2>The Textdraws for Speed,Engine and Gas are not getting updated either.

i use ptask to Check the Speed each second but idk where to call it. can you please help me?
Thanks

BTW all the common labels like "Car ID:", "Gas:" etc are Global TDs(as they are same with each people) and the Values of those are Player TDs as they change with each player.

Here is my code for ShowSpeedo Under OnPlayerStateChange and also the ptast code for speed and Gas Update.

idk may be i am not calling ptask callback somewhere thats why its not working. so if thats the case please tell me where to call it and how?

PHP код:
//Timer
ptask SpeedoCheck[1000](playerid)
{
    if((
GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) && PlayerInfo[playerid][pSpeedoOn] == 1) {
        new 
veh GetPlayerVehicleID(playerid);
        new 
Float:Speed GetVehicleSpeed(veh0);
        new 
stringa[10],stringb[10];
        if(!
IsABicycle(veh))
        {
            
format(stringa,sizeof(stringa),"%d Mph ",floatround(Speed/1.609));
            
PlayerTextDrawSetString(playerid,SpeedoP[playerid][7],stringa);
            
PlayerTextDrawShow(playeridSpeedoP[playerid][7]);
            
format(stringbsizeof(stringb), "%f ",Gas[veh]);
            
PlayerTextDrawSetString(playeridSpeedoP[playerid][4], stringb);
            
PlayerTextDrawShow(playeridSpeedoP[playerid][4]);
        }
    }
    return 
1;

PHP код:
//ShowSpeedo Code.
stock ShowSpeedo(playerid)
{
    new 
veh GetPlayerVehicleID(playerid);
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    new 
string[5],stringa[5],stringb[5],stringc[6];
    
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!
IsABicycle(veh) && PlayerInfo[playerid][pTogSpeedo] == 0)
    {
       for(new 
i=0;i<9;i++)
       {
            
TextDrawShowForPlayer(playeridSpeedoG[i]);
         }
       
        
PlayerTextDrawSetString(playeridSpeedoP[playerid][0], GetVehicleName(veh));
        
PlayerTextDrawShow(playeridSpeedoP[playerid][0]);
        if(
engine == VEHICLE_PARAMS_ON)
        {
                
format(stringsizeof(string), "ON"); 
                  
PlayerTextDrawSetString(playeridSpeedoP[playerid][1], string);
        }
                
PlayerTextDrawShow(playeridSpeedoP[playerid][1]);
                
PlayerTextDrawShow(playeridSpeedoP[playerid][2]);
                
PlayerTextDrawShow(playeridSpeedoP[playerid][3]);
                
format(stringasizeof(stringa), "%f ",Gas[veh]); 
                
PlayerTextDrawSetString(playeridSpeedoP[playerid][4], stringa); 
                
PlayerTextDrawShow(playeridSpeedoP[playerid][4]);
                
PlayerTextDrawShow(playeridSpeedoP[playerid][5]);
                
format(stringbsizeof(stringb), "%d",veh);
                
PlayerTextDrawSetString(playeridSpeedoP[playerid][6], stringb);
                
PlayerTextDrawShow(playeridSpeedoP[playerid][6]);
                
//format(stringc, sizeof(stringc), "0 Mph");
                
PlayerTextDrawSetString(playeridSpeedoP[playerid][7], "0 Mph"); 
                
PlayerTextDrawShow(playeridSpeedoP[playerid][7]);
        
PlayerInfo[playerid][pSpeedoOn] =1;
    }

Please Help me
Reply
#2

Anyone found out the solutions?
Reply
#3

bumping this thread. not getting anyone to help me
Reply
#4

hellpppp...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)