Refuel car
#1

So when i refuel my car it don't refuels and all time shows me text like - Your vehicle's tank has been refilled for 30$
and that all time and don't refuels it

Code
PHP код:
CMD:refuel(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON) return SendClientMessageEx(playeridCOLOR_RED"You need to shut off the engine before filling up (/car engine).");
        if(!
IsAtFuelStation(playerid)) return SendClientMessageEx(playeridCOLOR_RED"You're not at a fuel station.");
        if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_RED,"This vehicle doesn't need fuel.");
        if(
VehicleFuel[vehicleid] >= 100.0) return SendClientMessageEx(playeridCOLOR_RED"This vehicle's tank is already full.");
        if(
RefuelingVehicle[playerid] == 1) return SendClientMessageEx(playeridCOLOR_RED"You are refilling your vehicle's tank.");
           
SendClientMessageEx(playeridCOLOR_WHITE"Refueling your vehicle's tank, please wait.");
           
RefuelingVehicle[playerid] = 1;
           
RefuelingVehicleTimer[playerid] = SetTimerEx("ReFill"1000true"i"playerid);
    }
    return 
1;

PHP код:
 stock StopRefueling(playerid)
{
    
GivePlayerCash(playerid, -RefuelingVehiclePrice[playerid]);
    
SendFormattedMessage(playeridCOLOR_WHITE,"Your vehicle's tank has been refilled for $%d."RefuelingVehiclePrice[playerid]);
    new 
mypoint = -1;
    for (new 
i=0i<MAX_POINTSi++)
    {
        if(
strcmp(Points[i][Name], "Fossil Fuel Company"true) == 0)
        {
            
mypoint i;
        }
    }
    for(new 
0sizeof(FamilyInfo); i++)
    {
        if(
strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
        {
            
FamilyInfo[i][FamilyBank] = FamilyInfo[i][FamilyBank]+(RefuelingVehiclePrice[playerid]/10);
        }
    }
    
RefuelingVehicle[playerid] = 0RefuelingVehiclePrice[playerid] = 0KillTimer(RefuelingVehicleTimer[playerid]);
    return 
true;

Reply
#2

can you show us the code of "ReFill" public function?
Reply
#3

Friend we have the Same Problem, HopeFully help us
Reply
#4

Change
PHP код:
return true
to
PHP код:
return 1
Reply
#5

I fixed it, but now when i refuel car it doesnt refuels. It have so much fuel as it had before
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)