26.01.2017, 10:28
Quote:
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. |
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.0; RefuelingVehiclePrice[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;
}