[Ajuda] Defeniзгo de Gasosa PPC_Trucking
#1

Boa tarde, estava 'tentando' fazer aqui o sistema para quando estevier no menu de puxar o carro, aparecer a quantidade de gasolina, mas aparece sempre 100%

Alguem pode ajudar ?



PHP код:
Dialog_GetCarSelectHouse(playeridresponselistitem)
{
    
// Just close the dialog if the player clicked "Cancel"
    
if(!response) return 1;
    
// Get the houseid based on the chosen listitem
    
new HouseID APlayerData[playerid][Houses][listitem];
        new 
Float:Gasosavehicleid// aqui defeniзгo da Gasosa
        
vehicleid GetPlayerVehicleID(playerid);
    
// Check if it was a valid house
    
if (HouseID != 0)
    {
        
// Setup local variables
            
new BuyableCarIndexVehicleList[500], bool:HouseHasCars falseCarSlot;
        
// Store the HouseID, otherwise the next dialog won't be able to get a car from the chosen house
        
APlayerData[playerid][DialogGetCarHouseID] = HouseID;
        
// Check if the house has any cars assigned to it
        
for (CarSlot 0CarSlot 10CarSlot++)
            if (
AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
                
HouseHasCars true;
                
strins(VehicleList,"Veiculo\tCombustivel\tApreendido\n"strlen(VehicleList));
                
Gasosa AVehicleData[CarSlot][Fuel]; // aqui defeniзгo da Gasosa para converter para porcentagem
        // Check if the house has any cars assigned to it
        
if (HouseHasCars == true)
        {
            
// Add all vehicles to the list
            
for (CarSlot 0CarSlot 10CarSlot++)
            {
                
// Check if the carslot has a vehicle in it
                
if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
                {
                    
// Get the index where the first vehicle is found in the ABuyableVehicles array
                    
BuyableCarIndex VehicleBuyable_GetIndex(GetVehicleModel(AHouseData[HouseID][VehicleIDs][CarSlot]));
                    
// Add the name of the vehicle to the list
                    
if (AVehicleData[AHouseData[HouseID][VehicleIDs][CarSlot]][Clamped] == true)
                        
format(VehicleList500"%s{00FF00}%s\t%d%%\tSim\n"VehicleListABuyableVehicles[BuyableCarIndex][CarName], floatround(Gasosa)/ 100); // tem ai floatround da gasosa
                    
else
                        
format(VehicleList500"%s{00FF00}%s\t%d%%\tNгo\n"VehicleListABuyableVehicles[BuyableCarIndex][CarName], floatround(Gasosa)/ 100); // tem ai floatround da gasosa
                
}
                else
                    
format(VehicleList500TXT_EmptyCarSlotVehicleList);
            }
            
// Ask which vehicle the player wants to teleport to his location
            
ShowPlayerDialog(playeridDialogGetCarSelectCarDIALOG_STYLE_TABLIST_HEADERSTXT_SelectVehicleToGetVehicleListTXT_DialogButtonSelectTXT_DialogButtonCancel);
        }
        else
            
SendClientMessage(playerid, -1TXT_NoHouseVehicles);
    }
    else
        
SendClientMessage(playerid, -1TXT_NoHouseInSlot);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)