Skip to content

Commit

Permalink
Merge pull request #916 from bitpredator/dev
Browse files Browse the repository at this point in the history
chore: garage reconstruction for a more realistic system
  • Loading branch information
bitpredator authored Dec 9, 2024
2 parents 9cad1d9 + 3880b76 commit b4c874e
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 104 deletions.
13 changes: 6 additions & 7 deletions server-data/resources/[esx_addons]/esx_garage/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,7 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

esx_garage
Copyright (C) 2015-2024
esx_garage Copyright (C) 2015-2025

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -649,13 +648,13 @@ the "copyright" line and a pointer to where the full notice is found.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

esx_garage Copyright (C) 2015-2024
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
esx_garage Copyright (C) 2015-2025
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
Expand Down
16 changes: 7 additions & 9 deletions server-data/resources/[esx_addons]/esx_garage/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<h1 align='center'>[ESX] Garage</a></h1><p align='center'><b><a href='https://discord.esx-framework.org/'>Discord</a> - <a href='https://documentation.esx-framework.org/legacy/installation'>Documentation</a></b></h5>
<h1 align='center'>esx_garage</a></h1>
<p align='center'><a href='https://discord.gg/ksGfNvDEfq'>Discord</a>

Store Your vehicles in style! ESX garage has an amazing New UI to help you be stylish while parking your broken, rusty Nissan Micra!

# Legal

esx_Garage - store vehicles in style!

Copyright (C) ESX-Framework
Copyright (C) 2024-2025 bitpredator

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.
ATTENTION:
You are not authorized to change the name of the resource and the resources within it.

If you want to contribute you can open a pull request.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
local model, coords, heading
local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z + 1.0, heading, true, false)
local vehicle

SetVehicleNeedsToBeHotwired(vehicle, false)
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
SetEntityAsMissionEntity(vehicle, true, true)
SetVehicleIsStolen(vehicle, false)
SetVehicleIsWanted(vehicle, false)
SetVehRadioStation(vehicle, 'OFF')
SetVehRadioStation(vehicle, "OFF")
13 changes: 3 additions & 10 deletions server-data/resources/[esx_addons]/esx_garage/client/main.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---@diagnostic disable: undefined-global

local LastMarker, LastPart, thisGarage, thisPound = nil, nil, nil, nil
local next = next
local nearMarker, menuIsShowed = false, false
Expand All @@ -13,9 +15,6 @@ AddEventHandler("esx_garage:closemenu", function()
hideAll = true,
})

if not menuIsShowed and thisGarage then
ESX.TextUI(TranslateCap("access_parking"))
end
if not menuIsShowed and thisPound then
ESX.TextUI(TranslateCap("access_Impound"))
end
Expand Down Expand Up @@ -106,15 +105,9 @@ end)

AddEventHandler("esx_garage:hasEnteredMarker", function(name, part)
if part == "EntryPoint" then
local isInVehicle = IsPedInAnyVehicle(ESX.PlayerData.ped, false)
local _ = IsPedInAnyVehicle(ESX.PlayerData.ped, false)
local garage = Config.Garages[name]
thisGarage = garage

if isInVehicle then
ESX.TextUI(TranslateCap("park_veh"))
else
ESX.TextUI(TranslateCap("access_parking"))
end
end

if part == "GetOutPoint" then
Expand Down
64 changes: 4 additions & 60 deletions server-data/resources/[esx_addons]/esx_garage/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,9 @@ Config.Markers = {
Config.Garages = {
VespucciBoulevard = {
EntryPoint = {
x = -285.2,
y = -886.5,
z = 31.0,
},
SpawnPoint = {
x = -309.3,
y = -897.0,
z = 31.0,
heading = 351.8,
},
Sprite = 357,
Scale = 0.8,
Colour = 3,
ImpoundedName = "LosSantos",
},
SanAndreasAvenue = {
EntryPoint = {
x = 216.4,
y = -786.6,
z = 30.8,
},
SpawnPoint = {
x = 218.9,
y = -779.7,
z = 30.8,
heading = 338.8,
x = 394.865936,
y = -1637.657104,
z = 29.279907,
},
Sprite = 357,
Scale = 0.8,
Expand All @@ -87,45 +64,12 @@ Config.Impounds = {
Colour = 1,
Cost = 3000,
},
PaletoBay = {
GetOutPoint = {
x = -211.4,
y = 6206.5,
z = 31.4,
},
SpawnPoint = {
x = -204.6,
y = 6221.6,
z = 30.5,
heading = 227.2,
},
Sprite = 524,
Scale = 0.8,
Colour = 1,
Cost = 3000,
},
SandyShores = {
GetOutPoint = {
x = 1728.2,
y = 3709.3,
z = 33.2,
},
SpawnPoint = {
x = 1722.7,
y = 3713.6,
z = 33.2,
heading = 19.9,
},
Sprite = 524,
Scale = 0.8,
Colour = 1,
Cost = 3000,
},
}

exports("getGarages", function()
return Config.Garages
end)

exports("getImpounds", function()
return Config.Impounds
end)
6 changes: 3 additions & 3 deletions server-data/resources/[esx_addons]/esx_garage/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
fx_version("cerulean")
game("gta5")

author("ESX-Framework")
author("ESX-Framework - Rework: Bitpredator")
description("Allows Players to Store & Retrieve their vehicles")

version("1.0.2")
version("1.0.3")

lua54("yes")

shared_script("@es_extended/imports.lua")

server_scripts({ "@es_extended/locale.lua", "locales/*.lua", "@oxmysql/lib/MySQL.lua", "config.lua", "server/main.lua" })

client_scripts({ "@es_extended/locale.lua", "locales/*.lua", "config.lua", "client/main.lua" })
client_scripts({ "@es_extended/locale.lua", "locales/*.lua", "config.lua", "client/*.lua" })

ui_page("nui/ui.html")

Expand Down
4 changes: 1 addition & 3 deletions server-data/resources/[esx_addons]/esx_garage/locales/en.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Locales["en"] = {
["parking_blip_name"] = "Garage",
["Impound_blip_name"] = "Impound",
["access_parking"] = "press [E] to access the car park.",
["access_Impound"] = "press [E] to access the impound.",
["park_veh"] = "press [E] to park the vehicle.",
["not_owning_veh"] = "You do not own this vehicle!",
["veh_released"] = "Successfully Retrieved Vehicle.",
["not_owning_veh"] = "You do not own this vehicle!",
["veh_Impound_released"] = "Successfully Retrieved Vehicle From Impound.",
["veh_stored"] = "Successfully Stored Vehicle",
["veh_impounded"] = "Impounded Vehicle",
Expand Down
6 changes: 2 additions & 4 deletions server-data/resources/[esx_addons]/esx_garage/locales/it.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Locales["it"] = {
["parking_blip_name"] = "Garage",
["parking_blip_name"] = "Parcheggio del sequestro",
["Impound_blip_name"] = "Sequestro",
["access_parking"] = "premi [E] per accedere al parcheggio.",
["access_Impound"] = "premi [E] per accedere al sequestro.",
["park_veh"] = "premi [E] per parcheggiare il veicolo.",
["not_owning_veh"] = "non possiedi questo veicolo!",
["veh_released"] = " Veicolo recuperato con successo. ",
["not_owning_veh"] = "non possiedi questo veicolo!",
["veh_Impound_released"] = " Veicolo recuperato con successo dal sequestro. ",
["veh_stored"] = " Veicolo depositato con successo ",
["veh_impounded"] = " Veicolo sequestrato ",
Expand Down
10 changes: 5 additions & 5 deletions server-data/resources/[esx_addons]/esx_garage/nui/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
<body>
<div id="container">
<div id="header">
<div class="title" style="display: inline">ESX Garage</div>
<div class="title" style="display: inline">EMPIRETOWN</div>
<ul>
<li data-page="garage" class="selected">Garage</li>
<li data-page="impounded">Impounded</li>
<li data-page="impounded">SEQUESTRO</li>
</ul>
<div class="close">X</div>
</div>

<div id="menu">

<div class="content">
<h2>No Vehicles Stored Here.</h2>
<h2>Nessun veicolo presente.</h2>
<div class="vehicle-list"></div>
</div>

<div class="impounded_content">
<h2>No Impounded Vehicles.</h2>
<h2>Nessun veicolo presente.</h2>
<div class="vehicle-list"></div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions server-data/resources/[esx_addons]/esx_garage/server/main.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---@diagnostic disable: undefined-global

RegisterServerEvent("esx_garage:updateOwnedVehicle")
AddEventHandler("esx_garage:updateOwnedVehicle", function(stored, parking, Impound, data, spawn)
local source = source
Expand Down

0 comments on commit b4c874e

Please sign in to comment.