On Vehicle Refuel Sends Message Many Times
#9

pawn Код:
forward ReFill(playerid);
public ReFill(playerid)
{
    if(!IsAtFuelStation(playerid) || !IsPlayerInAnyVehicle(playerid) || VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0 || GetPlayerCash(playerid) < 1)
    {
        StopRefueling(playerid);
    }
    else
    {
        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == VEHICLE_PARAMS_ON) return StopRefueling(playerid);
        VehicleFuel[GetPlayerVehicleID(playerid)] += 1.0; RefuelingVehiclePrice[playerid] += 30;
        if(VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0) VehicleFuel[GetPlayerVehicleID(playerid)] = 100.0;
    }
    return true;
}
This forum requires that you wait 120 seconds between posts. Please try again in 29 seconds.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)