Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showallgasstation #93

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1dbe570
dist
GhzGarage Apr 9, 2021
fca79db
qb changes (still working on can
Apr 12, 2021
cb89116
hud
Apr 12, 2021
d403287
Fixed error with source
BerkieBb Apr 19, 2021
cc5e648
Merge pull request #1 from BerkieBb/master
Jun 12, 2021
14e2e79
Update fuel_client.lua
BerkieBb Jun 23, 2021
3132125
Update fuel_server.lua
BerkieBb Jun 23, 2021
e1e08ec
Delete fuel_client.lua
BerkieBb Jun 23, 2021
7c839b4
Delete fuel_server.lua
BerkieBb Jun 23, 2021
be060a8
Merge pull request #2 from BerkieBb/master
BerkieBb Jun 23, 2021
765943a
GetObject
haitham1337 Aug 26, 2021
18ee00d
very big blip
haitham1337 Aug 26, 2021
1b654fa
GetObject
haitham1337 Aug 26, 2021
896c148
GetObject
haitham1337 Aug 26, 2021
3fcb74a
Merge pull request #3 from vanillla1/patch-1
GhzGarage Aug 28, 2021
a532744
not use this
haitham1337 Sep 26, 2021
b35076c
Update config.lua
haitham1337 Sep 26, 2021
bff87b3
The price is changing
darknight2590 Oct 12, 2021
50ee634
Update fuel_client.lua
darknight2590 Oct 25, 2021
707e721
Merge pull request #8 from evanillaa/patch-4
GhzGarage Nov 1, 2021
6b14c67
add coords
haitham1337 Nov 6, 2021
cde0f46
refactor event
haitham1337 Nov 7, 2021
591a08d
Update functions_client.lua
haitham1337 Nov 7, 2021
a46f902
Update fuel_client.lua
haitham1337 Nov 7, 2021
452304d
Merge pull request #11 from evanillaa/patch-6
GhzGarage Nov 8, 2021
0d01c0d
Merge pull request #10 from evanillaa/patch-5
GhzGarage Nov 8, 2021
87280e9
export
GhzGarage Nov 10, 2021
d6e98ec
clear
haitham1337 Nov 10, 2021
fa99223
clear up
haitham1337 Nov 10, 2021
3268493
Merge pull request #12 from evanillaa/patch-7
GhzGarage Nov 10, 2021
d37e933
Update fuel_server.lua
haitham1337 Nov 11, 2021
1cff452
Merge pull request #13 from evanillaa/patch-8
GhzGarage Nov 12, 2021
422e946
Merge pull request #9 from darknight2590/patch-1
GhzGarage Nov 21, 2021
d71dc4f
fix error
darknight2590 Nov 21, 2021
65b6c06
add GetPlayerServerId
darknight2590 Nov 21, 2021
b2c0e1d
Merge pull request #15 from darknight2590/patch-2
GhzGarage Nov 21, 2021
7bda758
tweak(client/functions): add exports here
BerkieBb Aug 19, 2022
7568d2b
tweak(client): fix exploit
BerkieBb Aug 19, 2022
b6d9325
fix(server): add event to fix exploit
BerkieBb Aug 19, 2022
cfb5029
chore(manifest): remove exports and add lua54
BerkieBb Aug 19, 2022
ac9ef64
Merge pull request #20 from BerkieBb/master
BerkieBb Aug 19, 2022
b5fc59a
fix(client): closestCoords being nil
BerkieBb Aug 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions config.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
Config = {}

-- Are you using ESX? Turn this to true if you would like fuel & jerry cans to cost something.
Config.UseESX = true

-- What should the price of jerry cans be?
Config.JerryCanCost = 100
Config.RefillCost = 50 -- If it is missing half of it capacity, this amount will be divided in half, and so on.
Expand All @@ -13,9 +10,6 @@ Config.FuelDecor = "_FUEL_LEVEL"
-- What keys are disabled while you're fueling.
Config.DisableKeys = {0, 22, 23, 24, 29, 30, 31, 37, 44, 56, 82, 140, 166, 167, 168, 170, 288, 289, 311, 323}

-- Want to use the HUD? Turn this to true.
Config.EnableHUD = true

-- Configure blips here. Turn both to false to disable blips all together.
Config.ShowNearestGasStationOnly = true
Config.ShowAllGasStations = false
Expand All @@ -39,11 +33,6 @@ Config.Strings = {
TotalCost = "Cost",
}

if not Config.UseESX then
Config.Strings.PurchaseJerryCan = "Press ~g~E ~w~to grab a jerry can"
Config.Strings.RefillJerryCan = "Press ~g~E ~w~ to refill the jerry can"
end

Config.PumpModels = {
[-2007231801] = true,
[1339433404] = true,
Expand Down Expand Up @@ -132,5 +121,6 @@ Config.GasStations = {
vector3(176.631, -1562.025, 29.263),
vector3(176.631, -1562.025, 29.263),
vector3(-319.292, -1471.715, 30.549),
vector3(-66.48, -2532.57, 6.14),
vector3(1784.324, 3330.55, 41.253)
}
19 changes: 11 additions & 8 deletions functions/functions_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ function GetFuel(vehicle)
return DecorGetFloat(vehicle, Config.FuelDecor)
end

exports('GetFuel', GetFuel)

function SetFuel(vehicle, fuel)
if type(fuel) == 'number' and fuel >= 0 and fuel <= 100 then
SetVehicleFuelLevel(vehicle, fuel + 0.0)
DecorSetFloat(vehicle, Config.FuelDecor, GetVehicleFuelLevel(vehicle))
end
end

exports('SetFuel', SetFuel)

function LoadAnimDict(dict)
if not HasAnimDictLoaded(dict) then
RequestAnimDict(dict)
if HasAnimDictLoaded(dict) then return end
RequestAnimDict(dict)

while not HasAnimDictLoaded(dict) do
Citizen.Wait(1)
end
while not HasAnimDictLoaded(dict) do
Wait(10)
end
end

Expand All @@ -41,10 +44,10 @@ function Round(num, numDecimalPlaces)
end

function CreateBlip(coords)
local blip = AddBlipForCoord(coords)
local blip = AddBlipForCoord(coords.x, coords.y, coords.z)

SetBlipSprite(blip, 361)
SetBlipScale(blip, 0.9)
SetBlipScale(blip, 0.6)
SetBlipColour(blip, 4)
SetBlipDisplay(blip, 4)
SetBlipAsShortRange(blip, true)
Expand Down Expand Up @@ -76,7 +79,7 @@ function FindNearestFuelPump()
local pumpDistance = 1000

for _, fuelPumpObject in pairs(fuelPumps) do
local dstcheck = GetDistanceBetweenCoords(coords, GetEntityCoords(fuelPumpObject))
local dstcheck = #(coords - GetEntityCoords(fuelPumpObject))

if dstcheck < pumpDistance then
pumpDistance = dstcheck
Expand Down
12 changes: 4 additions & 8 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
fx_version 'bodacious'
fx_version 'cerulean'
game 'gta5'

author 'InZidiuZ'
description 'Legacy Fuel'
version '1.3'

-- What to run
shared_script 'config.lua'

client_scripts {
'config.lua',
'functions/functions_client.lua',
'source/fuel_client.lua'
}

server_scripts {
'config.lua',
'source/fuel_server.lua'
}

exports {
'GetFuel',
'SetFuel'
}
lua54 'yes'
Loading