Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You must be driving a vehicle to use this command.");
- return 1;
- }
- if(IsRefuelling[playerid] == 1) {
- IsRefuelling[playerid] = 0;
- SetPVarInt(playerid, "StoppingGasTimer", 1);
- }
- else {
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- if(BusinessInfo[b][bI_isGasStation] == 1) {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, BusinessInfo[b][bI_GasPumpPos][0], BusinessInfo[b][bI_GasPumpPos][1], BusinessInfo[b][bI_GasPumpPos][2]))
- {
- if(BusinessInfo[b][bI_Status] == 1) {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}The business is currently closed.");
- return 1;
- }
- if(VehicleEngine(GetPlayerVehicleID(playerid)))
- {
- if(IsRefuellableVehicle(GetPlayerVehicleID(playerid)))
- {
- if(BusinessInfo[b][bI_GasPumpStatus] == 0) {
- if(BusinessInfo[b][bI_GasPumpGallons] != 0.0) {
- SendClientMessage(playerid, COLOR_WHITE, "Vehicle refuelling.. please wait.");
- SendClientMessage(playerid, COLOR_YELLOW, "* If you wish to stop refuelling, use (/refuel) again. *");
- IsRefuelling[playerid] = 1;
- BusinessInfo[b][bI_GasPumpStatus] = 1;
- BusinessInfo[b][bI_SaleGallons] = 0;
- BusinessInfo[b][bI_GasSalePrice] = 0;
- SetPVarInt(playerid, "Refuelling", GetPlayerVehicleID(playerid));
- GasPumpTimer[playerid] = SetTimerEx("GasPumpSaleTimer", 250, true, "ii", playerid, b);
- }
- else {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}There is currently no fuel in the pump, try again later.");
- return 1;
- }
- }
- else {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}This gas pump is currently in-use.");
- return 1;
- }
- }
- else {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}This vehicle cannot be refuelled.");
- return 1;
- }
- }
- else {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}The engine must be off to refuel the vehicle.");
- return 1;
- }
- }
- else {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You are not near a gas station.");
- return 1;
- }
- }}
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement