Skip to content

Commit

Permalink
fixed being able to buy jerrycan with $0, closing #26
Browse files Browse the repository at this point in the history
  • Loading branch information
InZidiuZ committed May 8, 2019
1 parent 8e6f273 commit e1f020d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ Config.Strings = {
FullTank = "Tank is full",
PurchaseJerryCan = "Press ~g~E ~w~to purchase a jerry can for ~g~$" .. Config.JerryCanCost,
CancelFuelingPump = "Press ~g~E ~w~to cancel the fueling",
CancelFuelingJerryCan = "Press ~g~E ~w~to cancel the fueling"
CancelFuelingJerryCan = "Press ~g~E ~w~to cancel the fueling",
NotEnoughCash = "Not enough cash"
}

if not Config.UseESX then
Config.Strings.PurchaseJerryCan = "Press ~g~E ~w~to grab a jerry can"
Config.Strings.NotEnoughCash = "Not enough cash"
end

Config.PumpModels = {
Expand Down
12 changes: 8 additions & 4 deletions source/fuel_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,16 @@ Citizen.CreateThread(function()
elseif isNearPump then
local stringCoords = GetEntityCoords(isNearPump)

DrawText3Ds(stringCoords.x, stringCoords.y, stringCoords.z + 1.2, Config.Strings.PurchaseJerryCan)
if currentCash > 100 then
DrawText3Ds(stringCoords.x, stringCoords.y, stringCoords.z + 1.2, Config.Strings.PurchaseJerryCan)

if IsControlJustReleased(0, 38) then
GiveWeaponToPed(ped, 883325847, 4500, false, true)
if IsControlJustReleased(0, 38) then
GiveWeaponToPed(ped, 883325847, 4500, false, true)

TriggerServerEvent('fuel:pay', Config.JerryCanCost)
TriggerServerEvent('fuel:pay', Config.JerryCanCost)
end
else
DrawText3Ds(stringCoords.x, stringCoords.y, stringCoords.z + 1.2, Config.Strings.NotEnoughCash)
end
else
Citizen.Wait(250)
Expand Down

0 comments on commit e1f020d

Please sign in to comment.