Refueling Timer Problem
#9

Quote:
Originally Posted by MiiSha
Посмотреть сообщение
it is not filling I have a progress bar and a Command that shows my car status .. I am very sure that I'm not getting the fuel !
And The Debug did not print at all.
Please debug it like this and review the output (assuming VehicleFuel[GetPlayerVehicleID(playerid)] is var holding fuel)
PHP код:
forward ReFill(playerid);
public 
ReFill(playerid)
{
    
printf("entered function Refill");
    if(!
IsAtFuelStation(playerid) || !IsPlayerInAnyVehicle(playerid) || VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0 || GetPlayerCash(playerid) < 1)
    {
        
printf("IsAtFuelStation(playerid) = %d IsPlayerInAnyVehicle(playerid)=%d   VehicleFuel[GetPlayerVehicleID(playerid)] = %d GetPlayerCash(playerid) = %d",IsAtFuelStation(playerid),IsPlayerInAnyVehicle(playerid),VehicleFuel[GetPlayerVehicleID(playerid)],GetPlayerCash(playerid) < 1)); 
        
StopRefueling(playerid);
    }
    else
    {
        
printf("else");
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON
        {
            
printf("engine == VEHICLE_PARAMS_ON");
            return 
StopRefueling(playerid);
        }
        
printf("Before VehicleFuel[GetPlayerVehicleID(playerid)] = %d",VehicleFuel[GetPlayerVehicleID(playerid)]);
        
VehicleFuel[GetPlayerVehicleID(playerid)] += 1.0RefuelingVehiclePrice[playerid] += 30;
        
printf("After VehicleFuel[GetPlayerVehicleID(playerid)] = %d",VehicleFuel[GetPlayerVehicleID(playerid)]);
        if(
VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0
        {
            
printf("if(VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0)");
            
VehicleFuel[GetPlayerVehicleID(playerid)] = 100.0;
        }
        
    }
    return 
true;

Reply


Messages In This Thread
Refueling Timer Problem - by MiiSha - 26.01.2017, 06:03
Re: Refueling Timer Problem - by BiosMarcel - 26.01.2017, 06:24
Re: Refueling Timer Problem - by MiiSha - 26.01.2017, 06:46
Re: Refueling Timer Problem - by SyS - 26.01.2017, 07:14
Re: Refueling Timer Problem - by MiiSha - 26.01.2017, 08:54
Re: Refueling Timer Problem - by Sew_Sumi - 26.01.2017, 09:59
Re: Refueling Timer Problem - by SyS - 26.01.2017, 10:16
Re: Refueling Timer Problem - by MiiSha - 26.01.2017, 10:17
Re: Refueling Timer Problem - by SyS - 26.01.2017, 10:28
Re: Refueling Timer Problem - by MiiSha - 26.01.2017, 11:11

Forum Jump:


Users browsing this thread: 1 Guest(s)