├── .github
└── ISSUE_TEMPLATE
│ ├── bug-report---do-not-delete-prewritten-text.md
│ └── config.yml
├── LICENSE
├── README.md
├── V1.3 - Unsupported.zip
├── esx_advancedbanking
├── README.md
├── client
│ └── main.lua
├── config.lua
├── fxmanifest.lua
├── html - advanced
│ ├── UI.html
│ ├── media
│ │ ├── font
│ │ │ ├── Bariol_Regular.otf
│ │ │ ├── Vision-Black.otf
│ │ │ ├── Vision-Bold.otf
│ │ │ └── Vision-Heavy.otf
│ │ └── img
│ │ │ ├── bg.png
│ │ │ ├── circle.png
│ │ │ ├── circle.psd
│ │ │ ├── curve.png
│ │ │ ├── fingerprint.jpg
│ │ │ ├── fingerprint.png
│ │ │ ├── graph.png
│ │ │ ├── logo-big.png
│ │ │ └── logo-top.png
│ └── style.css
├── html - basic
│ ├── UI.html
│ ├── img
│ │ ├── BG.psd
│ │ └── BG_White.png
│ └── style.css
├── locales
│ └── en.lua
└── server
│ └── main.lua
├── esx_advancedgarage
├── README.md
├── client
│ └── main.lua
├── config.lua
├── esx_advancedgarage.sql
├── fxmanifest.lua
├── locales
│ ├── de.lua
│ ├── en.lua
│ └── es.lua
├── optional_properties.sql
└── server
│ └── main.lua
├── esx_advancedholdup
├── README.md
├── client
│ └── main.lua
├── config.lua
├── fxmanifest.lua
├── locales
│ ├── en.lua
│ └── es.lua
└── server
│ └── main.lua
├── esx_advancedhospital
├── README.md
├── client
│ └── main.lua
├── config.lua
├── fxmanifest.lua
├── locales
│ ├── en.lua
│ └── sv.lua
└── server
│ └── main.lua
├── esx_advancedjail
├── README.md
├── client
│ └── main.lua
├── config.lua
├── esx_advancedjail.sql
├── esx_policejob_add.lua
├── fxmanifest.lua
├── locales
│ └── en.lua
└── server
│ └── main.lua
├── esx_advancedvehicleshop
├── README.md
├── client
│ ├── main.lua
│ └── utils.lua
├── config.lua
├── esx_advancedvehicleshop.sql
├── esx_lscustom_fix.lua
├── fxmanifest.lua
├── locales
│ └── en.lua
└── server
│ ├── main.lua
│ └── migrate.lua
├── esx_advancedweaponshop
├── README.md
├── client
│ └── main.lua
├── config.lua
├── fxmanifest.lua
├── locales
│ └── en.lua
└── server
│ └── main.lua
├── esx_extraitems
├── README.md
├── client
│ ├── main.lua
│ └── menus.lua
├── config.lua
├── esx_shops.lua
├── fxmanifest.lua
├── locales
│ └── en.lua
├── server
│ └── main.lua
└── sqls
│ ├── esx_extraitems_advammo.sql
│ └── esx_extraitems_simammo.sql
├── esx_joblisting
├── README.md
├── client
│ └── main.lua
├── config.lua
├── esx_joblisting.sql
├── fxmanifest.lua
├── locales
│ └── en.lua
└── server
│ └── main.lua
├── esx_licenseshop
├── README.md
├── client
│ └── main.lua
├── config.lua
├── fxmanifest.lua
├── locales
│ └── en.lua
└── server
│ └── main.lua
├── esx_vehiclespawner
├── README.md
├── client
│ └── main.lua
├── config.lua
├── fxmanifest.lua
└── locales
│ └── en.lua
└── esx_vehicletheft
├── README.md
├── client
└── main.lua
├── config.lua
├── fxmanifest.lua
├── locales
└── en.lua
└── server
└── main.lua
/.github/ISSUE_TEMPLATE/bug-report---do-not-delete-prewritten-text.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug Report - DO NOT DELETE PREWRITTEN TEXT
3 | about: Make sure you have looked through the Closed Topics & the Wiki before submitting an issue as you accept any Punishments.
4 | title: ''
5 | labels: Bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Questions**
11 | Which Script are you having Issues with?:
12 | Have you made changes to anything besides the `config.lua`?:
13 | Have you looked through the Closed Topics?:
14 | Have you looked through the Wiki?:
15 | Are you using a Pre-Installed ESX? If Yes who?:
16 | What Verison of ESX Legacy are you using?:
17 | Are you using OneSync?:
18 | Linux or Windows?:
19 |
20 | **Describe the Bug | A Clear & Concise Description of the Bug**
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # About VENT_ESX_Scripts:
2 | ESX Scripts Made by Human Tree92
3 |
4 | I have at this time decided I will no longer be working on ESX. I have no Interest to further develop Scripts or work on Scripts for FiveM. I will keep the Github open just in case other people want to keep the scripts updated. If you want to rework my Scripts please contact me for Permission.
5 |
6 | # Creating Issues:
7 | * Check the [Closed Topics]( https://github.com/HumanTree92/VENT_ESX_Scripts/issues?q=is%3Aissue+is%3Aclosed ) & [Wiki]( https://github.com/HumanTree92/VENT_ESX_Scripts/wiki ) before opening an issue to see if your issue has already been Answered.
8 | * Do NOT Delete the Pre-Written Text in the issue.
9 | * Make sure you have NOT edited anything besides the `config.lua`. I will NOT be providing support if you edit anything else.
10 | * Failue to due any of the above will result in Topic being Deleted & you being Blocked. The Pre-Written text helps me with getting to the Bottom of the Issues & i hate explaining things over & over.
11 |
12 | # Helpfull Info:
13 | * I have decided to Combine all my Scripts into 1 Massive Script to make downloading Easier.
14 | * Each Script has their Own README file so make sure you READ it so you know how to install everything.
15 | * If you decide to make changes to anything outside of the `config.lua` i will not provide support for problems.
16 | * I will not be doing Support for V1.3 - Unsupported.zip.
17 | * Each Script has been tested on ESX V1.6 and wether or not it will work on any newer versions IDK.
18 |
19 | # Requirements:
20 | * Required:
21 | * Read the ReadMe's of Each Script before asking for any help!!!
22 |
23 | # Download & Installation:
24 | 1) Download Master & Extract the .zip or Open the .zip Or [Click Me]( https://github.com/HumanTree92/VENT_ESX_Scripts/archive/refs/heads/main.zip )
25 | 2) Add `setr esx_MenuAlign "top-right"` to your server.cfg & Change top-right to whatever side you want
26 | 3) Read the README's of whatever script you plan on using.
27 |
28 | # Other Files for FiveM:
29 | * [VENT_FiveM_Customs]( https://github.com/HumanTree92/VENT_FiveM_Customs )
30 |
31 | # Scripts moved to this Pack:
32 | * [esx_advancedbanking]( https://github.com/HumanTree92/esx_advancedbanking )
33 | * [esx_advancedgarage]( https://github.com/HumanTree92/esx_advancedgarage )
34 | * [esx_advancedholdup]( https://github.com/HumanTree92/esx_advancedholdup )
35 | * [esx_advancedhospital]( https://github.com/HumanTree92/esx_advancedhospital )
36 | * [esx_advancedjail]( https://github.com/HumanTree92/esx_advancedjail )
37 | * [esx_advancedvehicleshop]( https://github.com/HumanTree92/esx_advancedvehicleshop )
38 | * [esx_advancedweaponshop]( https://github.com/HumanTree92/esx_advancedweaponshop )
39 | * [esx_extraitems]( https://github.com/HumanTree92/esx_extraitems )
40 | * [esx_joblisting]( https://github.com/HumanTree92/esx_joblisting )
41 | * [esx_licenseshop]( https://github.com/HumanTree92/esx_licenseshop )
42 | * [esx_vehiclespawner]( https://github.com/HumanTree92/esx_vehiclespawner )
43 | * [esx_vehicletheft]( https://github.com/HumanTree92/esx_vehicletheft )
44 |
45 | # Scripts that will no longer be Maintained:
46 | * [esx_aircraftshop]( https://github.com/HumanTree92/esx_aircraftshop )
47 | * [esx_boatshop]( https://github.com/HumanTree92/esx_boatshop )
48 | * [esx_truckshop]( https://github.com/HumanTree92/esx_truckshop )
49 | * [esx_plasticsurgery]( https://github.com/HumanTree92/esx_plasticsurgery )
50 | * [esx_hospital]( https://github.com/HumanTree92/esx_hospital )
51 | * [esx_panicbutton]( https://github.com/HumanTree92/esx_panicbutton )
52 |
53 | # Visit Velociti Entertainment:
54 | * [Discord]( https://discord.velocitientertainment.com )
55 | * [Website]( https://velocitientertainment.com )
56 | * [Donate]( https://velocitientertainment.weebly.com/donations.html )
57 | * [Patreon]( https://www.patreon.com/VelocitiEntertainment?fan_landing=true )
58 | * [Steam Group]( https://steamcommunity.com/groups/velocitientertainment )
59 | * [Facebook]( https://facebook.com/VelocitiEntertainment )
60 | * [Twitter]( https://twitter.com/VelocitiEnt )
61 | * [YouTube]( https://youtube.com/user/HumanTree92 )
62 | * [Twitch]( https://twitch.tv/humantree92 )
63 | * [GitHub]( https://github.com/HumanTree92 )
64 |
65 | # Legal
66 | ### License
67 | Copyright (C) 2025 Velociti Entertainment
68 |
69 | 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.
70 |
71 | 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.
72 |
73 | You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.
74 |
--------------------------------------------------------------------------------
/V1.3 - Unsupported.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/V1.3 - Unsupported.zip
--------------------------------------------------------------------------------
/esx_advancedbanking/README.md:
--------------------------------------------------------------------------------
1 | # About esx_advancedbanking:
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * Players can Deposit, Withdraw, & Transfer Money.
6 | * Works with all Banks & ATMs on the Map.
7 | * 2 Different Styles.
8 | * Advanced Style has the ability to use an Investment Script.
9 | * Works with esx_advancedholdup so if a player starts a robbery players won't be able to Access Banks. This can be turned on/off in the config.lua
10 |
11 | # Requirements:
12 | * Required:
13 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
14 | * Optional:
15 | * [esx_advancedholdup]( https://github.com/HumanTree92/VENT_ESX_Scripts/tree/main/esx_advancedholdup )
16 |
17 | # Download & Installation:
18 | 1) Place `esx_advancedbanking` in your ESX Directory
19 | 2) Add `start esx_advancedbanking` to your server.cfg
20 | 3) Edit the `config.lua` to your liking
21 | 4) Change `html - advanced` or `html - basic` to `html`
22 | 5) Edit the `fxmanifest.lua` to use either Basic or Advanced
23 |
24 | # Credits/Original Code:
25 | * [onlyserenity]( https://github.com/onlyserenity )
26 | * [esx_new_banking]( https://github.com/onlyserenity/esx_new_banking )
27 |
--------------------------------------------------------------------------------
/esx_advancedbanking/client/main.lua:
--------------------------------------------------------------------------------
1 | local HasAlreadyEnteredMarker, IsInMainMenu = false, false
2 | local LastZone, CurrentAction, CurrentActionMsg
3 |
4 | -- Current Balance Event
5 | RegisterNetEvent('esx_advancedbanking:currentBalance')
6 | AddEventHandler('esx_advancedbanking:currentBalance', function(balance)
7 | if Config.ShowCharName then
8 | ESX.TriggerServerCallback('esx_advancedbanking:getCharData', function(data)
9 | if Config.ShowFirstLast then
10 | playerName = data.firstname .. ' ' .. data.lastname
11 | else
12 | playerName = data.firstname
13 | end
14 |
15 | SendNUIMessage({type = 'balanceHUD', balance = balance, player = playerName})
16 | end)
17 | else
18 | local id = PlayerId()
19 | local playerName = GetPlayerName(id)
20 | SendNUIMessage({type = 'balanceHUD', balance = balance, player = playerName})
21 | end
22 | end)
23 |
24 | -- Balance Callback
25 | RegisterNUICallback('balance', function()
26 | TriggerServerEvent('esx_advancedbanking:balance')
27 | end)
28 |
29 | -- Deposit Callback
30 | RegisterNUICallback('deposit', function(data)
31 | TriggerServerEvent('esx_advancedbanking:deposit', tonumber(data.amount))
32 | TriggerServerEvent('esx_advancedbanking:balance')
33 | end)
34 |
35 | -- Withdraw Callback
36 | RegisterNUICallback('withdrawl', function(data)
37 | TriggerServerEvent('esx_advancedbanking:withdraw', tonumber(data.amountw))
38 | TriggerServerEvent('esx_advancedbanking:balance')
39 | end)
40 |
41 | -- Transfer Callback
42 | RegisterNUICallback('transfer', function(data)
43 | TriggerServerEvent('esx_advancedbanking:transfer', data.target, data.amountt)
44 | TriggerServerEvent('esx_advancedbanking:balance')
45 | end)
46 |
47 | -- Result Event
48 | RegisterNetEvent('esx_advancedbanking:result')
49 | AddEventHandler('esx_advancedbanking:result', function(type, message)
50 | SendNUIMessage({type = 'result', m = message, t = type})
51 | end)
52 |
53 | -- Invest Callback
54 | RegisterNUICallback('esx_invest', function()
55 | if IsInMainMenu then
56 | IsInMainMenu = false
57 | SetNuiFocus(false, false)
58 | SendNUIMessage({type = 'closeAll'})
59 | exports.esx_invest:openUI()
60 | end
61 | end)
62 |
63 | -- Play Animation Function
64 | function playAnim(animDict, animName, duration)
65 | RequestAnimDict(animDict)
66 | while not HasAnimDictLoaded(animDict) do
67 | Wait(0)
68 | end
69 | TaskPlayAnim(PlayerPedId(), animDict, animName, 1.0, -1.0, duration, 49, 1, false, false, false)
70 | RemoveAnimDict(animDict)
71 | end
72 |
73 | -- Close UI Callback
74 | RegisterNUICallback('NUIFocusOff', function()
75 | closeUI()
76 | end)
77 |
78 | -- Open UI Function
79 | function openUI()
80 | if Config.Animation.Active then
81 | playAnim('mp_common', 'givetake1_a', Config.Animation.Time)
82 | Wait(Config.Animation.Time)
83 | end
84 |
85 | IsInMainMenu = true
86 | SetNuiFocus(true, true)
87 | SendNUIMessage({type = 'openGeneral'})
88 | TriggerServerEvent('esx_advancedbanking:balance')
89 | end
90 |
91 | -- Close UI Function
92 | function closeUI()
93 | IsInMainMenu = false
94 | SetNuiFocus(false, false)
95 |
96 | if Config.Animation.Active then
97 | playAnim('mp_common', 'givetake1_a', Config.Animation.Time)
98 | Wait(Config.Animation.Time)
99 | end
100 |
101 | SendNUIMessage({type = 'closeAll'})
102 | end
103 |
104 | -- Entered Marker
105 | AddEventHandler('esx_advancedbanking:hasEnteredMarker', function(zone)
106 | if zone == 'ATMLocations' then
107 | CurrentAction = 'atm_menu'
108 | CurrentActionMsg = _U('press_access_atm')
109 | elseif zone == 'BankLocations' then
110 | CurrentAction = 'bank_menu'
111 | CurrentActionMsg = _U('press_access_bank')
112 | end
113 | end)
114 |
115 | -- Exited Marker
116 | AddEventHandler('esx_advancedbanking:hasExitedMarker', function(zone)
117 | if not IsInMainMenu then
118 | closeUI()
119 | end
120 |
121 | CurrentAction = nil
122 | end)
123 |
124 | -- Resource Stop
125 | AddEventHandler('onResourceStop', function(resource)
126 | if resource == GetCurrentResourceName() then
127 | if IsInMainMenu then
128 | closeUI()
129 | end
130 | end
131 | end)
132 |
133 | -- Create Blips
134 | CreateThread(function()
135 | if Config.UseATMBlips then
136 | for k,v in pairs(Config.Locations) do
137 | for i=1, #v.ATMs, 1 do
138 | local blip = AddBlipForCoord(v.ATMs[i])
139 |
140 | SetBlipSprite (blip, Config.ATMBlip.Sprite)
141 | SetBlipColour (blip, Config.ATMBlip.Color)
142 | SetBlipDisplay(blip, Config.ATMBlip.Display)
143 | SetBlipScale (blip, Config.ATMBlip.Scale)
144 | SetBlipAsShortRange(blip, true)
145 |
146 | BeginTextCommandSetBlipName('STRING')
147 | AddTextComponentSubstringPlayerName(_U('blip_atm'))
148 | EndTextCommandSetBlipName(blip)
149 | end
150 | end
151 | end
152 |
153 | if Config.UseBankBlips then
154 | for k,v in pairs(Config.Locations) do
155 | for i=1, #v.Banks, 1 do
156 | local blip = AddBlipForCoord(v.Banks[i])
157 |
158 | SetBlipSprite (blip, Config.BankBlip.Sprite)
159 | SetBlipColour (blip, Config.BankBlip.Color)
160 | SetBlipDisplay(blip, Config.BankBlip.Display)
161 | SetBlipScale (blip, Config.BankBlip.Scale)
162 | SetBlipAsShortRange(blip, true)
163 |
164 | BeginTextCommandSetBlipName('STRING')
165 | AddTextComponentSubstringPlayerName(_U('blip_bank'))
166 | EndTextCommandSetBlipName(blip)
167 | end
168 | end
169 | end
170 | end)
171 |
172 | -- Enter / Exit marker events & Draw Markers
173 | CreateThread(function()
174 | while true do
175 | Wait(0)
176 | local playerCoords = GetEntityCoords(PlayerPedId())
177 | local isInMarker, letSleep, currentZone = false, true, nil
178 |
179 | for k,v in pairs(Config.Locations) do
180 | for i=1, #v.ATMs, 1 do
181 | local distance = #(playerCoords - v.ATMs[i])
182 |
183 | if distance < Config.DrawDistance then
184 | letSleep = false
185 |
186 | if Config.ATMMarker.Type ~= -1 then
187 | DrawMarker(Config.ATMMarker.Type, v.ATMs[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.ATMMarker.x, Config.ATMMarker.y, Config.ATMMarker.z, Config.ATMMarker.r, Config.ATMMarker.g, Config.ATMMarker.b, 100, false, true, 2, false, nil, nil, false)
188 | end
189 |
190 | if distance < Config.ATMMarker.x then
191 | isInMarker, currentZone = true, 'ATMLocations'
192 | end
193 | end
194 | end
195 | end
196 |
197 | for k,v in pairs(Config.Locations) do
198 | for i=1, #v.Banks, 1 do
199 | local distance = #(playerCoords - v.Banks[i])
200 |
201 | if distance < Config.DrawDistance then
202 | letSleep = false
203 |
204 | if Config.BankMarker.Type ~= -1 then
205 | DrawMarker(Config.BankMarker.Type, v.Banks[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.BankMarker.x, Config.BankMarker.y, Config.BankMarker.z, Config.BankMarker.r, Config.BankMarker.g, Config.BankMarker.b, 100, false, true, 2, false, nil, nil, false)
206 | end
207 |
208 | if distance < Config.BankMarker.x then
209 | isInMarker, currentZone = true, 'BankLocations'
210 | end
211 | end
212 | end
213 | end
214 |
215 | if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then
216 | HasAlreadyEnteredMarker, LastZone = true, currentZone
217 | LastZone = currentZone
218 | TriggerEvent('esx_advancedbanking:hasEnteredMarker', currentZone)
219 | end
220 |
221 | if not isInMarker and HasAlreadyEnteredMarker then
222 | HasAlreadyEnteredMarker = false
223 | TriggerEvent('esx_advancedbanking:hasExitedMarker', LastZone)
224 | end
225 |
226 | if letSleep then
227 | Wait(500)
228 | end
229 | end
230 | end)
231 |
232 | -- Key Controls
233 | CreateThread(function()
234 | while true do
235 | Wait(0)
236 |
237 | if CurrentAction then
238 | ESX.ShowHelpNotification(CurrentActionMsg)
239 |
240 | if IsControlJustReleased(0, 38) and GetLastInputMethod(2) then
241 | if Config.UseAdvancedHoldup then
242 | if IsPedOnFoot(PlayerPedId()) then
243 | if CurrentAction == 'atm_menu' then
244 | openUI()
245 | elseif CurrentAction == 'bank_menu' then
246 | ESX.TriggerServerCallback('esx_advancedholdup:checkRob', function(success)
247 | if success then
248 | openUI()
249 | else
250 | ESX.ShowNotification(_U('error_robbery'))
251 | end
252 | end)
253 | end
254 |
255 | CurrentAction = nil
256 | else
257 | ESX.ShowNotification(_U('error_vehicle'))
258 | end
259 | else
260 | if IsPedOnFoot(PlayerPedId()) then
261 | if CurrentAction == 'atm_menu' then
262 | openUI()
263 | elseif CurrentAction == 'bank_menu' then
264 | openUI()
265 | end
266 |
267 | CurrentAction = nil
268 | else
269 | ESX.ShowNotification(_U('error_vehicle'))
270 | end
271 | end
272 | end
273 | else
274 | Wait(500)
275 | end
276 |
277 | if IsControlJustReleased(0, 322) then
278 | closeUI()
279 | end
280 | end
281 | end)
282 |
--------------------------------------------------------------------------------
/esx_advancedbanking/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 | Config.DrawDistance = 25 -- Marker Draw Distance.
4 |
5 | Config.UseAdvancedHoldup = false -- true = Using esx_advancedholdup.
6 |
7 | Config.ShowCharName = true -- true = Use Character Names. | false = Use Steam Name.
8 | Config.ShowFirstLast = true -- true = Use Characters First & Last Name. | false = Use Characters First Name.
9 |
10 | Config.UseATMBlips = false -- true = Use ATM Blips. | NOTE: Its best to leave this at false. There is a LOT of ATMs.
11 | Config.ATMBlip = {Sprite = 277, Color = 0, Display = 2, Scale = 1.0} -- ATM Blip Settings.
12 | Config.ATMMarker = {Type = 29, r = 0, g = 255, b = 0, x = 1.5, y = 1.5, z = 1.5} -- ATM Marker Settings.
13 |
14 | Config.UseBankBlips = false -- true = Use Bank Blips.
15 | Config.BankBlip = {Sprite = 108, Color = 0, Display = 2, Scale = 1.0} -- Bank Blip Settings.
16 | Config.BankMarker = {Type = 29, r = 0, g = 255, b = 0, x = 1.5, y = 1.5, z = 1.5} -- Bank Marker Settings.
17 |
18 | Config.Animation = {
19 | Active = true, -- true = Use Animation.
20 | Time = 2500 -- Time in Miliseconds.
21 | }
22 |
23 | Config.Locations = {
24 | Locs = {
25 | Banks = {
26 | vector3(149.15, -1040.54, 29.37), -- Vespucci Blvd | Fleeca Bank
27 | vector3(-1213.29, -331.05, 37.79), -- Boulevard Del Perro | Fleeca Bank
28 | vector3(-2962.51, 482.24, 15.7), -- Great Ocean Hwy | Fleeca Bank
29 | vector3(-112.5, 6469.71, 31.63), -- Paleto Blvd | Blaine County Savings Bank
30 | vector3(-111.45, 6468.64, 31.63), -- Paleto Blvd | Blaine County Savings Bank
31 | vector3(313.53, -278.93, 54.17), -- Hawick Ave | Fleeca Bank
32 | vector3(-351.65, -49.66, 49.04), -- Hawick Ave | Fleeca Bank
33 | vector3(242.34, 225.12, 106.29), -- Alta St | Pacific Standard Public Deposit Bank
34 | vector3(247.51, 223.29, 106.29), -- Alta St | Pacific Standard Public Deposit Bank
35 | vector3(252.61, 221.34, 106.29), -- Alta St | Pacific Standard Public Deposit Bank
36 | vector3(1175.74, 2706.88, 38.09) -- Route 68 | Fleeca Bank
37 | },
38 | ATMs = {
39 | -- Paleto Bay
40 | vector3(-386.8, 6046.14, 31.5), -- Paleto Blvd
41 | vector3(-97.23, 6455.42, 31.47), -- Paleto Blvd
42 | vector3(-95.45, 6457.15, 31.46), -- Paleto Blvd
43 | vector3(155.8, 6642.92, 31.6), -- Paleto Blvd
44 | vector3(174.16, 6637.93, 31.57), -- Paleto Blvd
45 | vector3(-133.03, 6366.51, 31.48), -- Paleto Blvd
46 | vector3(1701.28, 6426.49, 32.76), -- Senora Fwy
47 | vector3(1735.25, 6410.53, 35.04), -- Senora Fwy
48 | vector3(2683.11, 3286.59, 55.24), -- Senora Fwy
49 | vector3(-283.01, 6226.05, 31.49), -- Duluoz Ave
50 | -- Grapeseed
51 | vector3(1702.98, 4933.58, 42.06), -- Grapeseed Main St
52 | vector3(1686.84, 4815.89, 42.01), -- Grapeseed Main St
53 | -- Sandy Shores
54 | vector3(1968.09, 3743.56, 32.34), -- Alhambra Dr
55 | vector3(1171.99, 2702.56, 38.18), -- Route 68
56 | vector3(540.34, 2671.09, 42.16), -- Route 68
57 | vector3(-1091.5, 2708.65, 18.95), -- Route 68
58 | vector3(2564.57, 2584.73, 38.08), -- Senora Way
59 | vector3(1822.66, 3683.04, 34.28), -- Zancudo Ave
60 | -- Los Santos
61 | vector3(2558.76, 351.06, 108.62), -- Palomino Fwy
62 | vector3(2558.46, 389.46, 108.62), -- Palomino Fwy
63 | vector3(-821.51, -1082.19, 11.13), -- Palomino Ave
64 | vector3(-660.76, -853.82, 24.48), -- Palomino Ave
65 | vector3(1077.81, -776.55, 58.24), -- West Mirror Drive
66 | vector3(1153.65, -326.8, 69.21), -- West Mirror Drive
67 | vector3(1138.23, -468.92, 66.73), -- Mirrow Park Blvd
68 | vector3(1166.9, -456.05, 66.81), -- Mirrow Park Blvd
69 | vector3(236.72, 219.23, 106.29), -- Alta St
70 | vector3(237.41, 217.73, 106.29), -- Alta St
71 | vector3(238.04, 216.44, 106.29), -- Alta St
72 | vector3(265.56, 213.47, 106.28), -- Alta St
73 | vector3(265.15, 211.96, 106.28), -- Alta St
74 | vector3(264.57, 210.59, 106.28), -- Alta St
75 | vector3(-165.16, 232.69, 94.92), -- Eclipse Blvd
76 | vector3(-165.13, 234.86, 94.92), -- Eclipse Blvd
77 | vector3(-1827.23, 784.88, 138.3), -- Banham Canyon Dr
78 | vector3(-1409.68, -100.54, 52.38), -- Cougar Ave
79 | vector3(-1410.33, -98.75, 52.38), -- Cougar Ave
80 | vector3(-1204.91, -326.31, 37.83), -- Boulevard Del Perro
81 | vector3(-1205.7, -324.7, 37.83), -- Boulevard Del Perro
82 | vector3(-2072.38, -317.19, 13.32), -- Del Perro Fwy
83 | vector3(-1305.35, -706.46, 25.32), -- Del Perro Fwy
84 | vector3(-2975.06, 380.18, 15.0), -- Great Ocean Hwy
85 | vector3(-2956.77, 487.67, 15.46), -- Great Ocean Hwy
86 | vector3(-2958.98, 487.84, 15.46), -- Great Ocean Hwy
87 | vector3(-3144.33, 1127.59, 20.86), -- Great Ocean Hwy
88 | vector3(-717.61, -915.74, 19.22), -- Ginger St
89 | vector3(-526.59, -1222.96, 18.45), -- Calais Ave
90 | vector3(147.7, -1035.72, 29.34), -- Vespucci Blvd
91 | vector3(145.99, -1035.21, 29.34), -- Vespucci Blvd
92 | vector3(-303.36, -829.73, 32.42), -- Vespucci Blvd
93 | vector3(-301.7, -830.05, 32.42), -- Vespucci Blvd
94 | vector3(-537.75, -854.51, 29.3), -- Vespucci Blvd
95 | vector3(-712.91, -818.95, 23.73), -- Vespucci Blvd
96 | vector3(-710.12, -818.98, 23.73), -- Vespucci Blvd
97 | vector3(-203.83, -861.38, 30.27), -- Vespucci Blvd
98 | vector3(24.47, -946.04, 29.36), -- Vespucci Blvd
99 | vector3(-846.55, -340.77, 38.68), -- Heritage Way
100 | vector3(-56.95, -1752.09, 29.42), -- Grove St
101 | vector3(-272.99, -2024.58, 30.15), -- Davis Ave
102 | vector3(-261.99, -2012.41, 30.15), -- Davis Ave
103 | vector3(-1570.55, -546.99, 34.96), -- Bay City Ave
104 | vector3(-1315.82, -834.65, 16.96), -- Bay City Ave
105 | vector3(-1314.73, -836.05, 16.96), -- Bay City Ave
106 | vector3(33.15, -1348.2, 29.5), -- Innocence Blvd
107 | vector3(129.42, -1291.53, 29.27), -- Strawberry Ave
108 | vector3(129.84, -1292.3, 29.27), -- Strawberry Ave
109 | vector3(296.44, -894.19, 29.23), -- Strawberry Ave
110 | vector3(295.74, -896.05, 29.22), -- Strawberry Ave
111 | vector3(289.05, -1256.75, 29.44), -- Olympic Fwy
112 | vector3(5.2, -919.8, 29.56), -- Power St
113 | vector3(380.74, 323.4, 103.57), -- Clinton Ave
114 | vector3(285.48, 143.38, 104.17), -- Vinewood Blvd
115 | vector3(158.63, 234.08, 106.63), -- Vinewood Blvd
116 | vector3(-3043.93, 594.59, 7.74), -- Ineseno Road
117 | vector3(-3040.75, 593.06, 7.91), -- Ineseno Road
118 | vector3(-3241.13, 997.5, 12.55), -- Barbareno Rd
119 | vector3(-3240.67, 1008.63, 12.83), -- Barbareno Rd
120 | vector3(-258.77, -723.38, 33.46), -- Peaceful St
121 | vector3(-256.23, -716.0, 33.53), -- Peaceful St
122 | vector3(-254.25, -692.38, 33.61), -- Peaceful St
123 | vector3(111.29, -775.28, 31.44), -- San Andreas Ave
124 | vector3(114.45, -776.45, 31.42), -- San Andreas Ave
125 | vector3(112.61, -819.31, 31.34), -- San Andreas Ave
126 | vector3(119.15, -883.65, 31.12), -- Elgin Ave
127 | vector3(-1416.04, -212.02, 46.5), -- Morningwood Blvd
128 | vector3(-1430.14, -211.15, 46.5), -- Morningwood Blvd
129 | vector3(288.81, -1282.32, 29.64), -- Capital Blvd
130 | vector3(89.58, 2.42, 68.31), -- Spanish Ave
131 | }
132 | }
133 | }
134 |
--------------------------------------------------------------------------------
/esx_advancedbanking/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Advanced Banking'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@oxmysql/lib/MySQL.lua',
20 | 'server/main.lua'
21 | }
22 |
23 | client_scripts {
24 | 'client/main.lua'
25 | }
26 |
27 | ui_page 'html/UI.html'
28 |
29 | files {
30 | -- Advanced
31 | --'html/UI.html',
32 | --'html/style.css',
33 | --'html/media/font/*.otf',
34 | --'html/media/img/*.png',
35 | -- Basic
36 | --'html/UI.html',
37 | --'html/style.css',
38 | --'html/img/BG_White.png',
39 | }
40 |
41 | export 'openUI'
42 |
43 | dependencies {
44 | 'es_extended'
45 | }
46 |
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/font/Bariol_Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/font/Bariol_Regular.otf
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/font/Vision-Black.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/font/Vision-Black.otf
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/font/Vision-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/font/Vision-Bold.otf
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/font/Vision-Heavy.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/font/Vision-Heavy.otf
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/bg.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/circle.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/circle.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/circle.psd
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/curve.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/curve.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/fingerprint.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/fingerprint.jpg
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/fingerprint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/fingerprint.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/graph.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/logo-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/logo-big.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - advanced/media/img/logo-top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - advanced/media/img/logo-top.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - basic/UI.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
15 |
16 |
17 |
18 |
Hello,
19 | Balance:
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
35 |
36 |
37 |
44 |
45 |
46 |
Hello,
47 |
48 |
49 |
50 |
51 |
59 |
60 |
61 |
62 |
81 |
82 |
193 |
194 |
--------------------------------------------------------------------------------
/esx_advancedbanking/html - basic/img/BG.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - basic/img/BG.psd
--------------------------------------------------------------------------------
/esx_advancedbanking/html - basic/img/BG_White.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HumanTree92/VENT_ESX_Scripts/b9a08656509d9118fef7d18d3c79d1403f099740/esx_advancedbanking/html - basic/img/BG_White.png
--------------------------------------------------------------------------------
/esx_advancedbanking/html - basic/style.css:
--------------------------------------------------------------------------------
1 | body, html {
2 | overflow-y: hidden;
3 | }
4 | /* main.css */
5 |
6 | button{
7 | color: white;
8 | background-color: #000000;
9 | font-family: 'Segoe UI';
10 | font-size: 20px;
11 | background-size: 50px;
12 | margin: 15px auto;
13 | padding: 15px 24px;
14 | cursor: pointer;
15 | text-transform: uppercase;
16 | width: 40%;
17 | height: 14%;
18 | display: inline-block;
19 | position: relative;
20 | left: 10%;
21 | bottom: -100px;
22 | }
23 |
24 | #exitbank{
25 | width: 81%;
26 | }
27 |
28 | h3{
29 | position: absolute;
30 | left: 8%;
31 | bottom: 80%;
32 | }
33 |
34 | h4{
35 | position: absolute;
36 | left: 65%;
37 | bottom: 80%;
38 | }
39 |
40 | #balanceX{
41 | position: absolute;
42 | margin: 10px auto;
43 | left: 40%;
44 | top: 40%;
45 | font-size:30px;
46 | }
47 |
48 | #cancelbalance{
49 | position: absolute;
50 | left: 31%;
51 | bottom: 20%;
52 | }
53 |
54 | .general{
55 | background-image: url('img/BG_White.png');
56 | background-repeat: no-repeat;
57 | font-family: 'Segoe UI';
58 | background-size: 620px 430px;
59 | width: 600px;
60 | height: 400px;
61 | position: absolute;
62 | left: 50%;
63 | transform: translateX(-50%);
64 | padding: 10px;
65 | position: absolute;
66 | margin-top: 10%;
67 | margin-left: auto;
68 | margin-right: auto;
69 | padding-bottom: 20px;
70 | }
71 |
72 | .depositUI{
73 | background-image: url('img/BG_White.png');
74 | background-repeat: no-repeat;
75 | font-family: 'Segoe UI';
76 | background-size: 620px 430px;
77 | width: 600px;
78 | height: 400px;
79 | position: absolute;
80 | left: 50%;
81 | transform: translateX(-50%);
82 | padding: 10px;
83 | position: absolute;
84 | margin-top: 10%;
85 | margin-left: auto;
86 | margin-right: auto;
87 | padding-bottom: 20px;
88 | }
89 |
90 | .withdrawUI{
91 | background-image: url('img/BG_White.png');
92 | background-repeat: no-repeat;
93 | font-family: 'Segoe UI';
94 | background-size: 620px 430px;
95 | width: 600px;
96 | height: 400px;
97 | position: absolute;
98 | left: 50%;
99 | transform: translateX(-50%);
100 | padding: 10px;
101 | position: absolute;
102 | margin-top: 10%;
103 | margin-left: auto;
104 | margin-right: auto;
105 | padding-bottom: 20px;
106 | }
107 |
108 | .balanceUI{
109 | background-image: url('img/BG_White.png');
110 | background-repeat: no-repeat;
111 | font-family: 'Segoe UI';
112 | background-size: 620px 430px;
113 | width: 600px;
114 | height: 400px;
115 | position: absolute;
116 | left: 50%;
117 | transform: translateX(-50%);
118 | padding: 10px;
119 | position: absolute;
120 | margin-top: 10%;
121 | margin-left: auto;
122 | margin-right: auto;
123 | padding-bottom: 20px;
124 | }
125 |
126 | .transferUI{
127 | background-image: url('img/BG_White.png');
128 | background-repeat: no-repeat;
129 | font-family: 'Segoe UI';
130 | background-size: 620px 430px;
131 | width: 600px;
132 | height: 400px;
133 | position: absolute;
134 | left: 50%;
135 | transform: translateX(-50%);
136 | padding: 10px;
137 | position: absolute;
138 | margin-top: 10%;
139 | margin-left: auto;
140 | margin-right: auto;
141 | padding-bottom: 20px;
142 | }
143 |
144 | #from, #target, #amountt {
145 | position: relative;
146 | top: 100px;
147 | left: 62px;
148 | font-family: 'Segoe UI';
149 | width: 40%;
150 | height: 8%;
151 | padding: 5px 5px;
152 | margin: 15px 0;
153 | box-sizing: border-box;
154 | }
155 |
156 | h1{
157 | font-family: 'Segoe UI';
158 | color: black;
159 | position: relative;
160 | left: 48%;
161 | top: 39%;
162 | }
163 |
164 | .b{
165 | font-family: 'Segoe UI';
166 | color: black;
167 | position: relative;
168 | left: 30%;
169 | top: 30%;
170 | }
171 |
172 | #backbalnace {
173 | position:relative;
174 | top: 60%;
175 | left: 30%;
176 | }
177 |
178 | input[type=text] {
179 | position: relative;
180 | top: 100px;
181 | left: 62px;
182 | font-family: 'Segoe UI';
183 | width: 80%;
184 | height: 15%;
185 | padding: 5px 5px;
186 | margin: 40px 0;
187 | box-sizing: border-box;
188 | }
189 |
190 | button:hover{
191 | background-color: #D3D3D3;
192 | }
193 |
--------------------------------------------------------------------------------
/esx_advancedbanking/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | ['blip_atm'] = 'ATM',
3 | ['blip_bank'] = 'Bank',
4 | ['press_access_atm'] = 'Press ~INPUT_CONTEXT~ to access ATM',
5 | ['press_access_bank'] = 'Press ~INPUT_CONTEXT~ to access Bank',
6 | ['invalid_amount'] = '~r~That\'s an Invalid Amount of Money~s~',
7 | ['invalid_self'] = '~r~You can\'t Transfer Money to yourself',
8 | ['invalid_input'] = '~r~Invalid Player ID or Amount',
9 | ['transfer_you'] = 'You Transfered ~g~$%s~s~ to ~y~%s~s~',
10 | ['transfer_receive'] = 'You Received ~g~$%s~s~ from ~y~%s~s~',
11 | ['error_vehicle'] = '~r~You must be on Foot',
12 | ['error_robbery'] = 'All ATMs & Banks are closed due to recent Robbery. Come Back Later.',
13 | }
14 |
--------------------------------------------------------------------------------
/esx_advancedbanking/server/main.lua:
--------------------------------------------------------------------------------
1 | -- getCharData
2 | function getCharData(source, cb)
3 | local xPlayer = ESX.GetPlayerFromId(source)
4 | MySQL.single('SELECT firstname, lastname FROM users WHERE identifier = ?', {xPlayer.identifier}, function(result)
5 | if result then
6 | local data = {
7 | firstname = result.firstname,
8 | lastname = result.lastname
9 | }
10 | cb(data)
11 | end
12 | end)
13 | end
14 |
15 | ESX.RegisterServerCallback('esx_advancedbanking:getCharData', function(source, cb)
16 | getCharData(source, function(data)
17 | if data ~= nil then
18 | cb(data)
19 | end
20 | end)
21 | end)
22 |
23 | -- Balance Event
24 | RegisterServerEvent('esx_advancedbanking:balance')
25 | AddEventHandler('esx_advancedbanking:balance', function()
26 | local _source = source
27 | local xPlayer = ESX.GetPlayerFromId(_source)
28 | local balance = xPlayer.getAccount('bank').money
29 | TriggerClientEvent('esx_advancedbanking:currentBalance', _source, balance)
30 | end)
31 |
32 | -- Deposit Event
33 | RegisterServerEvent('esx_advancedbanking:deposit')
34 | AddEventHandler('esx_advancedbanking:deposit', function(amount)
35 | local _source = source
36 | local xPlayer = ESX.GetPlayerFromId(_source)
37 |
38 | if amount == nil or amount <= 0 then
39 | xPlayer.showNotification(_U('invalid_amount'))
40 | else
41 | if amount > xPlayer.getMoney() then
42 | amount = xPlayer.getMoney()
43 | end
44 |
45 | xPlayer.removeMoney(amount)
46 | xPlayer.addAccountMoney('bank', amount)
47 | end
48 | end)
49 |
50 | -- Withdraw Event
51 | RegisterServerEvent('esx_advancedbanking:withdraw')
52 | AddEventHandler('esx_advancedbanking:withdraw', function(amount)
53 | local _source = source
54 | local xPlayer = ESX.GetPlayerFromId(_source)
55 | amount = tonumber(amount)
56 | local account = xPlayer.getAccount('bank').money
57 |
58 | if amount == nil or amount <= 0 then
59 | xPlayer.showNotification(_U('invalid_amount'))
60 | else
61 | if amount > account then
62 | amount = account
63 | end
64 |
65 | xPlayer.removeAccountMoney('bank', amount)
66 | xPlayer.addMoney(amount)
67 | end
68 | end)
69 |
70 | -- Transfer Event
71 | RegisterServerEvent('esx_advancedbanking:transfer')
72 | AddEventHandler('esx_advancedbanking:transfer', function(target, amountt)
73 | local _source = source
74 | local xPlayer = ESX.GetPlayerFromId(_source)
75 | local tPlayer = ESX.GetPlayerFromId(target)
76 | local account = 0
77 |
78 | if tPlayer ~= nil and GetPlayerEndpoint(target) ~= nil then
79 | account = xPlayer.getAccount('bank').money
80 |
81 | if tonumber(_source) == tonumber(target) then
82 | xPlayer.showNotification(_U('invalid_self'))
83 | else
84 | if account <= 0 or account < tonumber(amountt) or tonumber(amountt) <= 0 then
85 | xPlayer.showNotification(_U('invalid_amount'))
86 | else
87 | xPlayer.removeAccountMoney('bank', tonumber(amountt))
88 | tPlayer.addAccountMoney('bank', tonumber(amountt))
89 | -- Show Notification
90 | xPlayer.showNotification(_U('transfer_you', amountt, target))
91 | tPlayer.showNotification(_U('transfer_receive', amountt, _source))
92 | end
93 | end
94 | else
95 | xPlayer.showNotification(_U('invalid_input'))
96 | end
97 | end)
98 |
--------------------------------------------------------------------------------
/esx_advancedgarage/README.md:
--------------------------------------------------------------------------------
1 | # About esx_advancedgarage:
2 | Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * Unable to Store Vehicles you don't own.
6 | * Ability to Kick people who try to Cheat using the Garage & Set Custom Kick Message.
7 | * Private Property Garages. Must have esx_property
8 | * Ambulance, Police, Mechanic, Taxi, Aircraft, Boat, & Car Garages/Impounds.
9 | * Uses esx_menu_list instead of esx_menu_default.
10 | * Ability to Rename Vehicle.
11 | * No longer needing a vehicle_names.lua file. New system pulls name from Advanced Vehicle Shop.
12 | * Vehicles are stored in a Class basses. Example: If you buy a Super Car it will show up under the Super Car Class in Garage.
13 | * WILL NOT WORK WITH esx_vehicleshop & WILL ONLY WORK WITH esx_advancedvehicleshop
14 | * Now supports LegacyFuel
15 |
16 | # Requirements:
17 | * Required:
18 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
19 | * [esx_advancedvehicleshop]( https://github.com/HumanTree92/VENT_ESX_Scripts/tree/main/esx_advancedvehicleshop )
20 | * Optional:
21 | * [esx_property]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_property )
22 | * [esx_mechanicjob]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_mechanicjob )
23 | * [esx_taxijob]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_taxijob )
24 |
25 | # Download & Installation:
26 | 1) Place `esx_advancedgarage` in your ESX Directory
27 | 2) Add `start esx_advancedgarage` to your server.cfg
28 | 3) Edit the `config.lua` to your liking
29 |
30 | # KNOWN BUGS:
31 | * With the New Menu Design there is still a Limit before the Menu breaks. This is something i can't fix. But each Class can holdup to roughly 36 Vehicles for a total of 432 Vehicles.
32 | * It is Possible to Duplicate Vehicles if the resource is restarted while vehicles are out.
33 |
--------------------------------------------------------------------------------
/esx_advancedgarage/esx_advancedgarage.sql:
--------------------------------------------------------------------------------
1 | USE `es_extended`;
2 |
3 | CREATE TABLE `owned_vehicles` (
4 | `owner` varchar(60) NOT NULL,
5 | `plate` varchar(12) NOT NULL,
6 | `vehicle` longtext NOT NULL,
7 | `type` VARCHAR(20) NOT NULL DEFAULT 'car',
8 | `job` VARCHAR(20) NOT NULL DEFAULT 'civ',
9 | `category` VARCHAR(50) DEFAULT NULL,
10 | `name` varchar(60) NOT NULL DEFAULT 'Unknown',
11 | `garage` VARCHAR(50) NOT NULL DEFAULT 'all',
12 | `fuel` int(11) NOT NULL DEFAULT '100',
13 | `stored` TINYINT(1) NOT NULL DEFAULT '0',
14 | `image` longtext,
15 |
16 | PRIMARY KEY (`plate`)
17 | );
18 |
--------------------------------------------------------------------------------
/esx_advancedgarage/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Advanced Garage'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@oxmysql/lib/MySQL.lua',
20 | 'server/main.lua'
21 | }
22 |
23 | client_scripts {
24 | 'client/main.lua'
25 | }
26 |
27 | dependencies {
28 | 'es_extended',
29 | --'esx_property'
30 | }
31 |
--------------------------------------------------------------------------------
/esx_advancedgarage/locales/de.lua:
--------------------------------------------------------------------------------
1 | Locales['de'] = {
2 | -- Blips
3 | ['blip_garage'] = 'Garage | Öffentlich',
4 | ['blip_garage_private'] = 'Garage | Privat',
5 | ['blip_pound'] = 'Garage | Abschlepphof',
6 | ['blip_ambulance_garage'] = 'Garage | Medic Garage',
7 | ['blip_ambulance_impound'] = 'Garage | Medic Abschlepphof',
8 | ['blip_police_garage'] = 'Garage | Polizei Garage',
9 | ['blip_police_impound'] = 'Garage | Polizei Abschlepphof',
10 | ['blip_mechanic_garage'] = 'Garage | Mechaniker Garage',
11 | ['blip_mechanic_impound'] = 'Garage | Mechaniker Abschlepphof',
12 |
13 | -- Menus
14 | ['garage_menu'] = 'Kategorie wählen',
15 | ['veh_plate'] = 'Kennzeichen',
16 | ['veh_name'] = 'Name',
17 | ['impound_fee'] = 'Strafe',
18 | ['impound_fee_value'] = '$%s',
19 | ['veh_loc'] = 'Ort',
20 | ['veh_loc_unknown'] = '-unbekannt',
21 | ['veh_loc_garage'] = 'geparkt',
22 | ['veh_loc_impound'] = 'Abschlepphof',
23 | ['actions'] = 'Aktionen',
24 | ['spawn'] = 'Ausparken',
25 | ['rename'] = 'Namen ändern',
26 | ['veh_rename'] = 'Namen ändern. | Min: %s / Max: %s',
27 | ['return'] = 'Zurück',
28 | ['return_vehicle'] = 'Fahrzeug einparken ($%s)',
29 | ['see_mechanic'] = 'Mechaniker besuchen',
30 | ['damaged_vehicle'] = 'Fahrzeug beschädigt',
31 |
32 | -- Categories
33 | ['large_trucks'] = 'Große Trucks',
34 | ['cars'] = 'Autos',
35 | ['helis'] = 'Helikopter',
36 | ['planes'] = 'Flugzeuge',
37 | ['boats'] = 'Boote',
38 | ['subs'] = 'U-Boote',
39 | ['box'] = 'Box Trucks',
40 | ['haul'] = 'Transporter',
41 | ['other'] = 'Andere Trucks',
42 | ['trans'] = 'Trucks',
43 | ['bikes'] = 'Bikes',
44 | ['compacts'] = 'Kompaktwagen',
45 | ['coupes'] = 'Coupes',
46 | ['motorcycles'] = 'Motorräder',
47 | ['muscles'] = 'Muscle',
48 | ['offroads'] = 'Geländewagen',
49 | ['sedans'] = 'Sedan',
50 | ['sports'] = 'Sportwagen',
51 | ['sportsclassics'] = 'Klassische Sportwagen',
52 | ['supers'] = 'Supersportwagen',
53 | ['suvs'] = 'SUV',
54 | ['vans'] = 'Vans',
55 |
56 | -- Notifications
57 | ['custom_kick'] = 'Du wurdest automatisch vom Server entfernt. Grund: cheating',
58 | ['press_to_enter'] = 'Drücke ~INPUT_PICKUP~ zum ausparken.',
59 | ['press_to_delete'] = 'Drücke ~INPUT_PICKUP~ zum einparken.',
60 | ['press_to_impound'] = 'Drücke ~INPUT_PICKUP~ zum auslösen.',
61 | ['garage_no'] = 'Du besitzt kein %s!',
62 | ['impound_no'] = 'Es sind keine Fahrzeuge von dir abgeschleppt!',
63 | ['veh_not_here'] = 'Das Fahrzeug ist hier nicht!',
64 | ['veh_out_world'] = 'Das Fahrzeug steht irgendwo herum!',
65 | ['must_ambulance'] = 'Dazu musst du Medic sein!',
66 | ['must_police'] = 'Dazu musst du Polizist sein!',
67 | ['must_mechanic'] = 'Dazu musst du Mechaniker sein!',
68 | ['you_paid'] = 'Du zahlst $',
69 | ['not_enough_money'] = 'Du hast nicht genug Geld!',
70 | ['cant_in_veh'] = 'Du kannst das nur zu Fuß!',
71 | ['not_correct_veh'] = 'Diese Garage ist nicht für dieses Fahrzeug geeignet!',
72 | ['driver_seat'] = 'Du musst der Fahrer sein!',
73 | ['visit_mechanic'] = 'Repariere das Auto.',
74 | ['cannot_store_vehicle'] = 'Du kannst dieses Fahrzeug nicht einparken!',
75 | ['no_vehicle_to_enter'] = 'Du sitzt in keinem Auto.',
76 | ['vehicle_in_garage'] = 'Dein Auto wurde eingeparkt.',
77 | ['veh_rename_empty'] = 'Name muss zwischen %s & %s Zeichen sein!',
78 | ['veh_rename_no'] = 'Custom Namen sind deaktiviert.',
79 | ['get_properties'] = '~y~Getting Private Garagen!',
80 | ['large_trucks_no'] = 'Diese Funktion ist noch deaktiviert!',
81 | }
82 |
--------------------------------------------------------------------------------
/esx_advancedgarage/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | -- Blips
3 | ['blip_garage'] = 'Garage | Public',
4 | ['blip_garage_private'] = 'Garage | Private',
5 | ['blip_pound'] = 'Garage | Pound',
6 | ['blip_ambulance_garage'] = 'Garage | Ambulance Garage',
7 | ['blip_ambulance_impound'] = 'Garage | Ambulance Impound',
8 | ['blip_police_garage'] = 'Garage | Police Garage',
9 | ['blip_police_impound'] = 'Garage | Police Impound',
10 | ['blip_mechanic_garage'] = 'Garage | Mechanic Garage',
11 | ['blip_mechanic_impound'] = 'Garage | Mechanic Impound',
12 | ['blip_taxi_garage'] = 'Garage | Taxi Garage',
13 | ['blip_taxi_impound'] = 'Garage | Taxi Impound',
14 |
15 | -- Menus
16 | ['garage_menu'] = 'Garage | Pick Vehicle Category',
17 | ['impound_menu'] = 'Impound | Pick Vehicle Category',
18 | ['veh_plate'] = 'Vehicle Plate',
19 | ['veh_name'] = 'Vehicle Name',
20 | ['impound_fee'] = 'Fee',
21 | ['impound_fee_value_r'] = '$%s',
22 | ['impound_fee_value_rd'] = '$%s | VIP Discount $%s',
23 | ['veh_loc'] = 'Location',
24 | ['veh_loc_unknown'] = 'Unknown',
25 | ['veh_loc_garage'] = 'In Garage',
26 | ['veh_loc_impound'] = 'Check Impound',
27 | ['actions'] = 'Actions',
28 | ['spawn'] = 'Spawn',
29 | ['rename'] = 'Rename',
30 | ['veh_rename'] = 'Name the Vehicle. | Min: %s / Max: %s',
31 | ['return'] = 'Return',
32 | ['return_vehicle'] = 'Store Vehicle ($%s)',
33 | ['see_mechanic'] = 'Visit Mechanic',
34 | ['damaged_vehicle'] = 'Vehicle Damaged',
35 |
36 | -- Categories
37 | ['cars'] = 'Cars',
38 | ['aircrafts'] = 'Aircrafts',
39 | ['helis'] = 'Helicopters',
40 | ['planes'] = 'Planes',
41 | ['boats'] = 'Boats',
42 | ['subs'] = 'Submersibles',
43 | ['box'] = 'Boxed Trucks',
44 | ['haul'] = 'Haulers',
45 | ['other'] = 'Other Trucks',
46 | ['trans'] = 'Transport Trucks',
47 | ['cycles'] = 'Cycles',
48 | ['compacts'] = 'Compacts',
49 | ['coupes'] = 'Coupes',
50 | ['motorcycles'] = 'Motorcycles',
51 | ['muscles'] = 'Muscles',
52 | ['offroads'] = 'Off-Roads',
53 | ['sedans'] = 'Sedans',
54 | ['sports'] = 'Sports',
55 | ['sportsclassics'] = 'Sports Classics',
56 | ['supers'] = 'Supers',
57 | ['suvs'] = 'SUVs',
58 | ['vans'] = 'Vans',
59 | ['viphelis'] = 'VIP Helicopters',
60 | ['vipplanes'] = 'VIP Planes',
61 | ['vipboats'] = 'VIP Boats',
62 | ['vipsubs'] = 'VIP Submersibles',
63 | ['vipcompacts'] = 'VIP Compacts',
64 | ['vipcoupes'] = 'VIP Coupes',
65 | ['vipmotos'] = 'VIP Motos',
66 | ['vipmuscles'] = 'VIP Muscles',
67 | ['vipoffroads'] = 'VIP Off-Roads',
68 | ['vipsedans'] = 'VIP Sedans',
69 | ['vipsports'] = 'VIP Sports',
70 | ['vipsportscs'] = 'VIP Sports Classics',
71 | ['vipsupers'] = 'VIP Supers',
72 | ['vipsuvs'] = 'VIP SUVs',
73 | ['vipvans'] = 'VIP Vans',
74 | ['viptrucks'] = 'VIP Trucks',
75 |
76 | -- Notifications
77 | ['custom_kick'] = Config.Main.CustomKickMsg,
78 | ['press_to_enter'] = 'Press ~INPUT_PICKUP~ to take Vehicle out of Garage.',
79 | ['press_to_delete'] = 'Press ~INPUT_PICKUP~ to store Vehicle in the Garage.',
80 | ['press_to_impound'] = 'Press ~INPUT_PICKUP~ to access the Impound.',
81 | ['garage_no'] = 'You don\'t own any %s!',
82 | ['garage_no_veh'] = 'You don\'t own any Vehicles for this Garage!',
83 | ['impound_no_veh'] = 'You don\'t have any Vehicles at the Impound!',
84 | ['veh_not_here'] = 'That Vehicle isn\'t Here!',
85 | ['veh_out_world'] = 'That Vehicle is Currently out in the World!',
86 | ['must_ambulance'] = 'Must be Ambulance Job to Access this!',
87 | ['must_police'] = 'Must be Police Job to Access this!',
88 | ['must_mechanic'] = 'Must be Mechanic Job to Access this!',
89 | ['must_taxi'] = 'Must be Taxi Job to Access this!',
90 | ['you_paid'] = 'You paid $',
91 | ['not_enough_money'] = 'You do not have enough money!',
92 | ['cant_in_veh'] = 'Must be out of this Vehicle to Access this!',
93 | ['not_correct_veh'] = 'Not in Correct Vehicle for this Garage!',
94 | ['driver_seat'] = 'Must be in Driver Seat to Store Vehicle!',
95 | ['visit_mechanic'] = 'Visit the Mechanic or Repair yourself.',
96 | ['cannot_store_vehicle'] = 'You can not store this Vehicle!',
97 | ['no_vehicle_to_enter'] = 'There is no Vehicle to store in the Garage.',
98 | ['vehicle_in_garage'] = 'Your Vehicle is stored in the Garage.',
99 | ['veh_rename_empty'] = 'Vehicle Name must be Between %s & %s Characters!',
100 | ['veh_rename_no'] = 'Vehicle Renaming is Currently turned Off.',
101 | ['get_properties'] = '~y~Getting Private Garages!',
102 | ['spawnpoint_blocked'] = 'Vehicle spawn point is ~r~blocked~s~!',
103 | }
104 |
--------------------------------------------------------------------------------
/esx_advancedgarage/locales/es.lua:
--------------------------------------------------------------------------------
1 | Locales['es'] = {
2 | -- Blips
3 | ['blip_garage'] = 'Garaje | Vehículos',
4 | ['blip_garage_private'] = 'Garaje | Privado',
5 | ['blip_pound'] = 'Garaje | Deposito de Vehículos',
6 | ['blip_ambulance_garage'] = 'Garaje | Hospital',
7 | ['blip_ambulance_impound'] = 'Garaje | Deposito Hospital',
8 | ['blip_police_garage'] = 'Garaje | Policía',
9 | ['blip_police_impound'] = 'Garaje | Deposito Policía',
10 | ['blip_mechanic_garage'] = 'Garaje | Mecánicos',
11 | ['blip_mechanic_impound'] = 'Garaje | Deposito Mecánicos',
12 |
13 | -- Menus
14 | ['garage_menu'] = 'Elija categoría de vehículo',
15 | ['veh_plate'] = 'Matrícula del Vehículo',
16 | ['veh_name'] = 'Nombre del Vehículo',
17 | ['impound_fee'] = 'Multa',
18 | ['impound_fee_value'] = '$%s',
19 | ['veh_loc'] = 'Localización',
20 | ['veh_loc_unknown'] = 'Desconocido',
21 | ['veh_loc_garage'] = 'En Garaje',
22 | ['veh_loc_impound'] = 'Comprobar deposito',
23 | ['actions'] = 'Acciones',
24 | ['spawn'] = 'Sacar',
25 | ['rename'] = 'Renombrar',
26 | ['veh_rename'] = 'Nombre del Vehículo. | Min: %s / Max: %s',
27 | ['return'] = 'Sacar Vehículo',
28 | ['return_vehicle'] = 'Guardar Vehículo ($%s)',
29 | ['see_mechanic'] = 'Visitar mecánico',
30 | ['damaged_vehicle'] = 'Vehículo dañado',
31 |
32 | -- Categories
33 | ['large_trucks'] = 'Vehículos Industriales',
34 | ['cars'] = 'Coches',
35 | ['helis'] = 'Helicopteros',
36 | ['planes'] = 'Aviones',
37 | ['boats'] = 'Barcos',
38 | ['subs'] = 'Submarinos',
39 | ['box'] = 'Boxed Trucks',
40 | ['haul'] = 'Haulers',
41 | ['other'] = 'Other Trucks',
42 | ['trans'] = 'Transport Trucks',
43 | ['cycles'] = 'Bicicletas',
44 | ['compacts'] = 'Compactos',
45 | ['coupes'] = 'Coupes',
46 | ['motorcycles'] = 'Motos',
47 | ['muscles'] = 'Muscles',
48 | ['offroads'] = 'Off-Roads',
49 | ['sedans'] = 'Sedanes',
50 | ['sports'] = 'Deportivos',
51 | ['sportsclassics'] = 'Deportivos Clasicos',
52 | ['supers'] = 'Supers',
53 | ['suvs'] = 'SUVs',
54 | ['vans'] = 'Furgonetas',
55 |
56 | -- Notifications
57 | ['custom_kick'] = '¡Kickeado por Chetero!',
58 | ['press_to_enter'] = 'Pulsa ~INPUT_PICKUP~ para sacar un vehículo del garaje.',
59 | ['press_to_delete'] = 'Pulsa ~INPUT_PICKUP~ para guardar el vehículo en el garaje.',
60 | ['press_to_impound'] = 'Pulsa ~INPUT_PICKUP~ para acceder al deposito.',
61 | ['garage_no'] = 'No tienes ningún %s!',
62 | ['garage_no_veh'] = '¡No tienes ningún vehículo para este garaje!',
63 | ['impound_no'] = '¡No tienes ningún vehículo en el depósito!',
64 | ['veh_not_here'] = '¡Ese vehículo no está aquí!',
65 | ['veh_out_world'] = '¡Ese vehículo está actualmente en el mundo!',
66 | ['must_ambulance'] = '¡Debe ser trabajador del Hospital para acceder a esto!',
67 | ['must_police'] = '¡Debe ser trabajador de la policía para acceder a esto!',
68 | ['must_mechanic'] = '¡Debe ser mecánico para acceder a esto!',
69 | ['you_paid'] = 'Has pagado ~g~€',
70 | ['not_enough_money'] = '¡No tienes suficiente dinero!',
71 | ['cant_in_veh'] = '¡Debe estar fuera del vehículo para acceder a esto!',
72 | ['not_correct_veh'] = '¡No estás en el vehículo correcto para este garaje!',
73 | ['driver_seat'] = '¡Debe estar en el asiento del conductor para almacenar el vehículo!',
74 | ['visit_mechanic'] = 'Visite al mecánico o repárelo usted mismo.',
75 | ['cannot_store_vehicle'] = '¡No puedes almacenar este vehículo!',
76 | ['no_vehicle_to_enter'] = 'No hay ningún vehículo para almacenar en el garaje.',
77 | ['vehicle_in_garage'] = 'Su vehículo está guardado en el garaje.',
78 | ['veh_rename_empty'] = 'El nombre del vehículo debe tener entre %s & %s caracteres!',
79 | ['veh_rename_no'] = 'El cambio de nombre del vehículo está desactivado actualmente.',
80 | ['get_properties'] = '~y~¡Obteniendo garajes privados!',
81 | ['large_trucks_no'] = '¡El concesionario de camiones no se utiliza en este servidor!',
82 | ['spawnpoint_blocked'] = '¡El punto de generación del vehículo está ~r~bloqueado~s~!',
83 | }
84 |
--------------------------------------------------------------------------------
/esx_advancedgarage/optional_properties.sql:
--------------------------------------------------------------------------------
1 | USE `es_extended`;
2 |
3 | INSERT INTO `properties` (`id`, `name`, `label`, `entering`, `exit`, `inside`, `outside`, `ipls`, `gateway`, `is_single`, `is_room`, `is_gateway`, `room_menu`, `price`) VALUES
4 | (100, 'MedEndApartment1', 'Medium Apartment 1', '{"y":3107.56,"z":41.49,"x":240.6}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":3100.77,"z":41.49,"x":240.21}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
5 | (101, 'MedEndApartment2', 'Medium Apartment 2', '{"y":3169.1,"z":41.81,"x":246.7}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":3163.97,"z":41.82,"x":245.83}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
6 | (102, 'MedEndApartment3', 'Medium Apartment 3', '{"y":2667.22,"z":39.06,"x":980.38}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":2668.77,"z":39.06,"x":986.38}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
7 | (103, 'MedEndApartment4', 'Medium Apartment 4', '{"y":3031.08,"z":42.89,"x":195.85}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":3031.39,"z":42.27,"x":200.68}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
8 | (104, 'MedEndApartment5', 'Medium Apartment 5', '{"y":4642.17,"z":42.88,"x":1724.43}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":4637.34,"z":42.31,"x":1724.27}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
9 | (105, 'MedEndApartment6', 'Medium Apartment 6', '{"y":4739.73,"z":40.99,"x":1664.98}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":4740.93,"z":41.08,"x":1670.92}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
10 | (106, 'MedEndApartment7', 'Medium Apartment 7', '{"y":6577.19,"z":31.74,"x":12.57}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":6572.61,"z":31.72,"x":16.93}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
11 | (107, 'MedEndApartment8', 'Medium Apartment 8', '{"y":6190.84,"z":30.73,"x":-374.31}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":6186.58,"z":30.52,"x":-372.65}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
12 | (108, 'MedEndApartment9', 'Medium Apartment 9', '{"y":6597.56,"z":30.86,"x":-27.06}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":6601.55,"z":30.44,"x":-30.55}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000),
13 | (109, 'MedEndApartment10', 'Medium Apartment 10', '{"y":6340.1,"z":28.84,"x":-367.33}', '{"y":-1012.27,"z":-100.2,"x":346.49}', '{"y":-1000.09,"z":-100.2,"x":347.06}', '{"y":6336.97,"z":28.84,"x":-371.3}', '[]', NULL, 1, 1, 0, '{"x":345.3,"y":-995.24,"z":-100.2}', 500000)
14 | ;
15 |
--------------------------------------------------------------------------------
/esx_advancedholdup/README.md:
--------------------------------------------------------------------------------
1 | # About esx_advancedholdup:
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * This has a lot of changes to suit my needs.
6 | * Can pretty much Rob every default Shop, Bank, Etc.
7 |
8 | # Requirements:
9 | * Required:
10 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
11 | * [esx_policejob]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_policejob )
12 | * Optional:
13 | * NONE
14 |
15 | # Download & Installation:
16 | 1) Place `esx_advancedholdup` in your ESX Directory
17 | 2) Add `start esx_advancedholdup` to your server.cfg
18 | 3) Edit the `config.lua` to your liking
19 |
20 | # Credits/Original Code:
21 | * [LuaDeldu]( https://github.com/LuaDeldu )
22 | * [esx_advanced_holdup]( https://github.com/LuaDeldu/esx_advanced_holdup )
23 |
--------------------------------------------------------------------------------
/esx_advancedholdup/client/main.lua:
--------------------------------------------------------------------------------
1 | local HasAlreadyEnteredMarker, isInRobberyZone, isRobberyStarted, isRobberyDone, isPedArmed, loopAlarm = false, false, false, false, false, false
2 | local LastZone, CurrentAction, CurrentActionMsg
3 | local CurrentActionData = {}
4 | local blipRobbery = nil
5 |
6 | RegisterNetEvent('esx:playerLoaded')
7 | AddEventHandler('esx:playerLoaded', function(xPlayer)
8 | ESX.PlayerData = xPlayer
9 | end)
10 |
11 | RegisterNetEvent('esx:setJob')
12 | AddEventHandler('esx:setJob', function(job)
13 | ESX.PlayerData.job = job
14 | end)
15 |
16 | -- Start Robbery Timer
17 | RegisterNetEvent('esx_advancedholdup:startRobTimer')
18 | AddEventHandler('esx_advancedholdup:startRobTimer', function(zone)
19 | isInRobberyZone, isRobberyDone, isRobberyStarted, loopAlarm = true, false, true, true
20 | RobberyZoneEvents(zone)
21 | TriggerEvent('esx_advancedholdup:loopAlarm', zone)
22 |
23 | local timer = Config.Zones[zone].TimeToRob
24 |
25 | CreateThread(function()
26 | while timer > 0 and isInRobberyZone do
27 | Wait(1000)
28 |
29 | if (timer > 0) then
30 | timer = timer - 1
31 | end
32 | end
33 | end)
34 |
35 | CreateThread(function()
36 | while timer > 0 and isInRobberyZone do
37 | Wait(1)
38 | drawTxt(0.85, 0.50, 1.0,1.0,0.4, _U('rob_progress', timer), 255, 255, 255, 255)
39 | end
40 | end)
41 | end)
42 |
43 | -- Robbery Zone Events
44 | function RobberyZoneEvents(zone)
45 | CreateThread(function()
46 | while isInRobberyZone do
47 | Wait(100)
48 | local playerCoords = GetEntityCoords(PlayerPedId())
49 | local zoneTable = Config.Zones[zone]
50 | local distance = #(playerCoords - zoneTable.Coords)
51 |
52 | if distance > zoneTable.AreaSize then
53 | isInRobberyZone = false
54 |
55 | if not isRobberyDone then
56 | PlaySoundFrontend(-1, 'HACKING_FAILURE', 0, 1)
57 | TriggerServerEvent('esx_advancedholdup:robberyCanceled', zone, true)
58 | Wait(1000)
59 | loopAlarm = false
60 | isRobberyStarted = false
61 | end
62 | end
63 | end
64 | end)
65 | end
66 |
67 | -- Robbery Police Notification
68 | RegisterNetEvent('esx_advancedholdup:robPoliceNotif')
69 | AddEventHandler('esx_advancedholdup:robPoliceNotif', function(zone)
70 | PlaySoundFrontend(-1, 'Event_Start_Text', 'GTAO_FM_Events_Soundset', 0)
71 | Wait(1)
72 | ESX.ShowAdvancedNotification(_U('police_alert'), _U('police_alert_alarm_subject'), _U('police_alert_alarm', zone), 'CHAR_CALL911', 1)
73 | end)
74 |
75 | -- Robbery Complete Notification
76 | RegisterNetEvent('esx_advancedholdup:robCompNotif')
77 | AddEventHandler('esx_advancedholdup:robCompNotif', function()
78 | isRobberyDone = true
79 | isRobberyStarted = false
80 | PlaySoundFrontend(-1, 'HACKING_SUCCESS', 0, 1)
81 | ESX.ShowNotification(_U('rob_complete'))
82 | Wait(20000)
83 | loopAlarm = false
84 | end)
85 |
86 | -- Robbery Complete At Notification
87 | RegisterNetEvent('esx_advancedholdup:robCompAtNotif')
88 | AddEventHandler('esx_advancedholdup:robCompAtNotif', function(zone, complete)
89 | PlaySoundFrontend(-1, 'Event_Start_Text', 'GTAO_FM_Events_Soundset', 0)
90 | Wait(1)
91 |
92 | if complete then
93 | ESX.ShowAdvancedNotification(_U('police_alert'), _U('police_alert_complete_subject'), _U('police_alert_complete', zone), 'CHAR_CALL911', 1)
94 | else
95 | ESX.ShowAdvancedNotification(_U('police_alert'), _U('police_alert_cancel_subject'), _U('police_alert_cancel', zone), 'CHAR_CALL911', 1)
96 | end
97 | end)
98 |
99 | -- Loop Alarm
100 | RegisterNetEvent('esx_advancedholdup:loopAlarm')
101 | AddEventHandler('esx_advancedholdup:loopAlarm', function(zone)
102 | while loopAlarm do
103 | PlaySoundFromCoord(-1, 'scanner_alarm_os', Config.Zones[zone].Coords, 'dlc_xm_iaa_player_facility_sounds', 1, 100, 0)
104 | Wait(1000)
105 | end
106 | end)
107 |
108 | -- Create Blip
109 | RegisterNetEvent('esx_advancedholdup:createBlip')
110 | AddEventHandler('esx_advancedholdup:createBlip', function(coords)
111 | blipRobbery = AddBlipForCoord(coords)
112 | SetBlipSprite(blipRobbery, 161)
113 | SetBlipScale(blipRobbery, 2.0)
114 | SetBlipColour(blipRobbery, 1)
115 | PulseBlip(blipRobbery)
116 | end)
117 |
118 | -- Remove Blip
119 | RegisterNetEvent('esx_advancedholdup:removeBlip')
120 | AddEventHandler('esx_advancedholdup:removeBlip', function()
121 | --Wait(20000)
122 | RemoveBlip(blipRobbery)
123 | end)
124 |
125 | -- Entered Marker
126 | AddEventHandler('esx_advancedholdup:hasEnteredMarker', function(zone)
127 | CurrentAction = 'start_robbery'
128 | CurrentActionMsg = _U('press_to_rob')
129 | CurrentActionData = {zone = zone} -- zone = zone
130 | end)
131 |
132 | -- Exited Marker
133 | AddEventHandler('esx_advancedholdup:hasExitedMarker', function(zone)
134 | CurrentAction = nil
135 | end)
136 |
137 | -- Enter / Exit marker events & Draw Markers
138 | CreateThread(function()
139 | while true do
140 | Wait(0)
141 | local playerCoords = GetEntityCoords(PlayerPedId())
142 | local isInMarker, isEnoughPolice, letSleep, currentZone = false, false, true, nil
143 |
144 | if Config.ReqWeapon and IsPedArmed(PlayerPedId(), 4) or Config.ReqWeapon == false then
145 | isPedArmed = true
146 |
147 | for k,v in pairs(Config.Zones) do
148 | local distance = #(playerCoords - v.Coords)
149 |
150 | if distance < Config.DrawDistance then
151 | letSleep = false
152 |
153 | if v.Marker.Type ~= -1 then
154 | DrawMarker(v.Marker.Type, v.Coords, 0.0, 0.0, 0.0, 0, 0.0, 0.0, v.Marker.x, v.Marker.y, v.Marker.z, v.Marker.r, v.Marker.g, v.Marker.b, 100, false, false, 2, false, false, false, false)
155 | end
156 |
157 | if distance < v.Marker.x then
158 | isInMarker, isEnoughPolice, currentZone = true, true, k
159 | end
160 | end
161 | end
162 |
163 | if (isInMarker and not HasAlreadyEnteredMarker and isEnoughPolice) or (isInMarker and LastZone ~= currentZone and isEnoughCops) then
164 | HasAlreadyEnteredMarker, LastZone = true, currentZone
165 | TriggerEvent('esx_advancedholdup:hasEnteredMarker', currentZone)
166 | end
167 | else
168 | isPedArmed = false
169 | end
170 |
171 | if (not isInMarker or not isEnoughPolice or not isPedArmed) and HasAlreadyEnteredMarker then
172 | HasAlreadyEnteredMarker = false
173 | TriggerEvent('esx_advancedholdup:hasExitedMarker', LastZone)
174 | end
175 |
176 | if not isPedArmed or letSleep then
177 | Wait(500)
178 | end
179 | end
180 | end)
181 |
182 | -- Key Controls
183 | CreateThread(function()
184 | while true do
185 | Wait(0)
186 |
187 | if CurrentAction then
188 | ESX.ShowHelpNotification(CurrentActionMsg)
189 |
190 | if IsControlJustReleased(1, 38) and GetLastInputMethod(2) then
191 | if IsPedSittingInAnyVehicle(PlayerPedId()) then
192 | ESX.ShowNotification(_U('rob_vehicle'))
193 | else
194 | if not isRobberyStarted then
195 | if isAuthorized() then
196 | ESX.TriggerServerCallback('esx_advancedholdup:checkRob', function(success)
197 | if success then
198 | local zone = CurrentActionData.zone
199 | TriggerServerEvent('esx_advancedholdup:robInProgress', zone)
200 | else
201 | ESX.ShowNotification(_U('rob_cooldown'))
202 | end
203 | end)
204 | else
205 | ESX.ShowNotification(_U('cant_job'))
206 | end
207 | else
208 | ESX.ShowNotification(_U('rob_in_prog'))
209 | end
210 | end
211 |
212 | CurrentAction = nil
213 | end
214 | else
215 | Wait(500)
216 | end
217 | end
218 | end)
219 |
220 | -- Draw Text
221 | function drawTxt(x, y, width, height, scale, text, r, g, b, a)
222 | SetTextFont(0)
223 | SetTextProportional(0)
224 | SetTextScale(scale, scale)
225 | SetTextColour(r, g, b, a)
226 | SetTextDropShadow(0, 0, 0, 0,255)
227 | SetTextEdge(1, 0, 0, 0, 255)
228 | SetTextDropShadow()
229 | SetTextOutline()
230 | SetTextEntry('STRING')
231 | AddTextComponentString(text)
232 | DrawText(x - width/2, y - height/2 + 0.005)
233 | end
234 |
235 | -- Authorized Jobs
236 | function isAuthorized()
237 | if not ESX or not ESX.PlayerData.job then
238 | return false
239 | end
240 |
241 | for k,job in pairs(Config.AuthorizedJobs) do
242 | if job == ESX.PlayerData.job.name then
243 | return true
244 | end
245 | end
246 |
247 | return false
248 | end
249 |
--------------------------------------------------------------------------------
/esx_advancedholdup/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Advanced Holdup'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | 'server/main.lua'
20 | }
21 |
22 | client_scripts {
23 | 'client/main.lua'
24 | }
25 |
26 | dependencies {
27 | 'es_extended'
28 | }
29 |
--------------------------------------------------------------------------------
/esx_advancedholdup/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | -- Main
3 | ['press_to_rob'] = 'press ~INPUT_CONTEXT~ to ~o~~h~Begin Robbery!~s~',
4 |
5 | -- Robbery Notifications
6 | ['rob_in_prog'] = '~r~A Robbery is already in progress!',
7 | ['rob_started'] = 'You started a Robbery, ~o~DO NOT GO TO FAR!!!~s~',
8 | ['rob_progress'] = 'Robbery in Progress: ~r~%s~s~ Seconds Remaining.',
9 | ['rob_complete'] = '~g~Robbery finished, money picked up.~s~~n~~p~~h~Run little girl!~s~',
10 | ['rob_cancel'] = '~r~You ran away before you managed to open the safe...~s~',
11 | ['rob_already'] = '~o~This store has already been Robbed. ~s~Please Wait ~r~%s~s~ Seconds before Robbing it Again.',
12 | ['rob_vehicle'] = '~r~You can not Rob while being in a Vehicle...~s~',
13 | ['rob_required'] = 'A Minimum of ~b~%s~s~ Policing Officers are required to Rob this location.',
14 | ['rob_cooldown'] = 'There is currently a Cool Down or a Robbery is already in Progress. Come back later.',
15 | ['cant_job'] = 'You are not the Correct Job to start Robberies!',
16 |
17 | -- Police Alerts
18 | ['police_alert'] = 'Police Alert',
19 | ['police_alert_alarm'] = '~b~10-32~s~ : A loud alarm has been triggered at ~y~%s~s~!',
20 | ['police_alert_alarm_subject'] = 'Robbery in Progress!',
21 | ['police_alert_complete'] = '~b~10-32~s~ : A person was seen fleeing the place with hands ~g~full of something~s~ at ~y~%s~s~!',
22 | ['police_alert_complete_subject'] = 'Robbery Finished!',
23 | ['police_alert_cancel'] = '~b~10-32~s~ : A person was seen fleeing the place ~g~empty-handed~s~ at ~y~%s~s~!',
24 | ['police_alert_cancel_subject'] = 'Robbery Canceled!',
25 | }
26 |
--------------------------------------------------------------------------------
/esx_advancedholdup/locales/es.lua:
--------------------------------------------------------------------------------
1 | Locales['es'] = {
2 | -- Main
3 | ['press_to_rob'] = 'Presiona ~INPUT_CONTEXT~ para ~o~~h~Empezar el atraco!~s~',
4 |
5 | -- Robbery Notifications
6 | ['rob_in_prog'] = '~r~Ya hay un atraco en proceso!',
7 | ['rob_started'] = 'Has empezado un Atraco, ~o~NO TE VAYAS MUY LEJOS!!!~s~',
8 | ['rob_progress'] = 'Atraco en Proceso: ~r~%s~s~ Seconds Remaining.',
9 | ['rob_complete'] = '~g~Atraco finalizado, dinero recogido.~s~~n~~p~~h~CORRE!~s~',
10 | ['rob_cancel'] = '~r~Te escapaste antes de que lograras abrir la caja fuerte...~s~',
11 | ['rob_already'] = '~o~Esta tienda ya ha sido atracada. ~s~Por favor, espera ~r~%s~s~ Segundos antes de volver a robarla.',
12 | ['rob_vehicle'] = '~r~No puedes robar mientras estás en un vehículo...~s~',
13 | ['rob_required'] = 'Se requieren un mínimo de ~b~%s~s~ Polícias para atracar en este lugar.',
14 | ['rob_cooldown'] = 'Actualmente hay un enfriamiento o un robo ya está en curso. Vuelve luego.',
15 | ['cant_job'] = 'No eres el trabajo correcto para iniciar robos!',
16 |
17 | -- Police Alerts
18 | ['police_alert'] = 'Alerta Policía',
19 | ['police_alert_alarm'] = '~b~10-32~s~ : Una fuerte alarma ha sido activada en ~y~%s~s~!',
20 | ['police_alert_alarm_subject'] = 'Atraco en progreso!',
21 | ['police_alert_complete'] = '~b~10-32~s~ : Se vió a una persona huyendo del lugar con las manos ~g~llenas de algo~s~ en ~y~%s~s~!',
22 | ['police_alert_complete_subject'] = 'Atraco finalizado!',
23 | ['police_alert_cancel'] = '~b~10-32~s~ : Se vió a una persona huyendo del lugar con las manos ~g~vacías~s~ en ~y~%s~s~!',
24 | ['police_alert_cancel_subject'] = 'Atraco cancelado!',
25 | }
26 |
--------------------------------------------------------------------------------
/esx_advancedholdup/server/main.lua:
--------------------------------------------------------------------------------
1 | local robberyPlayers = {}
2 | local isCurrentRobbery, coolDown = false, false
3 |
4 | -- Count Police
5 | ESX.RegisterServerCallback('esx_advancedholdup:checkPolice', function(source, cb, reqPolice)
6 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
7 |
8 | if #xPlayers >= reqPolice then
9 | cb(true)
10 | else
11 | cb(false)
12 | end
13 | end)
14 |
15 | -- Add Command to Start Timer
16 | ESX.RegisterCommand('robstart', 'admin', function(xPlayer, args, showError)
17 | TriggerEvent('esx_advancedholdup:startTimer')
18 | end, false, {help = 'Start Robbery Timer'})
19 |
20 | -- Add Command to Reset Timer
21 | ESX.RegisterCommand('robreset', 'admin', function(xPlayer, args, showError)
22 | TriggerEvent('esx_advancedholdup:resetTimer')
23 | end, false, {help = 'Reset Robbery Timer'})
24 |
25 | -- See if there is an On Going Robbery & Cool Down has Ended
26 | ESX.RegisterServerCallback('esx_advancedholdup:checkRob', function(source, cb)
27 | if isCurrentRobbery == false and coolDown == false then
28 | cb(true)
29 | else
30 | cb(false)
31 | end
32 | end)
33 |
34 | -- Start Cool Down Timer
35 | RegisterServerEvent('esx_advancedholdup:startTimer')
36 | AddEventHandler('esx_advancedholdup:startTimer', function()
37 | coolDown = true
38 | SetTimeout((Config.CoolDown*60)*1000, function()
39 | coolDown = false
40 | end)
41 | end)
42 |
43 | -- Reset Timer
44 | RegisterServerEvent('esx_advancedholdup:resetTimer')
45 | AddEventHandler('esx_advancedholdup:resetTimer', function()
46 | coolDown = false
47 | end)
48 |
49 | -- Robbery Canceled
50 | RegisterServerEvent('esx_advancedholdup:robberyCanceled')
51 | AddEventHandler('esx_advancedholdup:robberyCanceled', function(zone)
52 | local _source = source
53 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
54 | isCurrentRobbery = false
55 |
56 | for _, xPlayer in pairs(xPlayers) do
57 | TriggerClientEvent('esx_advancedholdup:robCompAtNotif', xPlayer.source, zone, false)
58 | TriggerClientEvent('esx_advancedholdup:removeBlip', xPlayer.source)
59 | end
60 |
61 | if robberyPlayers[source] then
62 | local xPlayer = ESX.GetPlayerFromId(_source)
63 | robberyPlayers[source] = nil
64 | xPlayer.showNotification(_U('rob_cancel'))
65 | end
66 | end)
67 |
68 | -- Robbery in Progress
69 | RegisterServerEvent('esx_advancedholdup:robInProgress')
70 | AddEventHandler('esx_advancedholdup:robInProgress', function(mainZone)
71 | local _source = source
72 | local xPlayer = ESX.GetPlayerFromId(_source)
73 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
74 |
75 | if Config.Zones[mainZone] then
76 | local zone = Config.Zones[mainZone]
77 |
78 | if isCurrentRobbery == false then
79 | if zone.Robbed ~= 0 and (os.time() - zone.Robbed) < zone.TimeBeforeNewRob then
80 | local timerNewRob = zone.TimeBeforeNewRob - (os.time() - zone.Robbed)
81 | xPlayer.showNotification(_U('rob_already', timerNewRob))
82 | return
83 | else
84 | if #xPlayers < zone.PoliceRequired then
85 | xPlayer.showNotification(_U('rob_required', zone.PoliceRequired))
86 | return
87 | end
88 | end
89 |
90 | isCurrentRobbery = true
91 | for _, xPlayer in pairs(xPlayers) do
92 | TriggerClientEvent('esx_advancedholdup:robPoliceNotif', xPlayer.source, mainZone)
93 | TriggerClientEvent('esx_advancedholdup:createBlip', xPlayer.source, Config.Zones[mainZone].Coords)
94 | end
95 |
96 | xPlayer.showNotification(_U('rob_started'))
97 | TriggerClientEvent('esx_advancedholdup:startRobTimer', source, mainZone)
98 | TriggerEvent('esx_advancedholdup:startTimer')
99 |
100 | Config.Zones[mainZone].Robbed = os.time()
101 | robberyPlayers[source] = mainZone
102 | local savedSource = source
103 |
104 | SetTimeout(zone.TimeToRob * 1000, function()
105 | if robberyPlayers[savedSource] then
106 | isCurrentRobbery = false
107 | if xPlayer then
108 | xPlayer.addAccountMoney('black_money', zone.Reward)
109 | TriggerClientEvent('esx_advancedholdup:robCompNotif', xPlayer.source)
110 |
111 | for _, xPlayer in pairs(xPlayers) do
112 | TriggerClientEvent('esx_advancedholdup:robCompAtNotif', xPlayer.source, robberyPlayers[savedSource], true)
113 | TriggerClientEvent('esx_advancedholdup:removeBlip', xPlayer.source)
114 | end
115 | end
116 | end
117 | end)
118 | else
119 | xPlayer.showNotification(_U('rob_in_prog'))
120 | end
121 | end
122 | end)
123 |
124 | -- Start Timer
125 | AddEventHandler('onResourceStart', function(resource)
126 | if resource == GetCurrentResourceName() then
127 | if Config.StartTimer then
128 | TriggerEvent('esx_advancedholdup:startTimer')
129 | return
130 | end
131 | end
132 | end)
133 |
--------------------------------------------------------------------------------
/esx_advancedhospital/README.md:
--------------------------------------------------------------------------------
1 | # esx_advancedhospital:
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * This is a Combination of Both my esx_hospital & esx_plasticsurgery.
6 | * Players can pay to get Healed or pay to change the looks of their character.
7 |
8 | # Requirements:
9 | * Required:
10 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
11 | * [esx_skin]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx%5D/esx_skin )
12 | * [skinchanger]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx%5D/skinchanger )
13 | * Optional:
14 | * NONE
15 |
16 | # Download & Installation:
17 | 1) Place `esx_advancedhospital` in your ESX Directory
18 | 2) Add `start esx_advancedhospital` to your server.cfg
19 | 3) Edit the `config.lua` to your liking
20 |
21 | # Credits/Original Code:
22 | * [DDH3]( https://github.com/ddh3 )
23 | * [esx_hospital]( https://github.com/ddh3/esx_hospital )
24 |
--------------------------------------------------------------------------------
/esx_advancedhospital/client/main.lua:
--------------------------------------------------------------------------------
1 | local HasAlreadyEnteredMarker, IsInMainMenu = false, false
2 | local LastZone, CurrentAction, CurrentActionMsg
3 |
4 | -- Open Surgery Menu
5 | function OpenSurgeryMenu()
6 | local playerPed = PlayerPedId()
7 | IsInMainMenu = true
8 |
9 | TriggerEvent('esx_skin:openRestrictedMenu', function(data, menu) -- Not 100% sure what the difference is between openSaveableMenu & openRestrictedMenu
10 | menu.close()
11 | FreezeEntityPosition(playerPed, true)
12 |
13 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'surgery_confirm', {
14 | title = _U('buy_surgery', ESX.Math.GroupDigits(Config.SurgeryPrice)),
15 | align = GetConvar('esx_MenuAlign', 'top-left'),
16 | elements = {
17 | {label = _U('no'), value = 'no'},
18 | {label = _U('yes'), value = 'yes'}
19 | }}, function(data, menu)
20 | menu.close()
21 |
22 | if data.current.value == 'yes' then
23 | ESX.TriggerServerCallback('esx_advancedhospital:paySurgery', function(success)
24 | if success then
25 | TriggerEvent('skinchanger:getSkin', function(skin)
26 | TriggerServerEvent('esx_skin:save', skin)
27 | end)
28 |
29 | IsInMainMenu = false
30 | FreezeEntityPosition(playerPed, false)
31 | menu.close()
32 | else
33 | ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
34 | TriggerEvent('skinchanger:loadSkin', skin)
35 | end)
36 |
37 | ESX.ShowNotification(_U('not_enough_money'))
38 | IsInMainMenu = false
39 | FreezeEntityPosition(playerPed, false)
40 | menu.close()
41 | end
42 | end)
43 | else
44 | ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
45 | TriggerEvent('skinchanger:loadSkin', skin)
46 | end)
47 |
48 | IsInMainMenu = false
49 | FreezeEntityPosition(playerPed, false)
50 | menu.close()
51 | end
52 | end, function(data, menu)
53 | IsInMainMenu = false
54 | FreezeEntityPosition(playerPed, false)
55 | menu.close()
56 | CurrentAction = 'surgery_menu'
57 | end)
58 | end, function(data, menu)
59 | IsInMainMenu = false
60 | FreezeEntityPosition(playerPed, false)
61 | menu.close()
62 | CurrentAction = 'surgery_menu'
63 | end, {
64 | 'sex', 'face', 'skin', 'age_1', 'age_2', 'beard_1', 'beard_2', 'beard_3', 'beard_4', 'hair_1', 'hair_2', 'hair_color_1', 'hair_color_2',
65 | 'eye_color', 'eyebrows_1', 'eyebrows_2', 'eyebrows_3', 'eyebrows_4', 'makeup_1', 'makeup_2', 'makeup_3', 'makeup_4', 'lipstick_1',
66 | 'lipstick_2', 'lipstick_3', 'lipstick_4', 'blemishes_1', 'blemishes_2', 'blush_1', 'blush_2', 'blush_3', 'complexion_1', 'complexion_2',
67 | 'sun_1', 'sun_2', 'moles_1', 'moles_2', 'chest_1', 'chest_2', 'chest_3', 'bodyb_1', 'bodyb_2'
68 | --'tshirt_1', 'tshirt_2', 'torso_1', 'torso_2', 'decals_1', 'decals_2', 'arms', 'arms_2', 'pants_1', 'pants_2', 'shoes_1', 'shoes_2'
69 | })
70 | end
71 |
72 | -- Entered Marker
73 | AddEventHandler('esx_advancedhospital:hasEnteredMarker', function(zone)
74 | if zone == 'HealingLocations' then
75 | CurrentAction = 'healing_menu'
76 | CurrentActionMsg = _U('healing_menu', ESX.Math.GroupDigits(Config.HealingPrice))
77 | elseif zone == 'SurgeryLocations' then
78 | CurrentAction = 'surgery_menu'
79 | CurrentActionMsg = _U('surgery_menu', ESX.Math.GroupDigits(Config.SurgeryPrice))
80 | end
81 | end)
82 |
83 | -- Exited Marker
84 | AddEventHandler('esx_advancedhospital:hasExitedMarker', function(zone)
85 | if not IsInMainMenu or IsInMainMenu then
86 | ESX.UI.Menu.CloseAll()
87 | end
88 |
89 | CurrentAction = nil
90 | end)
91 |
92 | -- Resource Stop
93 | AddEventHandler('onResourceStop', function(resource)
94 | if resource == GetCurrentResourceName() then
95 | if IsInMainMenu then
96 | ESX.UI.Menu.CloseAll()
97 | end
98 | end
99 | end)
100 |
101 | -- Create Blips
102 | CreateThread(function()
103 | if Config.UseHospital and Config.UseHospitalBlips then
104 | for k,v in pairs(Config.Locations) do
105 | for i=1, #v.Healer, 1 do
106 | local blip = AddBlipForCoord(v.Healer[i])
107 |
108 | SetBlipSprite (blip, Config.BlipHospital.Sprite)
109 | SetBlipColour (blip, Config.BlipHospital.Color)
110 | SetBlipDisplay(blip, Config.BlipHospital.Display)
111 | SetBlipScale (blip, Config.BlipHospital.Scale)
112 | SetBlipAsShortRange(blip, true)
113 |
114 | BeginTextCommandSetBlipName('STRING')
115 | AddTextComponentSubstringPlayerName(_U('healing_blip'))
116 | EndTextCommandSetBlipName(blip)
117 | end
118 | end
119 | end
120 |
121 | if Config.UseSurgeon and Config.UseSurgeonBlips then
122 | for k,v in pairs(Config.Locations) do
123 | for i=1, #v.Surgery, 1 do
124 | local blip = AddBlipForCoord(v.Surgery[i])
125 |
126 | SetBlipSprite (blip, Config.BlipSurgery.Sprite)
127 | SetBlipColour (blip, Config.BlipSurgery.Color)
128 | SetBlipDisplay(blip, Config.BlipSurgery.Display)
129 | SetBlipScale (blip, Config.BlipSurgery.Scale)
130 | SetBlipAsShortRange(blip, true)
131 |
132 | BeginTextCommandSetBlipName('STRING')
133 | AddTextComponentSubstringPlayerName(_U('surgery_blip'))
134 | EndTextCommandSetBlipName(blip)
135 | end
136 | end
137 | end
138 | end)
139 |
140 | -- Enter / Exit marker events & Draw Markers
141 | CreateThread(function()
142 | while true do
143 | Wait(0)
144 | local playerCoords = GetEntityCoords(PlayerPedId())
145 | local isInMarker, letSleep, currentZone = false, true, nil
146 |
147 | if Config.UseHospital then
148 | for k,v in pairs(Config.Locations) do
149 | for i=1, #v.Healer, 1 do
150 | local distance = #(playerCoords - v.Healer[i])
151 |
152 | if distance < Config.DrawDistance then
153 | letSleep = false
154 |
155 | if Config.HospMarker.Type ~= -1 then
156 | DrawMarker(Config.HospMarker.Type, v.Healer[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.HospMarker.x, Config.HospMarker.y, Config.HospMarker.z, Config.HospMarker.r, Config.HospMarker.g, Config.HospMarker.b, 100, false, true, 2, false, nil, nil, false)
157 | end
158 |
159 | if distance < Config.HospMarker.x then
160 | isInMarker, currentZone = true, 'HealingLocations'
161 | end
162 | end
163 | end
164 | end
165 | end
166 |
167 | if Config.UseSurgeon then
168 | for k,v in pairs(Config.Locations) do
169 | for i=1, #v.Surgery, 1 do
170 | local distance = #(playerCoords - v.Surgery[i])
171 |
172 | if distance < Config.DrawDistance then
173 | letSleep = false
174 |
175 | if Config.SurgMarker.Type ~= -1 then
176 | DrawMarker(Config.SurgMarker.Type, v.Surgery[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.SurgMarker.x, Config.SurgMarker.y, Config.SurgMarker.z, Config.SurgMarker.r, Config.SurgMarker.g, Config.SurgMarker.b, 100, false, true, 2, false, nil, nil, false)
177 | end
178 |
179 | if distance < Config.SurgMarker.x then
180 | isInMarker, currentZone = true, 'SurgeryLocations'
181 | end
182 | end
183 | end
184 | end
185 | end
186 |
187 | if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then
188 | HasAlreadyEnteredMarker, LastZone = true, currentZone
189 | LastZone = currentZone
190 | TriggerEvent('esx_advancedhospital:hasEnteredMarker', currentZone)
191 | end
192 |
193 | if not isInMarker and HasAlreadyEnteredMarker then
194 | HasAlreadyEnteredMarker = false
195 | TriggerEvent('esx_advancedhospital:hasExitedMarker', LastZone)
196 | end
197 |
198 | if letSleep then
199 | Wait(500)
200 | end
201 | end
202 | end)
203 |
204 | -- Key Controls
205 | CreateThread(function()
206 | while true do
207 | Wait(0)
208 |
209 | if CurrentAction then
210 | ESX.ShowHelpNotification(CurrentActionMsg)
211 |
212 | if IsControlJustReleased(0, 38) then
213 | if CurrentAction == 'healing_menu' then
214 | ESX.TriggerServerCallback('esx_advancedhospital:checkMedic', function(success)
215 | if success then
216 | ESX.ShowNotification(_U('medic_online'))
217 | else
218 | ESX.TriggerServerCallback('esx_advancedhospital:payHealing', function(success)
219 | if success then
220 | SetEntityHealth(GetPlayerPed(-1), 200)
221 | else
222 | ESX.ShowNotification(_U('not_enough_money'))
223 | end
224 | end)
225 | end
226 | end)
227 | elseif CurrentAction == 'surgery_menu' then
228 | OpenSurgeryMenu()
229 | end
230 |
231 | CurrentAction = nil
232 | end
233 | else
234 | Wait(500)
235 | end
236 | end
237 | end)
238 |
239 | -- Export
240 | function getESXAdvancedHospital(type)
241 | if type == 'healingP' then
242 | return ESX.Math.GroupDigits(Config.HealingPrice)
243 | elseif type == 'surgeryP' then
244 | return ESX.Math.GroupDigits(Config.SurgeryPrice)
245 | end
246 | end
247 |
248 | function openESXAdvancedHospital(type)
249 | if type == 'healing' then
250 | ESX.TriggerServerCallback('esx_advancedhospital:checkMedic', function(success)
251 | if success then
252 | ESX.ShowNotification(_U('medic_online'))
253 | else
254 | ESX.TriggerServerCallback('esx_advancedhospital:payHealing', function(success)
255 | if success then
256 | SetEntityHealth(GetPlayerPed(-1), 200)
257 | else
258 | ESX.ShowNotification(_U('not_enough_money'))
259 | end
260 | end)
261 | end
262 | end)
263 | elseif type == 'revive' then
264 | ESX.TriggerServerCallback('esx_advancedhospital:checkMedic', function(success)
265 | if success then
266 | ESX.ShowNotification(_U('medic_online'))
267 | else
268 | ESX.TriggerServerCallback('esx_advancedhospital:payRevive', function(success)
269 | if not success then
270 | ESX.ShowNotification(_U('not_enough_money'))
271 | end
272 | end)
273 | end
274 | end)
275 | elseif type == 'surgery' then
276 | OpenSurgeryMenu()
277 | end
278 | end
279 |
--------------------------------------------------------------------------------
/esx_advancedhospital/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 |
4 | Config.DrawDistance = 10 -- Marker Draw Distance.
5 | Config.MedicRequired = 2 -- Amount of Medics online to prevent Healers.
6 |
7 | Config.HospMarker = {Type = 1, r = 102, g = 102, b = 204, x = 1.5, y = 1.5, z = 1.0} -- Hospital Marker Settings.
8 | Config.BlipHospital = {Sprite = 403, Color = 2, Display = 2, Scale = 1.0} -- Hospital Blip Settings.
9 | Config.SurgMarker = {Type = 1, r = 102, g = 102, b = 204, x = 1.5, y = 1.5, z = 1.0} -- Surgery Marker Settings.
10 | Config.BlipSurgery = {Sprite = 403, Color = 0, Display = 2, Scale = 1.0} -- Surgery Blip Settings.
11 |
12 | Config.VIPScript = false -- true = Running a VIP Script. You must setup Script to Work with this Script.
13 |
14 | Config.UseHospital = false -- true = Allows Players to Heal Themselves.
15 | Config.UseHospitalBlips = false -- true = Use Hospital Blips.
16 | Config.HealingPrice = 100 -- Healing Price.
17 | Config.HealingDiscount = 75 -- Healing Discount Price.
18 |
19 | Config.RevivePrice = 750 -- Revive Price.
20 | Config.ReviveDiscount = 562 -- Revive Discount Price.
21 |
22 | Config.UseSurgeon = false -- true = Allows Players to edit their Character.
23 | Config.UseSurgeonBlips = false -- true = Use Surgery Blips.
24 | Config.SurgeryPrice = 3700 -- Surgery Price.
25 | Config.SurgeryDiscount = 2775 -- Surgery Discount Price.
26 |
27 | Config.Locations = {
28 | Locs = {
29 | Healer = {
30 | vector3(265.8, -1355.6, 23.5), -- esx_ambulancejob Inside
31 | vector3(338.8, -1394.5, 31.5), -- Los Santos Central
32 | vector3(-449.6, -340.8, 33.5), -- Los Santos Mount Zonah
33 | vector3(-874.7, -307.5, 38.5), -- Los Santos Portola Trinity
34 | vector3(298.7, -584.6, 42.2), -- Los Santos Pillbox Hill Top
35 | vector3(1829.2, 3667.1, 33.2), -- Sandy Shores Medical Center
36 | vector3(-240.3, 6324.1, 31.4), -- Paleto Bay Medical Center
37 | },
38 | Surgery = {
39 | vector3(260.3, -1343.6, 23.5), -- esx_ambulancejob Inside
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/esx_advancedhospital/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Advanced Hospital'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@oxmysql/lib/MySQL.lua',
20 | 'server/main.lua'
21 | }
22 |
23 | client_scripts {
24 | 'client/main.lua'
25 | }
26 |
27 | exports {
28 | 'getESXAdvancedHospital',
29 | 'openESXAdvancedHospital'
30 | }
31 |
32 | dependencies {
33 | 'es_extended'
34 | }
35 |
--------------------------------------------------------------------------------
/esx_advancedhospital/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | -- Shared
3 | ['no'] = 'no',
4 | ['yes'] = 'yes',
5 | ['not_enough_money'] = 'You do not have enough money',
6 |
7 | -- Healing
8 | ['healing_menu'] = 'press ~INPUT_CONTEXT~ to be Healed for ~r~(~h~~g~$%s~r~)',
9 | ['healing_blip'] = 'Medic',
10 | ['medic_online'] = 'There are Medics online. Please ask for help from them.',
11 | ['healing_paid'] = 'You Paid ~g~$%s~s~ to Heal Yourself.',
12 |
13 | -- Reviving
14 | ['revive_paid'] = 'You Paid ~g~$%s~s~ to Revive Yourself.',
15 |
16 | -- Surgery
17 | ['surgery_menu'] = 'press ~INPUT_CONTEXT~ to be get Surgery for ~r~(~h~~g~$%s~r~)',
18 | ['buy_surgery'] = 'Do you want to get Surgery done for $%s?',
19 | ['surgery_blip'] = 'Surgeon',
20 | ['surgery_paid'] = 'You Paid ~g~$%s~s~ to get Surgery.',
21 | }
22 |
--------------------------------------------------------------------------------
/esx_advancedhospital/locales/sv.lua:
--------------------------------------------------------------------------------
1 | Locales['sv'] = {
2 | -- Shared
3 | ['no'] = 'Nej',
4 | ['yes'] = 'Ja',
5 | ['not_enough_money'] = 'Du har inte tillräckligt med pengar',
6 |
7 | -- Healing
8 | ['healing_menu'] = 'Tryck ~INPUT_CONTEXT~ för att bli behandlad ~r~(~h~~g~$100~r~)',
9 | ['buy_health'] = 'Vill du bli upplivad för $%s?',
10 | ['healing_blip'] = 'Sjukvård',
11 |
12 | -- Surgery
13 | ['surgery_menu'] = 'Tryck ~INPUT_CONTEXT~ för att få en operation för ~r~(~h~~g~$3,700~r~)',
14 | ['buy_surgery'] = 'Vill du att operationen ska bli klar för $%s?',
15 | ['surgery_blip'] = 'Doktor',
16 | }
17 |
--------------------------------------------------------------------------------
/esx_advancedhospital/server/main.lua:
--------------------------------------------------------------------------------
1 | -- Count Medics
2 | ESX.RegisterServerCallback('esx_advancedhospital:checkMedic', function(source, cb)
3 | local xPlayers = ESX.GetExtendedPlayers('job', 'ambulance')
4 |
5 | if #xPlayers >= Config.MedicRequired then
6 | cb(true)
7 | else
8 | cb(false)
9 | end
10 | end)
11 |
12 | -- Pay for Healing
13 | ESX.RegisterServerCallback('esx_advancedhospital:payHealing', function(source, cb)
14 | local xPlayer = ESX.GetPlayerFromId(source)
15 | local price = Config.HealingPrice
16 |
17 | if xPlayer.getMoney() >= price then
18 | xPlayer.removeMoney(price)
19 |
20 | TriggerEvent('esx_addonaccount:getSharedAccount', 'society_ambulance', function(account)
21 | account.addMoney(price)
22 | end)
23 | xPlayer.showNotification(_U('healing_paid', ESX.Math.GroupDigits(price)))
24 |
25 | cb(true)
26 | else
27 | cb(false)
28 | end
29 | end)
30 |
31 | -- Pay for Revive
32 | ESX.RegisterServerCallback('esx_advancedhospital:payRevive', function(source, cb)
33 | local xPlayer = ESX.GetPlayerFromId(source)
34 | local price = Config.RevivePrice
35 |
36 | if xPlayer.getMoney() >= price then
37 | xPlayer.removeMoney(price)
38 |
39 | TriggerEvent('esx_addonaccount:getSharedAccount', 'society_ambulance', function(account)
40 | account.addMoney(price)
41 | end)
42 | xPlayer.showNotification(_U('revive_paid', ESX.Math.GroupDigits(price)))
43 | xPlayer.triggerEvent('esx_ambulancejob:revive')
44 |
45 | cb(true)
46 | else
47 | cb(false)
48 | end
49 | end)
50 |
51 | -- Pay for Surgery
52 | ESX.RegisterServerCallback('esx_advancedhospital:paySurgery', function(source, cb)
53 | local xPlayer = ESX.GetPlayerFromId(source)
54 | local price = Config.SurgeryPrice
55 |
56 | if xPlayer.getMoney() >= price then
57 | xPlayer.removeMoney(price)
58 |
59 | TriggerEvent('esx_addonaccount:getSharedAccount', 'society_ambulance', function(account)
60 | account.addMoney(price)
61 | end)
62 | xPlayer.showNotification(_U('surgery_paid', ESX.Math.GroupDigits(price)))
63 |
64 | cb(true)
65 | else
66 | cb(false)
67 | end
68 | end)
69 |
--------------------------------------------------------------------------------
/esx_advancedjail/README.md:
--------------------------------------------------------------------------------
1 | # About esx_advancedjail:
2 | Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * Allows police to Jail Players in Multiple Locations
6 | * Players can Escape if you set it in the config.lua
7 | * Players can Change into/out of Prison Clothing
8 |
9 | # Requirements:
10 | * Required:
11 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
12 | * [esx_policejob]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_policejob )
13 | * Optional:
14 | * NONE
15 |
16 | # Download & Installation:
17 | 1) Import the `esx_advancedjail.sql` into your database.
18 | 2) Place `esx_advancedjail` in your ESX Directory
19 | 3) Add `start esx_advancedjail` to your server.cfg
20 | 4) Edit the `config.lua` to your liking
21 | 5) Follow `esx_policejob_add.lua` to add the Jail to esx_policejob
22 |
--------------------------------------------------------------------------------
/esx_advancedjail/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 |
4 | Config.DrawDistance = 10 -- Marker Draw Distance.
5 | Config.MarkerInfo = {Type = 27, r = 100, g = 100, b = 204, x = 1.5, y = 1.5, z = 2.0} -- Marker Settings.
6 | Config.Sync = 1 -- Jail Time Sync Interval in Seconds.
7 |
8 | Config.AllowEscape = false -- true = Allows Players to Escape Jail & will notify Police.
9 | Config.OnlyFirstname = false -- true = Will only show 1st Name if someone tries to Escape.
10 |
11 | Config.RemoveLoadout = false -- true = Will Remove Players Loadout when Jailed & UnJailed.
12 | Config.RemoveInventory = false -- true = Will Remove Players Inventory when Jailed & UnJailed.
13 | Config.RemoveDirtyMoney = false -- true = Will Remove Players Dirty Money when Jailed & UnJailed.
14 |
15 | Config.GiveFoodDrink = false -- true = Will Give Players Food & Drinks while in Jail & when they are Released.
16 | Config.FoodItem = 'bread' -- Food Item to Give.
17 | Config.FoodAmount = 5 -- Amount of Food to Give.
18 | Config.DrinkItem = 'water' -- Drink Item to Give.
19 | Config.DrinkAmount = 5 -- Amount of Water to Give.
20 |
21 | -- DrawMarkers | Use only if you want to see a Marker around Jail Positions
22 | Config.DM = {
23 | Show = false, -- Master Toggle
24 | LSMR0 = true, -- Los Santos Mission Row | UnJail Marker
25 | LSMR1 = true, -- Los Santos Mission Row | Jail Marker 1
26 | LSMR2 = true, -- Los Santos Mission Row | Jail Marker 2
27 | LSMR3 = true, -- Los Santos Mission Row | Jail Marker 3
28 | LSMR4 = true, -- Los Santos Mission Row | Jail Marker 4
29 | SSSD0 = true, -- Sandy Shores Sheriffs Dept | UnJail Marker
30 | SSSD1 = true, -- Sandy Shores Sheriffs Dept | Jail Marker 1
31 | SSSD2 = true, -- Sandy Shores Sheriffs Dept | Jail Marker 2
32 | PBSD0 = true, -- Paleto Bay Sheriffs Dept | UnJail Marker
33 | PBSD1 = true, -- Paleto Bay Sheriffs Dept | Jail Marker 1
34 | PBSD2 = true, -- Paleto Bay Sheriffs Dept | Jail Marker 2
35 | SSBP0 = true, -- Sandy Shores Bolingbroke Penitentiary | UnJail Marker
36 | SSBP1 = true -- Sandy Shores Bolingbroke Penitentiary | Jail Marker
37 | }
38 |
39 | -- Jail Locations
40 | Config.JL = {
41 | LSMR0 = vector3(438.05, -982.90, 29.69), -- Los Santos Mission Row | UnJail Coords
42 | LSMR1 = vector3(460.18, -994.38, 23.91), -- Los Santos Mission Row | Jail Cell 1 Coords
43 | LSMR2 = vector3(459.22, -997.97, 23.91), -- Los Santos Mission Row | Jail Cell 2 Coords
44 | LSMR3 = vector3(459.40, -1001.52, 23.91), -- Los Santos Mission Row | Jail Cell 3 Coords
45 | --LSMR4 = vector3(0.0, 0.0, 0.0), -- Los Santos Mission Row | Jail Cell 4 Coords
46 | --SSSD0 = vector3(0.0, 0.0, 0.0), -- Sandy Shores Sheriffs Dept | UnJail Coords
47 | --SSSD1 = vector3(0.0, 0.0, 0.0), -- Sandy Shores Sheriffs Dept | Jail Cell 1 Coords
48 | --SSSD2 = vector3(0.0, 0.0, 0.0), -- Sandy Shores Sheriffs Dept | Jail Cell 2 Coords
49 | --PBSD0 = vector3(0.0, 0.0, 0.0), -- Paleto Bay Sheriffs Dept | UnJail Coords
50 | --PBSD1 = vector3(0.0, 0.0, 0.0), -- Paleto Bay Sheriffs Dept | Jail Cell 1 Coords
51 | --PBSD2 = vector3(0.0, 0.0, 0.0), -- Paleto Bay Sheriffs Dept | Jail Cell 2 Coords
52 | SSBP0 = vector3(1848.85, 2585.7, 44.67), -- Sandy Shores Bolingbroke Penitentiary | UnJail Coords
53 | SSBP1 = vector3(1641.6, 2571.0, 45.5) -- Sandy Shores Bolingbroke Penitentiary | Jail Coords
54 | }
55 |
56 | -- 3D Text Locations
57 | Config.TL = {
58 | Show = false, -- Master Toggle of 3D Text.
59 | ShowLSMR = false, -- Show Los Santos Mission Row 3D Text.
60 | LSMR0 = {x = 463.8985, y = -998.0825, z = 23.95, d = 5.0}, -- Los Santos Mission Row | Center of Room
61 | LSMR1 = {x = 461.8, y = -993.3, z = 25.0 -1.400, text = 'Cell 1'}, -- Los Santos Mission Row | Jail Cell 1
62 | LSMR2 = {x = 461.8, y = -998.8, z = 25.0 -1.400, text = 'Cell 2'}, -- Los Santos Mission Row | Jail Cell 2
63 | LSMR3 = {x = 461.8, y = -1002.4, z = 25.0 -1.400, text = 'Cell 3'}, -- Los Santos Mission Row | Jail Cell 3
64 | LSMR4 = {x = 0.0, y = 0.0, z = 0.0, text = 'Cell 4'}, -- Los Santos Mission Row | Jail Cell 4
65 | ShowSSSD = false, -- Show Los Santos Mission Row 3D Text.
66 | SSSD0 = {x = 0.0, y = 0.0, z = 0.0, d = 5.0}, -- Sandy Shores Sheriffs Dept | Center of Room
67 | SSSD1 = {x = 0.0, y = 0.0, z = 0.0, text = 'Cell 1'}, -- Sandy Shores Sheriffs Dept | Jail Cell 1
68 | SSSD2 = {x = 0.0, y = 0.0, z = 0.0, text = 'Cell 2'}, -- Sandy Shores Sheriffs Dept | Jail Cell 2
69 | ShowPBSD = false, -- Show Los Santos Mission Row 3D Text.
70 | PBSD0 = {x = 0.0, y = 0.0, z = 0.0, d = 5.0}, -- Paleto Bay Sheriffs Dept | Center of Room
71 | PBSD1 = {x = 0.0, y = 0.0, z = 0.0, text = 'Cell 1'}, -- Paleto Bay Sheriffs Dept | Jail Cell 1
72 | PBSD2 = {x = 0.0, y = 0.0, z = 0.0, text = 'Cell 2'} -- Paleto Bay Sheriffs Dept | Jail Cell 2
73 | }
74 |
75 | -- Clothing Locations
76 | Config.Zones = {
77 | vector3(463.89, -998.08, 23.95), -- Los Santos Mission
78 | vector3(1850.51, 2586.14, 44.67) -- Sandy Shores Bolingbroke Penitentiary
79 | }
80 |
81 | Config.Uniforms = {
82 | prison_wear = {
83 | male = {
84 | tshirt_1 = 15, tshirt_2 = 0,
85 | torso_1 = 146, torso_2 = 0,
86 | decals_1 = 0, decals_2 = 0,
87 | arms = 0, arms_2 = 0,
88 | pants_1 = 3, pants_2 = 7,
89 | shoes_1 = 12, shoes_2 = 12,
90 | mask_1 = 0, mask_2 = 0,
91 | bproof_1 = 0, bproof_2 = 0,
92 | chain_1 = 0, chain_2 = 0,
93 | helmet_1 = -1, helmet_2 = 0,
94 | glasses_1 = -1, glasses_2 = 0,
95 | watches_1 = -1, watches_2 = 0,
96 | bracelets_1 = -1, bracelets_2 = 0,
97 | bags_1 = 0, bags_2 = 0,
98 | ears_1 = -1, ears_2 = 0
99 | },
100 | female = {
101 | tshirt_1 = 3, tshirt_2 = 0,
102 | torso_1 = 38, torso_2 = 3,
103 | decals_1 = 0, decals_2 = 0,
104 | arms = 2, arms_2 = 0,
105 | pants_1 = 3, pants_2 = 15,
106 | shoes_1 = 66, shoes_2 = 5,
107 | mask_1 = 0, mask_2 = 0,
108 | bproof_1 = 0, bproof_2 = 0,
109 | chain_1 = 0, chain_2 = 0,
110 | helmet_1 = -1, helmet_2 = 0,
111 | glasses_1 = -1, glasses_2 = 0,
112 | watches_1 = -1, watches_2 = 0,
113 | bracelets_1 = -1, bracelets_2 = 0,
114 | bags_1 = 0, bags_2 = 0,
115 | ears_1 = -1, ears_2 = 0
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/esx_advancedjail/esx_advancedjail.sql:
--------------------------------------------------------------------------------
1 | USE `es_extended`;
2 |
3 | ALTER TABLE `users` ADD COLUMN `jail_time` INT(11) NOT NULL DEFAULT 0;
4 | ALTER TABLE `users` ADD COLUMN `jail_loc` VARCHAR(5) DEFAULT NULL;
5 |
--------------------------------------------------------------------------------
/esx_advancedjail/esx_policejob_add.lua:
--------------------------------------------------------------------------------
1 | -- Step 1: Go to en.lua and add Lines 17-33 to esx_policejob/locales/en.lua
2 |
3 | -- In order for this to work you must add the following to esx_policejob/client/main.lua
4 | -- Step 2: Add this to the bottom of the citizen_interaction in the elements
5 | -- Note: Make sure you have commas in the correct spot
6 | {label = _U('jail'), value = 'jail'},
7 |
8 | -- Step 3: Add this after unpaid_bills
9 | elseif action == 'jail' then
10 | JailMenu(GetPlayerServerId(closestPlayer))
11 |
12 | -- Step 4: Add this at the end of the file
13 | function JailMenu(player)
14 | ESX.UI.Menu.CloseAll()
15 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'jailmenu', {
16 | title = _U('jail_menu'),
17 | align = GetConvar('esx_MenuAlign', 'top-left'),
18 | elements = {
19 | {label = _U('mission_row'), value = 'mission_row'},
20 | {label = _U('sandy_shores'), value = 'sandy_shores'},
21 | {label = _U('paleto_bay'), value = 'paleto_bay'},
22 | {label = _U('bolingbroke_pen'), value = 'bolingbroke_pen'}
23 | }}, function(data, menu)
24 | if data.current.value == 'mission_row' then
25 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mission_row', {
26 | title = _U('mission_row'),
27 | align = GetConvar('esx_MenuAlign', 'top-left'),
28 | elements = {
29 | {label = _U('mission_row_1'), value = 'mission_row_1'},
30 | {label = _U('mission_row_2'), value = 'mission_row_2'},
31 | {label = _U('mission_row_3'), value = 'mission_row_3'},
32 | {label = _U('mission_row_4'), value = 'mission_row_4'}
33 | }}, function(data2, menu2)
34 | local action = data2.current.value
35 |
36 | if action == 'mission_row_1' then
37 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
38 | title = _U('jail_menu_info'),
39 | }, function (data3, menu3)
40 | local jailTime = tonumber(data3.value)
41 |
42 | if jailTime == nil then
43 | ESX.ShowNotification(_U('invalid_amount'))
44 | else
45 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'LSMR1')
46 | ESX.UI.Menu.CloseAll()
47 | menu3.close()
48 | end
49 | end, function (data3, menu3)
50 | menu3.close()
51 | end)
52 | elseif action == 'mission_row_2' then
53 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
54 | title = _U('jail_menu_info'),
55 | }, function (data3, menu3)
56 | local jailTime = tonumber(data3.value)
57 |
58 | if jailTime == nil then
59 | ESX.ShowNotification(_U('invalid_amount'))
60 | else
61 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'LSMR2')
62 | ESX.UI.Menu.CloseAll()
63 | menu3.close()
64 | end
65 | end, function (data3, menu3)
66 | menu3.close()
67 | end)
68 | elseif action == 'mission_row_3' then
69 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
70 | title = _U('jail_menu_info'),
71 | }, function (data3, menu3)
72 | local jailTime = tonumber(data3.value)
73 |
74 | if jailTime == nil then
75 | ESX.ShowNotification(_U('invalid_amount'))
76 | else
77 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'LSMR3')
78 | ESX.UI.Menu.CloseAll()
79 | menu3.close()
80 | end
81 | end, function (data3, menu3)
82 | menu3.close()
83 | end)
84 | elseif action == 'mission_row_4' then
85 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
86 | title = _U('jail_menu_info'),
87 | }, function (data3, menu3)
88 | local jailTime = tonumber(data3.value)
89 |
90 | if jailTime == nil then
91 | ESX.ShowNotification(_U('invalid_amount'))
92 | else
93 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'LSMR4')
94 | ESX.UI.Menu.CloseAll()
95 | menu3.close()
96 | end
97 | end, function (data3, menu3)
98 | menu3.close()
99 | end)
100 | end
101 | end, function(data2, menu2)
102 | menu2.close()
103 | end)
104 | elseif data.current.value == 'sandy_shores' then
105 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'sandy_shores', {
106 | title = _U('sandy_shores'),
107 | align = GetConvar('esx_MenuAlign', 'top-left'),
108 | elements = {
109 | {label = _U('sandy_shores_1'), value = 'sandy_shores_1'},
110 | {label = _U('sandy_shores_2'), value = 'sandy_shores_2'}
111 | }}, function(data2, menu2)
112 | local action = data2.current.value
113 |
114 | if action == 'sandy_shores_1' then
115 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
116 | title = _U('jail_menu_info'),
117 | }, function (data3, menu3)
118 | local jailTime = tonumber(data3.value)
119 |
120 | if jailTime == nil then
121 | ESX.ShowNotification(_U('invalid_amount'))
122 | else
123 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'SSSD1')
124 | ESX.UI.Menu.CloseAll()
125 | menu3.close()
126 | end
127 | end, function (data3, menu3)
128 | menu3.close()
129 | end)
130 | elseif action == 'sandy_shores_2' then
131 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
132 | title = _U('jail_menu_info'),
133 | }, function (data3, menu3)
134 | local jailTime = tonumber(data3.value)
135 |
136 | if jailTime == nil then
137 | ESX.ShowNotification(_U('invalid_amount'))
138 | else
139 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'SSSD2')
140 | ESX.UI.Menu.CloseAll()
141 | menu3.close()
142 | end
143 | end, function (data3, menu3)
144 | menu3.close()
145 | end)
146 | end
147 | end, function(data2, menu2)
148 | menu2.close()
149 | end)
150 | elseif data.current.value == 'paleto_bay' then
151 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'paleto_bay', {
152 | title = _U('paleto_bay'),
153 | align = GetConvar('esx_MenuAlign', 'top-left'),
154 | elements = {
155 | {label = _U('paleto_bay_1'), value = 'paleto_bay_1'},
156 | {label = _U('paleto_bay_2'), value = 'paleto_bay_2'}
157 | }}, function(data2, menu2)
158 | local action = data2.current.value
159 |
160 | if action == 'paleto_bay_1' then
161 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
162 | title = _U('jail_menu_info'),
163 | }, function (data3, menu3)
164 | local jailTime = tonumber(data3.value)
165 |
166 | if jailTime == nil then
167 | ESX.ShowNotification(_U('invalid_amount'))
168 | else
169 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'PBSD1')
170 | ESX.UI.Menu.CloseAll()
171 | menu3.close()
172 | end
173 | end, function (data3, menu3)
174 | menu3.close()
175 | end)
176 | elseif action == 'paleto_bay_2' then
177 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
178 | title = _U('jail_menu_info'),
179 | }, function (data3, menu3)
180 | local jailTime = tonumber(data3.value)
181 |
182 | if jailTime == nil then
183 | ESX.ShowNotification(_U('invalid_amount'))
184 | else
185 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'PBSD2')
186 | ESX.UI.Menu.CloseAll()
187 | menu3.close()
188 | end
189 | end, function (data3, menu3)
190 | menu3.close()
191 | end)
192 | end
193 | end, function(data2, menu2)
194 | menu2.close()
195 | end)
196 | elseif data.current.value == 'bolingbroke_pen' then
197 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'bolingbroke_pen', {
198 | title = _U('bolingbroke_pen'),
199 | align = GetConvar('esx_MenuAlign', 'top-left'),
200 | elements = {
201 | {label = _U('bolingbroke_pen_1'), value = 'bolingbroke_pen_1'}
202 | }}, function(data2, menu2)
203 | local action = data2.current.value
204 |
205 | if action == 'bolingbroke_pen_1' then
206 | ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'jail_dialog', {
207 | title = _U('jail_menu_info'),
208 | }, function (data3, menu3)
209 | local jailTime = tonumber(data3.value)
210 |
211 | if jailTime == nil then
212 | ESX.ShowNotification(_U('invalid_amount'))
213 | else
214 | TriggerServerEvent('esx_advancedjail:sendToJail', player, jailTime * 60, 'SSBP1')
215 | ESX.UI.Menu.CloseAll()
216 | menu3.close()
217 | end
218 | end, function (data3, menu3)
219 | menu3.close()
220 | end)
221 | end
222 | end, function(data2, menu2)
223 | menu2.close()
224 | end)
225 | end
226 | end, function (data, menu)
227 | menu.close()
228 | end)
229 | end
230 |
--------------------------------------------------------------------------------
/esx_advancedjail/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Advanced Jail'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@async/async.lua',
20 | '@oxmysql/lib/MySQL.lua',
21 | 'server/main.lua'
22 | }
23 |
24 | client_scripts {
25 | 'client/main.lua'
26 | }
27 |
28 | dependencies {
29 | 'es_extended',
30 | 'async'
31 | }
32 |
--------------------------------------------------------------------------------
/esx_advancedjail/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales ['en'] = {
2 | -- Prisoner Clothing
3 | ['clothing_menu'] = 'Pick Your Clothes',
4 | ['citizen_wear'] = 'Civilian Clothes',
5 | ['jail_wear'] = 'Prisoner Clothes',
6 | ['press_access'] = 'press ~INPUT_CONTEXT~ to change Clothes.',
7 | -- Jail
8 | ['judge'] = 'JUDGE',
9 | ['jailed_msg'] = '%s is now in Jail for %s Minutes.',
10 | ['unjailed_msg'] = '%s has been released from Jail!',
11 | ['player_escaped'] = '~r~%s ~s~has Escaped from ~r~%s ~s~Jail!!!',
12 | ['player_escape_attempt'] = '~r~%s ~s~has Attempted to Escape from ~r~%s ~s~Jail!!!',
13 | ['escape_attempt'] = 'you are NOT allowed to Escape Jail!',
14 | ['remaining_msg'] = 'there remains ~b~%s Minutes %s Seconds~s~ until you are released from Jail.',
15 | ['you_ran'] = '~r~You have ran from Jail!',
16 | -- Add to esx_policejob
17 | ['jail'] = 'jail',
18 | ['jail_menu_info'] = 'Jail Player in Minutes',
19 | ['invalid_amount'] = 'Invalid Time Amount. Example: 5 = 5 Minutes',
20 | ['jail_menu'] = 'Choose Jail Location',
21 | ['mission_row'] = 'Mission Row',
22 | ['sandy_shores'] = 'Sandy Shores',
23 | ['paleto_bay'] = 'Paleto Bay',
24 | ['bolingbroke_pen'] = 'Bolingbroke Penitentiary',
25 | ['mission_row_1'] = 'Mission Row Cell 1',
26 | ['mission_row_2'] = 'Mission Row Cell 2',
27 | ['mission_row_3'] = 'Mission Row Cell 3',
28 | ['mission_row_4'] = 'Mission Row Cell 4',
29 | ['sandy_shores_1'] = 'Sandy Shores Cell 1',
30 | ['sandy_shores_2'] = 'Sandy Shores Cell 2',
31 | ['paleto_bay_1'] = 'Paleto Bay Cell 1',
32 | ['paleto_bay_2'] = 'Paleto Bay Cell 2',
33 | ['bolingbroke_pen_1'] = 'Bolingbroke Penitentiary Yard',
34 | }
35 |
--------------------------------------------------------------------------------
/esx_advancedjail/server/main.lua:
--------------------------------------------------------------------------------
1 | local playersInJail = {}
2 |
3 | AddEventHandler('esx:playerLoaded', function(playerId, xPlayer)
4 | MySQL.single('SELECT `jail_time`, `jail_loc` FROM users WHERE identifier = ?', {xPlayer.identifier}, function(result)
5 | if result and result.jail_time > 0 then
6 | TriggerEvent('esx_advancedjail:sendToJail', xPlayer.source, result.jail_time, result.jail_loc, true)
7 | end
8 | end)
9 | end)
10 |
11 | AddEventHandler('esx:playerDropped', function(playerId, reason)
12 | playersInJail[playerId] = nil
13 | end)
14 |
15 | AddEventHandler('onResourceStart', function(resource)
16 | if resource == GetCurrentResourceName() then
17 | checkJail()
18 | end
19 | end)
20 |
21 | function checkJail()
22 | Citizen.Wait(2000)
23 | local xPlayers = ESX.GetPlayers()
24 |
25 | for i=1, #xPlayers do
26 | Citizen.Wait(100)
27 | local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
28 |
29 | MySQL.single('SELECT `jail_time`, `jail_loc` FROM users WHERE identifier = ?', {xPlayer.identifier}, function(result)
30 | if result and result.jail_time > 0 then
31 | TriggerEvent('esx_advancedjail:sendToJail', xPlayer.source, result.jail_time, result.jail_loc, true)
32 | end
33 | end)
34 | end
35 | end
36 |
37 | ESX.RegisterCommand('jail', 'admin', function(xPlayer, args, showError)
38 | TriggerEvent('esx_advancedjail:sendToJail', args.playerId, args.time * 60, 'SSBP1', false)
39 | end, true, {help = 'Jail a Player', validate = true, arguments = {
40 | {name = 'playerId', help = 'Player Id', type = 'playerId'},
41 | {name = 'time', help = 'Jail Time in Minutes', type = 'number'}
42 | }})
43 |
44 | ESX.RegisterCommand('unjail', 'admin', function(xPlayer, args, showError)
45 | unjailPlayer(args.playerId)
46 | end, true, {help = 'Unjail a Player', validate = true, arguments = {
47 | {name = 'playerId', help = 'Player Id', type = 'playerId'}
48 | }})
49 |
50 | RegisterNetEvent('esx_advancedjail:sendToJail')
51 | AddEventHandler('esx_advancedjail:sendToJail', function(playerId, jailTime, jailLoc, quiet)
52 | local xPlayer = ESX.GetPlayerFromId(playerId)
53 | local name = GetCharacterName(playerId)
54 |
55 | if xPlayer then
56 | if not playersInJail[playerId] then
57 | MySQL.update('UPDATE users SET jail_time = ?, jail_loc = ? WHERE identifier = ?', {jailTime, jailLoc, xPlayer.identifier}, function(rowsChanged)
58 | xPlayer.triggerEvent('esx_policejob:unrestrain')
59 | xPlayer.triggerEvent('esx_advancedjail:jailPlayer', jailTime, jailLoc, name)
60 | playersInJail[playerId] = {timeRemaining = jailTime, identifier = xPlayer.getIdentifier()}
61 |
62 | if not quiet then
63 | TriggerClientEvent('chat:addMessage', -1, {args = {_U('judge'), _U('jailed_msg', xPlayer.getName(), ESX.Math.Round(jailTime / 60))}, color = {147, 196, 109}})
64 | end
65 | end)
66 | end
67 | end
68 | end)
69 |
70 | RegisterNetEvent('esx_advancedjail:unjailPlayerS')
71 | AddEventHandler('esx_advancedjail:unjailPlayerS', function(playerId)
72 | unjailPlayer(playerId)
73 | end)
74 |
75 | function unjailPlayer(playerId)
76 | local xPlayer = ESX.GetPlayerFromId(playerId)
77 |
78 | if xPlayer then
79 | if playersInJail[playerId] then
80 | MySQL.update('UPDATE users SET jail_time = 0, jail_loc = NULL WHERE identifier = ?', {xPlayer.identifier}, function(rowsChanged)
81 | TriggerClientEvent('chat:addMessage', -1, {args = {_U('judge'), _U('unjailed_msg', xPlayer.getName())}, color = {147, 196, 109}})
82 | playersInJail[playerId] = nil
83 | xPlayer.triggerEvent('esx_advancedjail:unjailPlayer')
84 | end)
85 | end
86 | end
87 | end
88 |
89 | Citizen.CreateThread(function()
90 | while true do
91 | Citizen.Wait(1000)
92 |
93 | for playerId,data in pairs(playersInJail) do
94 | playersInJail[playerId].timeRemaining = data.timeRemaining - 1
95 |
96 | if data.timeRemaining < 1 then
97 | unjailPlayer(playerId)
98 | end
99 | end
100 | end
101 | end)
102 |
103 | Citizen.CreateThread(function()
104 | while true do
105 | Citizen.Wait(60000 * Config.Sync)
106 | local tasks = {}
107 |
108 | for playerId,data in pairs(playersInJail) do
109 | local task = function(cb)
110 | MySQL.update('UPDATE users SET jail_time = ? WHERE identifier = ?', {data.timeRemaining, data.identifier}, function(rowsChanged)
111 | cb(rowsChanged)
112 | end)
113 | end
114 |
115 | table.insert(tasks, task)
116 | end
117 |
118 | Async.parallelLimit(tasks, 4, function(results) end)
119 | end
120 | end)
121 |
122 | -- Run UnJail
123 | RegisterNetEvent('esx_advancedjail:rununjail')
124 | AddEventHandler('esx_advancedjail:rununjail', function(_source)
125 | local _source = source
126 | local xPlayer = ESX.GetPlayerFromId(_source)
127 | local playerId = _source
128 |
129 | if xPlayer then
130 | MySQL.update('UPDATE users SET jail_time = ?, jail_loc = ? WHERE identifier = ?', {0, NULL, xPlayer.identifier}, function(rowsChanged)
131 | playersInJail[playerId] = nil
132 | xPlayer.triggerEvent('esx_advancedjail:unjailPlayer')
133 | xPlayer.showNotification(_U('you_ran'))
134 | end)
135 | end
136 | end)
137 |
138 | -- Get Character Name
139 | function GetCharacterName(source)
140 | local xPlayer = ESX.GetPlayerFromId(source)
141 | local result = MySQL.single('SELECT firstname, lastname FROM users WHERE identifier = ?', {xPlayer.identifier})
142 |
143 | if result ~= nil and result.firstname ~= nil and result.lastname ~= nil then
144 | if Config.OnlyFirstname then
145 | return result.firstname
146 | else
147 | return result.firstname .. ' ' .. result.lastname
148 | end
149 | else
150 | return GetPlayerName(source)
151 | end
152 | end
153 |
154 | -- Player Attempted Escape/Escaped
155 | RegisterNetEvent('esx_advancedjail:playerEscape')
156 | AddEventHandler('esx_advancedjail:playerEscape', function(name, type, location)
157 | local xPlayers = ESX.GetPlayers()
158 | for i=1, #xPlayers, 1 do
159 | local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
160 | if xPlayer.job.name == 'police' then
161 | if type == 'run' then
162 | if location == 'LSMR' then
163 | xPlayer.showNotification(_U('player_escaped', name, _U('mission_row')))
164 | elseif location == 'SSSD' then
165 | xPlayer.showNotification(_U('player_escaped', name, _U('sandy_shores')))
166 | elseif location == 'PBSD' then
167 | xPlayer.showNotification(_U('player_escaped', name, _U('paleto_bay')))
168 | elseif location == 'SSBP' then
169 | xPlayer.showNotification(_U('player_escaped', name, _U('bolingbroke_pen')))
170 | end
171 | elseif type == 'attempt' then
172 | if location == 'LSMR' then
173 | xPlayer.showNotification(_U('player_escape_attempt', name, _U('mission_row')))
174 | elseif location == 'SSSD' then
175 | xPlayer.showNotification(_U('player_escape_attempt', name, _U('sandy_shores')))
176 | elseif location == 'PBSD' then
177 | xPlayer.showNotification(_U('player_escape_attempt', name, _U('paleto_bay')))
178 | elseif location == 'SSBP' then
179 | xPlayer.showNotification(_U('player_escape_attempt', name, _U('bolingbroke_pen')))
180 | end
181 | end
182 | end
183 | end
184 | end)
185 |
186 | -- Remove Inventory when Jailed
187 | RegisterNetEvent('esx_advancedjail:removeInventory')
188 | AddEventHandler('esx_advancedjail:removeInventory', function()
189 | local xPlayer = ESX.GetPlayerFromId(source)
190 |
191 | if Config.RemoveLoadout then
192 | for i=1, #xPlayer.loadout, 1 do
193 | xPlayer.removeWeapon(xPlayer.loadout[i].name)
194 | end
195 | end
196 |
197 | if Config.RemoveInventory then
198 | for i=1, #xPlayer.inventory, 1 do
199 | if xPlayer.inventory[i].count > 0 then
200 | xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0)
201 | end
202 | end
203 | end
204 |
205 | if Config.RemoveDirtyMoney then
206 | if xPlayer.getAccount('black_money').money > 0 then
207 | xPlayer.setAccountMoney('black_money', 0)
208 | end
209 | end
210 |
211 | if Config.GiveFoodDrink then
212 | xPlayer.addInventoryItem(Config.FoodItem, Config.FoodAmount)
213 | xPlayer.addInventoryItem(Config.DrinkItem, Config.DrinkAmount)
214 | end
215 |
216 | --Core.SavePlayer(xPlayer)
217 | end)
218 |
--------------------------------------------------------------------------------
/esx_advancedvehicleshop/README.md:
--------------------------------------------------------------------------------
1 | # About esx_advancedvehicleshop:
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * This Vehicle Shops works exactly like esx_vehicleshop.
6 | * Currently has 11 Different Vehicle Shops.
7 | * Ambulance, Police, Mechanic, Taxi, Aircrafts, Boats, Cars, Trucks, & 3 VIP Shops (Aircrafts, Boats & Cars)
8 | * To make this Script fully work with `esx_policejob & esx_ambulancejob`
9 | * edit `client/vehicle.lua` and do a search for `esx_vehicleshop` & change it to `esx_advancedvehicleshop` then edit the `fxmanifest.lua` & remove the dependency for `esx_vehicleshop`.
10 | * You can only sell vehicles at the shop you bought it from.
11 | * Example: If you a buy a vehicle at the Truck Shop you won't be able to sell it at the Car Shop.
12 | * If you want to use the Ambulance or Police Shop you will need to Edit the sql to your needs before you upload it.
13 | * I have added my VIP Aircraft, Boat & Car Shop but you will need to setup that on your own. There will be no help from me.
14 | * This works perfectly with my esx_advancedgarage. I suggest using it over any other garage system including esx_policejob & esx_ambulancejob Garages.
15 | * New System will pull Vehicle Name & Vehicle Category & save it in the Database. This way you don't need a vehicle_names.lua file.
16 | * In order to Migrate Vehicle go to fxmanifest.lua and uncomment the 'server/migrate.lua'
17 | * Config.Main.PlateUseSpace will add a Double Space in between the Letters and Numbers.
18 |
19 | # Requirements:
20 | * Required:
21 | * FiveM Client/Server Build 4267 or Higher
22 | * Set Game Build to Tuner Update `+set sv_enforceGameBuild tuner`
23 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
24 | * Optional:
25 | * [esx_advancedgarage]( https://github.com/HumanTree92/VENT_ESX_Scripts/tree/main/esx_advancedgarage )
26 | * [esx_dmvschool]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_dmvschool )
27 | * [esx_licenseshop]( https://github.com/HumanTree92/VENT_ESX_Scripts/tree/main/esx_licenseshop )
28 |
29 | # Download & Installation:
30 | 1) Import the `esx_advancedvehicleshop.sql` into your database.
31 | 2) Place `esx_advancedvehicleshop` in your ESX Directory
32 | 3) Add `start esx_advancedvehicleshop` to your server.cfg
33 | 4) Edit the `config.lua` to your liking
34 |
35 | # How to use Ambulance, Police, Mechanic, & Taxi Shop
36 | 1) For `vs_ambulance_categories` & `vs_police_categories` & `vs_mechanic_categories` & `vs_taxi_categories`
37 | * The column `name` should be the job_grades name
38 | * The column `label` should be the job_grades label
39 | 2) For `vs_ambulance` & `vs_police` & `vs_mechanic` & `vs_taxi`
40 | * The column `id` should start at 1 and so on.
41 | * The column `name` should be the vehicle name.
42 | * The column `model` should be spawn name.
43 | * The column `price` should be the vehicles price.
44 | * The column `category` should be the job_grades name
45 | 3) You can find Examples in the `esx_advancedvehicleshop.sql`
46 |
47 | # Credits/Original Code:
48 | * [ESX-Framework]( https://github.com/esx-framework )
49 | * [esx_vehicleshop]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_vehicleshop )
50 |
--------------------------------------------------------------------------------
/esx_advancedvehicleshop/client/utils.lua:
--------------------------------------------------------------------------------
1 | local NumberCharset, Charset = {}, {}
2 |
3 | for i = 48, 57 do table.insert(NumberCharset, string.char(i)) end
4 | for i = 65, 90 do table.insert(Charset, string.char(i)) end
5 | for i = 97, 122 do table.insert(Charset, string.char(i)) end
6 |
7 | function GeneratePlate()
8 | local generatedPlate
9 | local doBreak = false
10 |
11 | while true do
12 | Wait(2)
13 | math.randomseed(GetGameTimer())
14 |
15 | -- The Maximum Plate Length is 8 Characters (including Spaces & Symbols), DON'T GO PAST IT!!!
16 | if Config.Main.PlateSingleSpace then
17 | generatedPlate = string.upper(GetRandomLetter(3) .. ' ' .. GetRandomNumber(3))
18 | elseif Config.Main.PlateDoubleSpace then
19 | generatedPlate = string.upper(GetRandomLetter(3) .. ' ' .. GetRandomNumber(3))
20 | else
21 | generatedPlate = string.upper(GetRandomLetter(4) .. GetRandomNumber(4))
22 | end
23 |
24 | ESX.TriggerServerCallback('esx_advancedvehicleshop:isPlateTaken', function (isPlateTaken)
25 | if not isPlateTaken then
26 | doBreak = true
27 | end
28 | end, generatedPlate)
29 |
30 | if doBreak then
31 | break
32 | end
33 | end
34 |
35 | return generatedPlate
36 | end
37 |
38 | -- mixing async with sync tasks
39 | function IsPlateTaken(plate)
40 | local callback = 'waiting'
41 |
42 | ESX.TriggerServerCallback('esx_advancedvehicleshop:isPlateTaken', function(isPlateTaken)
43 | callback = isPlateTaken
44 | end, plate)
45 |
46 | while type(callback) == 'string' do
47 | Wait(0)
48 | end
49 |
50 | return callback
51 | end
52 |
53 | function GetRandomNumber(length)
54 | Wait(0)
55 |
56 | if length > 0 then
57 | return GetRandomNumber(length - 1) .. NumberCharset[math.random(1, #NumberCharset)]
58 | else
59 | return ''
60 | end
61 | end
62 |
63 | function GetRandomLetter(length)
64 | Wait(0)
65 |
66 | if length > 0 then
67 | return GetRandomLetter(length - 1) .. Charset[math.random(1, #Charset)]
68 | else
69 | return ''
70 | end
71 | end
72 |
--------------------------------------------------------------------------------
/esx_advancedvehicleshop/esx_lscustom_fix.lua:
--------------------------------------------------------------------------------
1 | -- To have this work with esx_lscustom you must edit
2 | ESX.RegisterServerCallback('esx_lscustom:getVehiclesPrices', function(source, cb)
3 | if not Vehicles then
4 | MySQL.Async.fetchAll('SELECT * FROM vs_cars', {}, function(result)
5 | local vehicles = {}
6 |
7 | for i=1, #result, 1 do
8 | table.insert(vehicles, {
9 | model = result[i].model,
10 | price = result[i].price
11 | })
12 | end
13 |
14 | Vehicles = vehicles
15 | cb(Vehicles)
16 | end)
17 | else
18 | cb(Vehicles)
19 | end
20 | end)
21 |
22 | -- New Fix
23 | ESX.RegisterServerCallback('esx_lscustom:getVehiclesPrices', function(source, cb)
24 | if not Vehicles then
25 | MySQL.Async.fetchAll('SELECT model, price FROM vs_ambulance UNION SELECT model, price FROM vs_police UNION SELECT model, price FROM vs_divisions UNION SELECT model, price FROM vs_mechanic UNION SELECT model, price FROM vs_taxi UNION SELECT model, price FROM vs_aircrafts UNION SELECT model, price FROM vs_boats UNION SELECT model, price FROM vs_cars UNION SELECT model, price FROM vs_trucks UNION SELECT model, price FROM vs_vipcars UNION SELECT model, price FROM vs_vipaircrafts UNION SELECT model, price FROM vs_vipboats;', {}, function(result)
26 | local vehicles = {}
27 |
28 | for i=1, #result, 1 do
29 | table.insert(vehicles, {
30 | model = result[i].model,
31 | price = result[i].price
32 | })
33 | end
34 |
35 | Vehicles = vehicles
36 | cb(Vehicles)
37 | end)
38 | else
39 | cb(Vehicles)
40 | end
41 | end)
42 |
--------------------------------------------------------------------------------
/esx_advancedvehicleshop/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Advanced Vehicle Shop'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@async/async.lua',
20 | '@oxmysql/lib/MySQL.lua',
21 | 'server/main.lua',
22 | --'server/migrate.lua'
23 | }
24 |
25 | client_scripts {
26 | 'client/utils.lua',
27 | 'client/main.lua'
28 | }
29 |
30 | dependencies {
31 | 'es_extended',
32 | --'esx_dmvschool',
33 | --'esx_licenseshop'
34 | }
35 |
36 | export 'GeneratePlate'
37 |
--------------------------------------------------------------------------------
/esx_advancedvehicleshop/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | -- Shared
3 | ['vehicle_dealer'] = 'Vehicle Dealership',
4 | ['shop_awaiting_model'] = 'the Vehicle is currently loading, ~r~PLEASE WAIT!',
5 | ['no'] = 'no',
6 | ['yes'] = 'yes',
7 | ['finance'] = 'Finance',
8 | ['payfull'] = 'Pay in Full',
9 | ['cancel'] = 'Cancel Purchase',
10 | ['not_enough_money'] = 'you do not have enough money',
11 | ['not_yours'] = 'this Vehicle does not belong to you',
12 | ['sell_menu'] = 'press ~INPUT_CONTEXT~ to Sell your ~y~%s~s~ for ~g~$%s~s~',
13 | ['generic_shopitem'] = '$%s',
14 | ['buy_vehicle'] = 'do you want to purchase %s for $%s?',
15 | ['sold_for'] = 'the ~b~%s~s~ has been ~y~sold~s~ for ~g~$%s~s~',
16 | ['go_to'] = 'you must go to a License Shop to purchase Licenses.',
17 | ['your_rank'] = 'This Vehicle is not for your Rank!',
18 | ['your_job'] = 'This Vehicle is not for your Job!',
19 | ['cant_sell'] = 'You must Sell this Vehicle where you bought it from.',
20 | ['spawnpoint_blocked'] = 'Vehicle spawn point is ~r~blocked~s~!',
21 | ['vehicle_belongs'] = 'an %s with Plate ~y~%s~s~ now belongs to ~b~YOU~s~',
22 |
23 | -- Ambulance Shop
24 | ['ambulance_menu'] = 'press ~INPUT_CONTEXT~ to access the ~r~Ambulance Shop',
25 | ['ambulance_dealer'] = 'dealership | Ambulance',
26 |
27 | -- Police Shop
28 | ['police_menu'] = 'press ~INPUT_CONTEXT~ to access the ~b~Police Shop',
29 | ['police_dealer'] = 'dealership | Police',
30 |
31 | -- Division Shop
32 | ['division_menu'] = 'press ~INPUT_CONTEXT~ to access the ~b~Division Shop',
33 | ['division_dealer'] = 'dealership | Division',
34 |
35 | -- Mechanic Shop
36 | ['mechanic_menu'] = 'press ~INPUT_CONTEXT~ to access the ~o~Mechanic Shop',
37 | ['mechanic_dealer'] = 'dealership | Mechanic',
38 |
39 | -- Taxi Shop
40 | ['taxi_menu'] = 'press ~INPUT_CONTEXT~ to access the ~o~Taxi Shop',
41 | ['taxi_dealer'] = 'dealership | Taxi',
42 |
43 | -- Aircraft Shop
44 | ['aircraft_menu'] = 'press ~INPUT_CONTEXT~ to access the ~p~Aircraft Shop',
45 | ['aircraft_dealer'] = 'dealership | Aircraft',
46 | ['aircraft_missing'] = 'you don\'t have a Aircraft License!',
47 |
48 | -- Boat Shop
49 | ['boat_menu'] = 'press ~INPUT_CONTEXT~ to access the ~b~Boat Shop',
50 | ['boat_dealer'] = 'dealership | Boat',
51 | ['boat_missing'] = 'you don\'t have a Boat License!',
52 |
53 | -- Car Shop
54 | ['car_menu'] = 'press ~INPUT_CONTEXT~ to access the ~g~Car Shop',
55 | ['car_dealer'] = 'dealership | Car',
56 | ['car_missing'] = 'you don\'t have a Driver\'s License!',
57 |
58 | -- Truck Shop
59 | ['truck_menu'] = 'press ~INPUT_CONTEXT~ to access the ~c~Truck Shop',
60 | ['truck_dealer'] = 'dealership | Truck',
61 | ['truck_missing'] = 'you don\'t have a Commercial License!',
62 |
63 | -- VIP Shop
64 | ['vipa_menu'] = 'press ~INPUT_CONTEXT~ to access the ~y~VIP Aircraft Shop',
65 | ['vipb_menu'] = 'press ~INPUT_CONTEXT~ to access the ~y~VIP Boat Shop',
66 | ['vipc_menu'] = 'press ~INPUT_CONTEXT~ to access the ~y~VIP Car Shop',
67 | ['vip_dealer'] = 'dealership | VIP',
68 | ['vip_no'] = 'you are ~r~NOT ~w~ a ~y~VIP!',
69 | }
70 |
--------------------------------------------------------------------------------
/esx_advancedvehicleshop/server/migrate.lua:
--------------------------------------------------------------------------------
1 | local NumberCharset, Charset, RegisteredPlateTable = {}, {}, {}
2 | local currentExecuting = 0
3 |
4 | for i = 48, 57 do table.insert(NumberCharset, string.char(i)) end
5 | for i = 65, 90 do table.insert(Charset, string.char(i)) end
6 | for i = 97, 122 do table.insert(Charset, string.char(i)) end
7 |
8 | RegisterCommand('migrate', function(source, args, rawCommand)
9 | migrateVehicles()
10 | end, true)
11 |
12 | function migrateVehicles()
13 | MySQL.query('SELECT * FROM owned_vehicles', {}, function(result)
14 | for i=1, #result, 1 do
15 | Citizen.Wait(0)
16 |
17 | local vehicleID = result[i].id
18 | local vehicleProps = json.decode(result[i].vehicle)
19 | local oldPlate = vehicleProps.plate
20 |
21 | vehicleProps.plate = GeneratePlate() -- generate plate
22 |
23 | migrateVehicle(vehicleProps, oldPlate, vehicleID)
24 | end
25 |
26 | print('\n\n\n')
27 | print('esx_migrate: done!')
28 | print('\n\n\n')
29 | end)
30 | end
31 |
32 | Citizen.CreateThread(function()
33 | while true do
34 | Citizen.Wait(2000)
35 | if currentExecuting > (Config.Main.MaxMigrates / 2) then
36 | currentExecuting = currentExecuting - 1
37 | end
38 | end
39 | end)
40 |
41 | function migrateVehicle(vehicleProps, oldPlate, vehicleID)
42 | while currentExecuting > Config.Main.MaxMigrates do
43 | Citizen.Wait(2)
44 | end
45 |
46 | io.write('esx_migrate: migrating . . . ')
47 | currentExecuting = currentExecuting + 1
48 |
49 | MySQL.update('UPDATE `owned_vehicles` SET `vehicle` = ?, `plate` = ? WHERE `id` = ?', {json.encode(vehicleProps), vehicleProps.plate, vehicleID}, function(rowsChanged)
50 | io.write(('OK! (%s > %s)\n'):format(oldPlate, vehicleProps.plate))
51 | currentExecuting = currentExecuting - 1
52 | end)
53 | end
54 |
55 | -- customize the plate generator here
56 | function GeneratePlate()
57 | local generatedPlate
58 |
59 | while true do
60 | if Config.Main.PlateUseSpace then
61 | generatedPlate = string.upper(GetRandomLetter(3) .. ' ' .. GetRandomNumber(3))
62 | else
63 | generatedPlate = string.upper(GetRandomLetter(4) .. GetRandomNumber(4))
64 | end
65 |
66 | if IsPlateTaken(generatedPlate) then
67 | Citizen.Wait(2) -- don't break the loop til we got an plate that isn't taken
68 | else
69 | break
70 | end
71 | end
72 |
73 | RegisteredPlateTable[generatedPlate] = true
74 | return generatedPlate
75 | end
76 |
77 | function IsPlateTaken(plate)
78 | return RegisteredPlateTable[plate]
79 | end
80 |
81 | function GetRandomNumber(length)
82 | math.randomseed(GetGameTimer())
83 | if length > 0 then
84 | return GetRandomNumber(length - 1) .. NumberCharset[math.random(1, #NumberCharset)]
85 | else
86 | return ''
87 | end
88 | end
89 |
90 | function GetRandomLetter(length)
91 | math.randomseed(GetGameTimer())
92 | if length > 0 then
93 | return GetRandomLetter(length - 1) .. Charset[math.random(1, #Charset)]
94 | else
95 | return ''
96 | end
97 | end
98 |
--------------------------------------------------------------------------------
/esx_advancedweaponshop/README.md:
--------------------------------------------------------------------------------
1 | # About esx_advancedweaponshop:
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * This Weapon Shops works similar to esx_weaponshop.
6 | * Players will be required to own different Licenses to purchase certain Weapons.
7 | * Its best to leave Sniper Rifles & LMGs out of the BlackShop so it gives players a job to sell Weapons.
8 | * If you add LMGs & Snipers in the Blackshop you will have to edit the client/main.lua.
9 |
10 | # Requirements:
11 | * Required:
12 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
13 | * Optional:
14 | * [esx_licenseshop]( https://github.com/HumanTree92/VENT_ESX_Scripts/tree/main/esx_licenseshop )
15 |
16 | # Download & Installation:
17 | 1) Place `esx_advancedweaponshop` in your ESX Directory
18 | 2) Add `start esx_advancedweaponshop` to your server.cfg
19 | 3) Edit the `config.lua` to your liking
20 |
21 | # Credits/Original Code:
22 | * [ESX-Framework]( https://github.com/esx-framework )
23 | * [esx_weaponshop]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_weaponshop )
24 |
--------------------------------------------------------------------------------
/esx_advancedweaponshop/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 |
4 | Config.DrawDistance = 10 -- Marker Draw Distance.
5 | Config.MarkerInfo = {Type = 1, r = 0, g = 128, b = 255, x = 1.5, y = 1.5, z = 0.5} -- Marker Settings.
6 |
7 | Config.UseBlips = false -- true = Use Weapon Shop Blips.
8 |
9 | -- Require Licenses | Use only if you are using esx_license
10 | Config.License = {
11 | Master = false, -- Master Toggle | Set to true if using esx_license.
12 | Melee = false, -- true = Will Require Players to have a Melee License to Purchase Melee Weapons.
13 | Handgun = true, -- true = Will Require Players to have a Handgun License to Purchase Handguns.
14 | SMG = true, -- true = Will Require Players to have a SMG License to Purchase SMGs.
15 | Shotgun = true, -- true = Will Require Players to have a Shotgun License to Purchase Shotguns.
16 | Assault = true, -- true = Will Require Players to have a Assault License to Purchase Assault Rifles.
17 | LMG = true, -- true = Will Require Players to have a LMG License to Purchase LMGs.
18 | Sniper = true -- true = Will Require Players to have a Sniper License to Purchase Sniper Rifles.
19 | }
20 |
21 | -- true = This shop has Weapons
22 | Config.HasWeapons = {
23 | LegalShop = {
24 | Misc = true,
25 | Throw = true,
26 | Melee = true,
27 | Handgun = true,
28 | SMG = true,
29 | Shotgun = true,
30 | Assault = true,
31 | LMG = true,
32 | Sniper = true
33 | },
34 |
35 | IllegalShop = {
36 | Misc = false,
37 | Throw = true,
38 | Melee = true,
39 | Handgun = true,
40 | SMG = true,
41 | Shotgun = true,
42 | Assault = true,
43 | LMG = false,
44 | Sniper = false
45 | }
46 | }
47 |
48 | Config.Zones = {
49 | LegalShop = {
50 | Legal = true, -- DO NOT CHANGE
51 | Misc = {
52 | {cat = 'Misc', name = 'GADGET_PARACHUTE', price = 800},
53 | {cat = 'Misc', name = 'WEAPON_FIREEXTINGUISHER', price = 100}
54 | },
55 | Throw = {
56 | {cat = 'Throw', name = 'WEAPON_BALL', price = 25},
57 | {cat = 'Throw', name = 'WEAPON_BZGAS', price = 250},
58 | {cat = 'Throw', name = 'WEAPON_FLARE', price = 100},
59 | {cat = 'Throw', name = 'WEAPON_SNOWBALL', price = 25},
60 | {cat = 'Throw', name = 'WEAPON_SMOKEGRENADE', price = 250}
61 | },
62 | Melee = {
63 | {cat = 'Melee', name = 'WEAPON_DAGGER', price = 15},
64 | {cat = 'Melee', name = 'WEAPON_BAT', price = 20},
65 | {cat = 'Melee', name = 'WEAPON_BATTLEAXE', price = 125},
66 | {cat = 'Melee', name = 'WEAPON_BOTTLE', price = 10},
67 | {cat = 'Melee', name = 'WEAPON_CROWBAR', price = 15},
68 | {cat = 'Melee', name = 'WEAPON_FLASHLIGHT', price = 25},
69 | {cat = 'Melee', name = 'WEAPON_GOLFCLUB', price = 40},
70 | {cat = 'Melee', name = 'WEAPON_HAMMER', price = 5},
71 | {cat = 'Melee', name = 'WEAPON_HATCHET', price = 20},
72 | {cat = 'Melee', name = 'WEAPON_KNIFE', price = 30},
73 | {cat = 'Melee', name = 'WEAPON_KNUCKLE', price = 25},
74 | {cat = 'Melee', name = 'WEAPON_MACHETE', price = 20},
75 | {cat = 'Melee', name = 'WEAPON_NIGHTSTICK', price = 15},
76 | {cat = 'Melee', name = 'WEAPON_WRENCH', price = 40},
77 | {cat = 'Melee', name = 'WEAPON_POOLCUE', price = 10},
78 | {cat = 'Melee', name = 'WEAPON_STONE_HATCHET', price = 15},
79 | {cat = 'Melee', name = 'WEAPON_SWITCHBLADE', price = 25}
80 | },
81 | Handgun = {
82 | {cat = 'Handgun', name = 'WEAPON_APPISTOL', price = 2700},
83 | {cat = 'Handgun', name = 'WEAPON_CERAMICPISTOL', price = 400},
84 | {cat = 'Handgun', name = 'WEAPON_COMBATPISTOL', price = 400},
85 | {cat = 'Handgun', name = 'WEAPON_DOUBLEACTION', price = 650},
86 | {cat = 'Handgun', name = 'WEAPON_FLAREGUN', price = 500},
87 | --{cat = 'Handgun', name = 'WEAPON_GADGETPISTOL', price = 500},
88 | {cat = 'Handgun', name = 'WEAPON_HEAVYPISTOL', price = 550},
89 | {cat = 'Handgun', name = 'WEAPON_REVOLVER', price = 1300},
90 | {cat = 'Handgun', name = 'WEAPON_NAVYREVOLVER', price = 650},
91 | {cat = 'Handgun', name = 'WEAPON_PISTOL', price = 350},
92 | {cat = 'Handgun', name = 'WEAPON_PISTOL50', price = 1500},
93 | {cat = 'Handgun', name = 'WEAPON_SNSPISTOL', price = 150},
94 | {cat = 'Handgun', name = 'WEAPON_STUNGUN', price = 500},
95 | {cat = 'Handgun', name = 'WEAPON_VINTAGEPISTOL', price = 300},
96 | {cat = 'Handgun', name = 'WEAPON_MARKSMANPISTOL', price = 225}
97 | },
98 | SMG = {
99 | {cat = 'SMG', name = 'WEAPON_ASSAULTSMG', price = 1400},
100 | {cat = 'SMG', name = 'WEAPON_COMBATPDW', price = 1500},
101 | {cat = 'SMG', name = 'WEAPON_MACHINEPISTOL', price = 1300},
102 | {cat = 'SMG', name = 'WEAPON_MICROSMG', price = 900},
103 | {cat = 'SMG', name = 'WEAPON_MINISMG', price = 800},
104 | {cat = 'SMG', name = 'WEAPON_SMG', price = 1600}
105 | },
106 | Shotgun = {
107 | {cat = 'Shotgun', name = 'WEAPON_ASSAULTSHOTGUN', price = 1100},
108 | {cat = 'Shotgun', name = 'WEAPON_AUTOSHOTGUN', price = 1100},
109 | {cat = 'Shotgun', name = 'WEAPON_BULLPUPSHOTGUN', price = 400},
110 | --{cat = 'Shotgun', name = 'WEAPON_COMBATSHOTGUN', price = 550},
111 | {cat = 'Shotgun', name = 'WEAPON_DBSHOTGUN', price = 450},
112 | {cat = 'Shotgun', name = 'WEAPON_HEAVYSHOTGUN', price = 1000},
113 | {cat = 'Shotgun', name = 'WEAPON_MUSKET', price = 225},
114 | {cat = 'Shotgun', name = 'WEAPON_PUMPSHOTGUN', price = 350},
115 | {cat = 'Shotgun', name = 'WEAPON_SAWNOFFSHOTGUN', price = 500}
116 | },
117 | Assault = {
118 | {cat = 'Assault', name = 'WEAPON_ADVANCEDRIFLE', price = 2000},
119 | {cat = 'Assault', name = 'WEAPON_ASSAULTRIFLE', price = 1200},
120 | {cat = 'Assault', name = 'WEAPON_BULLPUPRIFLE', price = 1200},
121 | {cat = 'Assault', name = 'WEAPON_CARBINERIFLE', price = 2400},
122 | {cat = 'Assault', name = 'WEAPON_COMPACTRIFLE', price = 750},
123 | --{cat = 'Assault', name = 'WEAPON_MILITARYRIFLE', price = 2050},
124 | {cat = 'Assault', name = 'WEAPON_SPECIALCARBINE', price = 5200}
125 | },
126 | LMG = {
127 | {cat = 'LMG', name = 'WEAPON_COMBATMG', price = 13950},
128 | {cat = 'LMG', name = 'WEAPON_GUSENBERG', price = 4280},
129 | {cat = 'LMG', name = 'WEAPON_MG', price = 8250}
130 | },
131 | Sniper = {
132 | {cat = 'Sniper', name = 'WEAPON_HEAVYSNIPER', price = 9900},
133 | {cat = 'Sniper', name = 'WEAPON_MARKSMANRIFLE', price = 3800},
134 | {cat = 'Sniper', name = 'WEAPON_SNIPERRIFLE', price = 2000}
135 | },
136 | Locations = {
137 | vector3(-662.1, -935.3, 20.8),
138 | vector3(810.2, -2157.3, 28.6),
139 | vector3(1693.4, 3759.5, 33.7),
140 | vector3(-330.2, 6083.8, 30.4),
141 | vector3(252.3, -50.0, 68.9),
142 | vector3(22.0, -1107.2, 28.8),
143 | vector3(2567.6, 294.3, 107.7),
144 | vector3(-1117.5, 2698.6, 17.5),
145 | vector3(842.4, -1033.4, 27.1),
146 | vector3(-1306.2, -394.0, 35.6),
147 | vector3(-3171.97, 1087.4, 19.84)
148 | }
149 | },
150 |
151 | IllegalShop = {
152 | Legal = false, -- DO NOT CHANGE
153 | Misc = {
154 | --{cat = 'Misc', name = 'NAME_HERE', price = 1}
155 | },
156 | Throw = {
157 | {cat = 'Throw', name = 'WEAPON_BZGAS', price = 500},
158 | {cat = 'Throw', name = 'WEAPON_MOLOTOV', price = 150},
159 | {cat = 'Throw', name = 'WEAPON_SMOKEGRENADE', price = 500}
160 | },
161 | Melee = {
162 | {cat = 'Melee', name = 'WEAPON_BAT', price = 25},
163 | {cat = 'Melee', name = 'WEAPON_BOTTLE', price = 15},
164 | {cat = 'Melee', name = 'WEAPON_CROWBAR', price = 20},
165 | {cat = 'Melee', name = 'WEAPON_KNIFE', price = 35},
166 | {cat = 'Melee', name = 'WEAPON_KNUCKLE', price = 30},
167 | {cat = 'Melee', name = 'WEAPON_MACHETE', price = 25},
168 | {cat = 'Melee', name = 'WEAPON_SWITCHBLADE', price = 30}
169 | },
170 | Handgun = {
171 | {cat = 'Handgun', name = 'WEAPON_PISTOL', price = 700},
172 | {cat = 'Handgun', name = 'WEAPON_SNSPISTOL', price = 300},
173 | {cat = 'Handgun', name = 'WEAPON_VINTAGEPISTOL', price = 600}
174 | },
175 | SMG = {
176 | {cat = 'SMG', name = 'WEAPON_MICROSMG', price = 1800},
177 | {cat = 'SMG', name = 'WEAPON_MINISMG', price = 1600},
178 | {cat = 'SMG', name = 'WEAPON_SMG', price = 3200}
179 | },
180 | Shotgun = {
181 | {cat = 'Shotgun', name = 'WEAPON_DBSHOTGUN', price = 900},
182 | {cat = 'Shotgun', name = 'WEAPON_PUMPSHOTGUN', price = 700},
183 | {cat = 'Shotgun', name = 'WEAPON_SAWNOFFSHOTGUN', price = 1000}
184 | },
185 | Assault = {
186 | {cat = 'Assault', name = 'WEAPON_ASSAULTRIFLE', price = 2400},
187 | {cat = 'Assault', name = 'WEAPON_CARBINERIFLE', price = 4800}
188 | },
189 | LMG = {
190 | --{cat = 'LMG', name = 'NAME_HERE', price = 1}
191 | },
192 | Sniper = {
193 | --{cat = 'Sniper', name = 'NAME_HERE', price = 1}
194 | },
195 | Locations = {
196 | vector3(119.47, -1977.88, 19.93)
197 | }
198 | }
199 | }
200 |
--------------------------------------------------------------------------------
/esx_advancedweaponshop/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Advanced Weapon Shop'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@oxmysql/lib/MySQL.lua',
20 | 'server/main.lua'
21 | }
22 |
23 | client_scripts {
24 | 'client/main.lua'
25 | }
26 |
27 | exports {
28 | 'openESXAdvancedWeaponShop'
29 | }
30 |
31 | dependencies {
32 | 'es_extended',
33 | --'esx_licenseshop'
34 | }
35 |
--------------------------------------------------------------------------------
/esx_advancedweaponshop/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | ['buy_license'] = 'buy Weapon License?',
3 | ['yes'] = 'yes',
4 | ['no'] = 'no',
5 | ['weapon_bought'] = 'purchased for $%s',
6 | ['not_enough_black'] = 'you do not have enough dirty money',
7 | ['not_enough'] = 'you do not have enough money',
8 | ['already_owned'] = 'you already own this weapon!',
9 | ['shop_menu_title'] = 'ammu-Nation',
10 | ['shop_menu_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Ammu-Nation~s~.',
11 | ['shop_menu_item'] = '$%s',
12 | ['map_blip'] = 'ammu-Nation',
13 | ['go_to'] = 'you must go to a License Shop to purchase Licenses.',
14 | ['no_wea'] = 'This Shop does not sell this Type of Weapon!',
15 | ['weapon_cat'] = 'Weapon Categories',
16 | ['wea_misc'] = 'Misc',
17 | ['wea_throw'] = 'Throwables',
18 | ['wea_melee'] = 'Melee',
19 | ['wea_handgun'] = 'Handguns',
20 | ['wea_smg'] = 'Submachine Guns',
21 | ['wea_shotgun'] = 'Shotguns',
22 | ['wea_assault'] = 'Assault Rifles',
23 | ['wea_lmg'] = 'Light Machine Guns',
24 | ['wea_sniper'] = 'Sniper Rifles',
25 | }
26 |
--------------------------------------------------------------------------------
/esx_advancedweaponshop/server/main.lua:
--------------------------------------------------------------------------------
1 |
2 | -- Buy Weapon
3 | ESX.RegisterServerCallback('esx_advancedweaponshop:buyWeapon', function(source, cb, weaponCat, weaponName, zone)
4 | local xPlayer = ESX.GetPlayerFromId(source)
5 | local price = getPrice(weaponCat, weaponName, zone)
6 |
7 | if price == 0 then
8 | print(('esx_advancedweaponshop: %s Attempted to buy a UNKNOWN Weapon!'):format(xPlayer.identifier))
9 | cb(false)
10 | else
11 | if xPlayer.hasWeapon(weaponName) then
12 | xPlayer.showNotification(_U('already_owned'))
13 | cb(false)
14 | else
15 | if zone == 'LegalShop' then
16 | if xPlayer.getMoney() >= price then
17 | xPlayer.removeMoney(price)
18 | xPlayer.addWeapon(weaponName, 50)
19 |
20 | cb(true)
21 | else
22 | xPlayer.showNotification(_U('not_enough'))
23 | cb(false)
24 | end
25 | elseif zone == 'IllegalShop' then
26 | if Config.UseDirty then
27 | if xPlayer.getAccount('black_money').money >= price then
28 | xPlayer.removeAccountMoney('black_money', price)
29 | xPlayer.addWeapon(weaponName, 50)
30 |
31 | cb(true)
32 | else
33 | xPlayer.showNotification(_U('not_enough_black'))
34 | cb(false)
35 | end
36 | else
37 | if xPlayer.getMoney() >= price then
38 | xPlayer.removeMoney(price)
39 | xPlayer.addWeapon(weaponName, 50)
40 |
41 | cb(true)
42 | else
43 | xPlayer.showNotification(_U('not_enough'))
44 | cb(false)
45 | end
46 | end
47 | else
48 | print(('esx_advancedweaponshop: %s Attempted to access a UNKNOWN Weapon Shop!'):format(xPlayer.identifier))
49 | cb(false)
50 | end
51 | end
52 | end
53 | end)
54 |
55 | function getPrice(weaponCat, weaponName, zone)
56 | if weaponCat == 'Misc' then
57 | local weapon = nil
58 |
59 | for k,v in pairs(Config.Zones[zone].Misc) do
60 | if v.name == weaponName then
61 | weapon = v
62 | break
63 | end
64 | end
65 |
66 | if weapon then
67 | return weapon.price
68 | else
69 | return 0
70 | end
71 | elseif weaponCat == 'Throw' then
72 | local weapon = nil
73 |
74 | for k,v in pairs(Config.Zones[zone].Throw) do
75 | if v.name == weaponName then
76 | weapon = v
77 | break
78 | end
79 | end
80 |
81 | if weapon then
82 | return weapon.price
83 | else
84 | return 0
85 | end
86 | elseif weaponCat == 'Melee' then
87 | local weapon = nil
88 |
89 | for k,v in pairs(Config.Zones[zone].Melee) do
90 | if v.name == weaponName then
91 | weapon = v
92 | break
93 | end
94 | end
95 |
96 | if weapon then
97 | return weapon.price
98 | else
99 | return 0
100 | end
101 | elseif weaponCat == 'Handgun' then
102 | local weapon = nil
103 |
104 | for k,v in pairs(Config.Zones[zone].Handgun) do
105 | if v.name == weaponName then
106 | weapon = v
107 | break
108 | end
109 | end
110 |
111 | if weapon then
112 | return weapon.price
113 | else
114 | return 0
115 | end
116 | elseif weaponCat == 'SMG' then
117 | local weapon = nil
118 |
119 | for k,v in pairs(Config.Zones[zone].SMG) do
120 | if v.name == weaponName then
121 | weapon = v
122 | break
123 | end
124 | end
125 |
126 | if weapon then
127 | return weapon.price
128 | else
129 | return 0
130 | end
131 | elseif weaponCat == 'Shotgun' then
132 | local weapon = nil
133 |
134 | for k,v in pairs(Config.Zones[zone].Shotgun) do
135 | if v.name == weaponName then
136 | weapon = v
137 | break
138 | end
139 | end
140 |
141 | if weapon then
142 | return weapon.price
143 | else
144 | return 0
145 | end
146 | elseif weaponCat == 'Assault' then
147 | local weapon = nil
148 |
149 | for k,v in pairs(Config.Zones[zone].Assault) do
150 | if v.name == weaponName then
151 | weapon = v
152 | break
153 | end
154 | end
155 |
156 | if weapon then
157 | return weapon.price
158 | else
159 | return 0
160 | end
161 | elseif weaponCat == 'LMG' then
162 | local weapon = nil
163 |
164 | for k,v in pairs(Config.Zones[zone].LMG) do
165 | if v.name == weaponName then
166 | weapon = v
167 | break
168 | end
169 | end
170 |
171 | if weapon then
172 | return weapon.price
173 | else
174 | return 0
175 | end
176 | elseif weaponCat == 'Sniper' then
177 | local weapon = nil
178 |
179 | for k,v in pairs(Config.Zones[zone].Sniper) do
180 | if v.name == weaponName then
181 | weapon = v
182 | break
183 | end
184 | end
185 |
186 | if weapon then
187 | return weapon.price
188 | else
189 | return 0
190 | end
191 | end
192 | end
193 |
--------------------------------------------------------------------------------
/esx_extraitems/README.md:
--------------------------------------------------------------------------------
1 | # About esx_extraitems:
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * Code was pulled from various Scripts out there. Credits have been Given.
6 | * Has Ammo Boxes, Bandages, Binoculars, Bullet-Proof Vest, Dark Net, Defib, Drill, First Aid Kit, Lock Pick, Oxygen Mask, Repair Kit, Tire Kit, Vehicle GPS, Weapon Kit.
7 | * Now using 2 Different Types of Ammo Boxes.
8 | * Advanced Ammo Boxes require players to purchase specific Ammo Boxes for their Guns. So if you need Pistol Ammo you must buy a Ammo Box Pistol.
9 | * Simple Ammo Boxes doesn't require players to purchase specific Ammo Boxes for their Guns. However there are 2 different sizes.
10 | * Defib & Lock Pick use a chance system. Example: If lock pick fails you lose your lock pick.
11 |
12 | # Requirements:
13 | * Required:
14 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
15 | * [esx_shops]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_shops )
16 | * Optional:
17 | * NONE
18 |
19 | # Download & Installation:
20 | 1) Pick which SQL you want to use:
21 | 1.1) If you want to use Advanced Ammo Boxes Import `esx_extraitems_advammo.sql` in your database
22 | 1.2) If you want to use Simple Ammo Boxes Import `esx_extraitems_simammo.sql` in your database
23 | 1.3) If you are using the new `esx_shops` please use `esx_shops.lua` on adding items
24 | 2) Place `esx_extraitems` in your ESX Directory
25 | 3) Add `start esx_extraitems` to your server.cfg
26 | 4) Edit the `config.lua` to your liking
27 |
28 | # How to add Stuff to your Shops:
29 | 1) Depending on which Ammo Boxes you picked edit that SQL and go to the INSERT INTO `shops`
30 | 2) On the ones Marked `ExtraItemsShop` change them to the Shops that you want.
31 | 3) Import the Modified SQL to your DB.
32 |
33 | # Credits/Original Code:
34 | * [StockholmCityRP]( https://github.com/StockholmCityRP )
35 | * [esx_extraitems]( https://github.com/StockholmCityRP/esx_extraitems )
36 | * [Vanheden]( https://github.com/Vanheden )
37 | * [esx_borrmaskin]( https://github.com/Vanheden/esx_borrmaskin )
38 | * [Manups4e]( https://github.com/manups4e )
39 | * [esx_weashops_with_munitions]( https://github.com/manups4e/esx_weashops_with_munitions )
40 | * [ESX-PUBLIC]( https://github.com/ESX-PUBLIC )
41 | * [eden_darknet]( https://github.com/ESX-PUBLIC/eden_darknet )
42 | * [Clementinise]( https://github.com/clementinise )
43 | * [esx_repairkit]( https://github.com/clementinise/esx_repairkit )
44 | * [bzisniper]( https://forum.cfx.re/u/bzisniper/summary )
45 | * [Standalone Firework Box on Ground]( https://forum.cfx.re/t/standalone-firework-box-on-ground/1407408 )
46 |
--------------------------------------------------------------------------------
/esx_extraitems/esx_shops.lua:
--------------------------------------------------------------------------------
1 | {name = 'darknet', label = 'Dark Net', price = 25},
2 | {name = 'bandage', label = 'Bandage', price = 2},
3 | {name = 'binoculars', label = 'Binoculars', price = 10},
4 | {name = 'bulletproof', label = 'Bullet-Proof Vest', price = 300},
5 | {name = 'cleankit', label = 'Cleaning Kit', price = 5},
6 | {name = 'defib', label = 'Defib', price = 600},
7 | {name = 'drill', label = 'Drill', price = 180},
8 | {name = 'firework', label = 'Firework', price = 15},
9 | {name = 'firstaidkit', label = 'First Aid Kit', price = 5},
10 | {name = 'handcuffs', label = 'Handcuffs', price = 27},
11 | {name = 'handcuffkey', label = 'Handcuff Key', price = 5},
12 | {name = 'lockpick', label = 'Lock Pick', price = 20},
13 | {name = 'oxygenmask', label = 'Oxygen Mask', price = 400},
14 | {name = 'repairkit', label = 'Repair Kit', price = 250},
15 | {name = 'tirekit', label = 'Tire Kit', price = 20},
16 | {name = 'vape', label = 'Vape', price = 50},
17 | {name = 'vehgps', label = 'Vehicle GPS', price = 100},
18 | {name = 'weakit', label = 'Weapon Kit', price = 75},
19 |
20 | -- Simple Ammo
21 | {name = 'boxbig', label = 'Ammo Box Big', price = 60},
22 | {name = 'boxsmall', label = 'Ammo Box Small', price = 25},
23 |
24 | -- Advanced Ammo
25 | {name = 'boxpistol', label = 'Ammo Box Pistol', price = 14},
26 | {name = 'boxsmg', label = 'Ammo Box SMG', price = 14},
27 | {name = 'boxshot', label = 'Ammo Box Shotgun', price = 9},
28 | {name = 'boxrifle', label = 'Ammo Box Rifle', price = 12},
29 | {name = 'boxmg', label = 'Ammo Box MG', price = 24},
30 | {name = 'boxsniper', label = 'Ammo Box Sniper', price = 21},
31 | {name = 'boxflare', label = 'Ammo Box Flare', price = 10},
32 |
--------------------------------------------------------------------------------
/esx_extraitems/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Extra Items'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | 'server/main.lua'
20 | }
21 |
22 | client_scripts {
23 | 'client/main.lua',
24 | 'client/menus.lua'
25 | }
26 |
27 | dependencies {
28 | 'es_extended',
29 | --'esx_shops'
30 | }
31 |
--------------------------------------------------------------------------------
/esx_extraitems/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales ['en'] = {
2 | -- Used Notifications
3 | ['used_bandage'] = 'you have used ~y~1x~s~ ~b~Bandage~s~',
4 | ['used_bulletproof'] = 'you have used ~y~1x~s~ ~b~Bullet-Proof Vest~s~',
5 | ['used_defib'] = 'you have used ~y~1x~s~ ~b~Defib~s~',
6 | ['used_drill'] = 'you have used ~y~1x~s~ ~b~Drill~s~',
7 | ['used_firework'] = 'you have used ~y~1x~s~ ~b~Firework~s~',
8 | ['used_firstaidkit'] = 'you have used ~y~1x~s~ ~b~First Aid Kit~s~',
9 | ['used_lockpick'] = 'you have used ~y~1x~s~ ~b~Lock Pick~s~',
10 | ['used_oxygenmask'] = 'you have used ~y~1x~s~ ~b~Oxygen Mask~s~',
11 | ['used_cleankit'] = 'you have used ~y~1x~s~ ~b~Cleaning Kit~s~',
12 | ['used_repairkit'] = 'you have used ~y~1x~s~ ~b~Repair Kit~s~',
13 | ['used_tirekit'] = 'you have used ~y~1x~s~ ~b~Tire Kit~s~',
14 | ['used_vape'] = 'you have taken a Hit off Your Vape',
15 | ['used_weakit'] = 'you have used ~y~1x~s~ ~b~Weapon Kit~s~',
16 | ['used_boxpistol'] = 'you have used ~y~1x~s~ ~b~Ammo Box Pistol~s~',
17 | ['used_boxsmg'] = 'you have used ~y~1x~s~ ~b~Ammo Box SMG~s~',
18 | ['used_boxshot'] = 'you have used ~y~1x~s~ ~b~Ammo Box Shotgun~s~',
19 | ['used_boxrifle'] = 'you have used ~y~1x~s~ ~b~Ammo Box Rifle~s~',
20 | ['used_boxmg'] = 'you have used ~y~1x~s~ ~b~Ammo Box MG~s~',
21 | ['used_boxsniper'] = 'you have used ~y~1x~s~ ~b~Ammo Box Sniper~s~',
22 | ['used_boxflare'] = 'you have used ~y~1x~s~ ~b~Ammo Box Flare~s~',
23 | ['used_boxbig'] = 'you have used ~y~1x~s~ ~b~Ammo Box Big~s~',
24 | ['used_boxsmall'] = 'you have used ~y~1x~s~ ~b~Ammo Box Small~s~',
25 | -- Dark Net
26 | ['phone_darknet'] = 'Dark Net',
27 | -- Defib
28 | ['defib_worked'] = 'Defib Worked!',
29 | ['defib_failed'] = 'Defib Failed!',
30 | ['player_not_unconscious'] = 'That player is not Unconscious!',
31 | -- Oxygen Mask
32 | ['dive_suit_on'] = 'You put on the diving mask & secure the oxygen tank. Oxygen level: ~g~100~w~',
33 | ['oxygen_notify'] = 'Remaining ~b~oxygen~y~ in the tank: %s%s~w~',
34 | ['oxygen_failed'] = 'You are already wearing an Oxygen Mask!',
35 | -- Clean Kit
36 | ['clean_done'] = '~g~You have Cleaned the Vehicle.',
37 | -- Repair Kit
38 | ['repair_done'] = '~g~You have Repaired the Vehicle.',
39 | -- Tire Kit
40 | ['tire_done'] = '~g~You have changed the tire of the Vehicle.',
41 | -- Ammo Boxes
42 | ['no_weapon'] = 'You do not have a weapon in your hand.',
43 | ['not_suitable'] = 'These ammunitions are not suitable for this weapon.',
44 | -- Life Raft
45 | ['life_raft_use'] = 'press ~INPUT_CONTEXT~ to Pack Up the ~y~Life Raft~s~',
46 | ['life_raft_unpack'] = '~g~You have Unpacked the Life Raft.',
47 | ['life_raft_pack'] = '~g~You have Packed Up the Life Raft.',
48 | ['must_water'] = '~r~You must be in water to do this.',
49 | -- Lock Pick
50 | ['veh_unlocked'] = '~g~Vehicle Unlocked.',
51 | ['hijack_failed'] = '~r~Hijack Failed.',
52 | -- Vehicle GPS
53 | ['gps_installed'] = '~g~You have installed a Vehicle GPS.',
54 | ['gps_removed'] = '~r~You have uninstalled a Vehicle GPS.',
55 | ['gps_no_vehicle'] = '~r~There is no Vehicle to install a GPS!',
56 | ['gps_not_correct'] = '~r~You can only install GPSs in Aircrafts, Boats, & Cars!',
57 | -- Shared
58 | ['error_veh'] = '~r~You can\'t use this Item in a Vehicle.',
59 | ['error_no_veh'] = '~r~There is no Vehicle Nearby.',
60 | ['error_no_tire'] = '~r~There is no Vehicle Tire Nearby.',
61 | ['error_no_foot'] = '~r~You are not on Foot.',
62 | ['error_no_ped'] = '~r~There is no Player Nearby.',
63 | ['not_correct_wea'] = '~r~You don\'t have the correct weapon out.',
64 | ['player_cannot_hold'] = '~r~You can\'t hold anymore %s.',
65 | ['player_no'] = '~r~You don\'t have any %s.',
66 | ['already_using'] = '~r~Already Using this Item. Please Wait!',
67 | -- Weapon Menus
68 | ['weapon_menu'] = 'Weapon Menu',
69 | ['comp_menu'] = 'Components',
70 | ['upgrade_menu'] = 'Upgrades',
71 | ['para_menu'] = 'Parachutes',
72 | ['para_main'] = 'Give Parachutes',
73 | ['para_main_0'] = 'Rainbow ',
74 | ['para_main_1'] = 'Red',
75 | ['para_main_2'] = 'Seaside Stripes',
76 | ['para_main_3'] = 'Widowmaker',
77 | ['para_main_4'] = 'Patriot',
78 | ['para_main_5'] = 'Blue',
79 | ['para_main_6'] = 'Black',
80 | ['para_main_7'] = 'Hornet',
81 | ['para_main_8'] = 'Air Force',
82 | ['para_main_9'] = 'Desert',
83 | ['para_main_10'] = 'Shadow',
84 | ['para_main_11'] = 'High Altitude',
85 | ['para_main_12'] = 'Airborne',
86 | ['para_main_13'] = 'Sunrise',
87 | ['para_main_set'] = 'Parachute set to: %s ',
88 | ['para_trails'] = 'Parachute Trails',
89 | ['para_trails_red'] = 'Red',
90 | ['para_trails_green'] = 'Green',
91 | ['para_trails_blue'] = 'Blue',
92 | ['para_trails_orange'] = 'Orange',
93 | ['para_trails_black'] = 'Black',
94 | ['para_trails_white'] = 'White',
95 | ['para_trails_rgb'] = 'RGB',
96 | ['para_trails_r'] = 'Set Red Color | 0 - 255',
97 | ['para_trails_g'] = 'Set Green Color | 0 - 255',
98 | ['para_trails_b'] = 'Set Blue Color | 0 - 255',
99 | ['para_trails_set'] = 'Smoke Trail set to: %s ',
100 | ['comp_menu_list1'] = 'Weapons that can be Modified',
101 | ['comp_menu_list2'] = 'Which Components would you like to Install/Uninstall',
102 | ['upgrade_menu_list1'] = 'Weapons that can be Upgraded',
103 | ['upgrade_menu_list2'] = 'Are you sure you want to Upgrade?',
104 | ['melee_menu'] = 'Melee Menu',
105 | ['pistol_menu'] = 'Pistols Menu',
106 | ['smg_menu'] = 'SMGs Menu',
107 | ['shot_menu'] = 'Shotguns Menu',
108 | ['ar_menu'] = 'Assault Rilfes Menu',
109 | ['mg_menu'] = 'Machine Guns Menu',
110 | ['sniper_menu'] = 'Sniper Rifles Menu',
111 | ['skin_menu'] = 'Skin Menu',
112 | ['uni_skins'] = 'Universal Skin Menu',
113 | ['wea_owned'] = 'Owned',
114 | ['wea_not_owned'] = 'Not Owned',
115 | ['comp_install'] = 'Installed',
116 | ['comp_not_install'] = 'Not Installed',
117 | ['comp_installed'] = '~g~Component was Installed',
118 | ['comp_installed_fail'] = '~r~Component Failed to Install',
119 | ['comp_uninstalled'] = '~g~Component was Uninstalled',
120 | ['comp_uninstalled_fail'] = '~r~Component Failed to Uninstall',
121 | ['wea_upgraded'] = 'Weapon has been Upgrade to MK2',
122 | ['wea_upgrade_fail'] = 'Weapon Upgrade has Failed',
123 | ['not_owned'] = '~r~You don\'t own this Weapon!',
124 | ['comp_already'] = '~g~You already have this Weapon Attachment Installed.',
125 | -- Tints
126 | ['tint_default'] = 'Default Skin',
127 | ['tint_green'] = 'Green Skin',
128 | ['tint_gold'] = 'Gold Skin',
129 | ['tint_pink'] = 'Pink Skin',
130 | ['tint_army'] = 'Army Skin',
131 | ['tint_lspd'] = 'Blue Skin',
132 | ['tint_orange'] = 'Orange Skin',
133 | ['tint_platinum'] = 'Platinum Skin',
134 | -- Other
135 | ['yes'] = 'Yes',
136 | ['no'] = 'No',
137 | }
138 |
--------------------------------------------------------------------------------
/esx_extraitems/sqls/esx_extraitems_advammo.sql:
--------------------------------------------------------------------------------
1 | USE `es_extended`;
2 |
3 | INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
4 | ('darknet', 'Dark Net', 1, 0, 1),
5 | ('bandage', 'Bandage', 1, 0, 1),
6 | ('binoculars', 'Binoculars', 1, 0, 1),
7 | ('boxpistol', 'Ammo Box Pistol', 1, 0, 1),
8 | ('boxsmg', 'Ammo Box SMG', 1, 0, 1),
9 | ('boxshot', 'Ammo Box Shotgun', 1, 0, 1),
10 | ('boxrifle', 'Ammo Box Rifle', 1, 0, 1),
11 | ('boxmg', 'Ammo Box MG', 1, 0, 1),
12 | ('boxsniper', 'Ammo Box Sniper', 1, 0, 1),
13 | ('boxflare', 'Ammo Box Flare', 1, 0, 1),
14 | ('bulletproof', 'Bullet-Proof Vest', 1, 0, 1),
15 | ('cleankit', 'Cleaning Kit', 1, 0, 1),
16 | ('defib', 'Defib', 1, 0, 1),
17 | ('drill', 'Drill', 1, 0, 1),
18 | ('firework', 'Firework', 1, 0, 1),
19 | ('firstaidkit', 'First Aid Kit', 1, 0, 1),
20 | ('handcuffs', 'Handcuffs', 1, 0, 1),
21 | ('handcuffkey', 'Handcuff Keys', 1, 0, 1),
22 | ('lockpick', 'Lock Pick', 1, 0, 1),
23 | ('oxygenmask', 'Oxygen Mask', 1, 0, 1),
24 | ('repairkit', 'Repair Kit', 1, 0, 1),
25 | ('tirekit', 'Tire Kit', 1, 0, 1),
26 | ('vape', 'Vape', 1, 0, 1),
27 | ('vehgps', 'Vehicle GPS', 1, 0, 1),
28 | ('weakit', 'Weapon Kit', 1, 0, 1)
29 | ;
30 |
31 | INSERT INTO `shops` (store, item, price) VALUES
32 | ('ExtraItemsShop', 'darknet', 25),
33 | ('ExtraItemsShop', 'bandage', 2),
34 | ('ExtraItemsShop', 'binoculars', 10),
35 | ('ExtraItemsShop', 'boxpistol', 14),
36 | ('ExtraItemsShop', 'boxsmg', 14),
37 | ('ExtraItemsShop', 'boxshot', 9),
38 | ('ExtraItemsShop', 'boxrifle', 12),
39 | ('ExtraItemsShop', 'boxmg', 24),
40 | ('ExtraItemsShop', 'boxsniper', 21),
41 | ('ExtraItemsShop', 'boxflare', 10),
42 | ('ExtraItemsShop', 'bulletproof', 300),
43 | ('ExtraItemsShop', 'cleankit', 5),
44 | ('ExtraItemsShop', 'defib', 1200),
45 | ('ExtraItemsShop', 'drill', 180),
46 | ('ExtraItemsShop', 'firework', 15),
47 | ('ExtraItemsShop', 'firstaidkit', 80),
48 | ('ExtraItemsShop', 'handcuffs', 27),
49 | ('ExtraItemsShop', 'handcuffkey', 5),
50 | ('ExtraItemsShop', 'lockpick', 20),
51 | ('ExtraItemsShop', 'oxygenmask', 400),
52 | ('ExtraItemsShop', 'repairkit', 150),
53 | ('ExtraItemsShop', 'tirekit', 25),
54 | ('ExtraItemsShop', 'vape', 50),
55 | ('ExtraItemsShop', 'vehgps', 25),
56 | ('ExtraItemsShop', 'weakit', 75)
57 | ;
58 |
--------------------------------------------------------------------------------
/esx_extraitems/sqls/esx_extraitems_simammo.sql:
--------------------------------------------------------------------------------
1 | USE `es_extended`;
2 |
3 | INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
4 | ('darknet', 'Dark Net', 1, 0, 1),
5 | ('bandage', 'Bandage', 1, 0, 1),
6 | ('binoculars', 'Binoculars', 1, 0, 1),
7 | ('boxbig', 'Ammo Box Big', 1, 0, 1),
8 | ('boxsmall', 'Ammo Box Small', 1, 0, 1),
9 | ('bulletproof', 'Bullet-Proof Vest', 1, 0, 1),
10 | ('cleankit', 'Cleaning Kit', 1, 0, 1),
11 | ('defib', 'Defib', 1, 0, 1),
12 | ('drill', 'Drill', 1, 0, 1),
13 | ('firework', 'Firework', 1, 0, 1),
14 | ('firstaidkit', 'First Aid Kit', 1, 0, 1),
15 | ('handcuffs', 'Handcuffs', 1, 0, 1),
16 | ('handcuffkey', 'Handcuff Keys', 1, 0, 1),
17 | ('lockpick', 'Lock Pick', 1, 0, 1),
18 | ('oxygenmask', 'Oxygen Mask', 1, 0, 1),
19 | ('repairkit', 'Repair Kit', 1, 0, 1),
20 | ('tirekit', 'Tire Kit', 1, 0, 1),
21 | ('vape', 'Vape', 1, 0, 1),
22 | ('vehgps', 'Vehicle GPS', 1, 0, 1),
23 | ('weakit', 'Weapon Kit', 1, 0, 1)
24 | ;
25 |
26 | INSERT INTO `shops` (store, item, price) VALUES
27 | ('ExtraItemsShop', 'darknet', 25),
28 | ('ExtraItemsShop', 'bandage', 2),
29 | ('ExtraItemsShop', 'binoculars', 10),
30 | ('ExtraItemsShop', 'boxbig', 60),
31 | ('ExtraItemsShop', 'boxsmall', 25),
32 | ('ExtraItemsShop', 'bulletproof', 300),
33 | ('ExtraItemsShop', 'cleankit', 5),
34 | ('ExtraItemsShop', 'defib', 1200),
35 | ('ExtraItemsShop', 'drill', 180),
36 | ('ExtraItemsShop', 'firework', 15),
37 | ('ExtraItemsShop', 'firstaidkit', 80),
38 | ('ExtraItemsShop', 'handcuffs', 27),
39 | ('ExtraItemsShop', 'handcuffkey', 5),
40 | ('ExtraItemsShop', 'lockpick', 20),
41 | ('ExtraItemsShop', 'oxygenmask', 400),
42 | ('ExtraItemsShop', 'repairkit', 150),
43 | ('ExtraItemsShop', 'tirekit', 25),
44 | ('ExtraItemsShop', 'vape', 50),
45 | ('ExtraItemsShop', 'vehgps', 25),
46 | ('ExtraItemsShop', 'weakit', 75)
47 | ;
48 |
--------------------------------------------------------------------------------
/esx_joblisting/README.md:
--------------------------------------------------------------------------------
1 | # About esx_joblisting
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * You can specify what jobs you want to be whitelisted in the Database.
6 | * You can allow players to become their Whitelisted Jobs through the Job Marker.
7 |
8 | # Requirements:
9 | * Required:
10 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
11 | * Optional:
12 | * NONE
13 |
14 | # Download & Installation:
15 | 1) Import `esx_joblisting.sql` in your database
16 | 2) Place `esx_joblisting` in your ESX Directory
17 | 3) Add `start esx_joblisting` to your server.cfg
18 | 4) Edit the `config.lua` to your liking
19 |
20 | # Credits/Original Code:
21 | * [ESX-Framework]( https://github.com/esx-framework )
22 | * [esx_joblisting]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_joblisting )
23 | * The ideal was from esx_JobWhitelisting which is no longer being supported.
24 |
--------------------------------------------------------------------------------
/esx_joblisting/client/main.lua:
--------------------------------------------------------------------------------
1 | local CurrentActionData = {}
2 | local HasAlreadyEnteredMarker, IsInMainMenu = false, false
3 | local LastZone, CurrentAction, CurrentActionMsg
4 |
5 | RegisterNetEvent('esx:playerLoaded')
6 | AddEventHandler('esx:playerLoaded', function(xPlayer)
7 | ESX.PlayerData = xPlayer
8 | end)
9 |
10 | RegisterNetEvent('esx:setJob')
11 | AddEventHandler('esx:setJob', function(job)
12 | ESX.PlayerData.job = job
13 | end)
14 |
15 | -- Show Job Menu
16 | function ShowJobListingMenu()
17 | IsInMainMenu = true
18 | ESX.TriggerServerCallback('esx_joblisting:getJobsList', function(jobs)
19 | local elements = {}
20 |
21 | for i=1, #jobs, 1 do
22 | table.insert(elements, {
23 | label = jobs[i].label,
24 | job = jobs[i].job
25 | })
26 | end
27 |
28 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'joblisting', {
29 | title = _U('job_center'),
30 | align = GetConvar('esx_MenuAlign', 'top-left'),
31 | elements = elements
32 | }, function(data, menu)
33 | TriggerServerEvent('esx_joblisting:setJob', data.current.job)
34 | ESX.ShowNotification(_U('new_job'))
35 | IsInMainMenu = false
36 | menu.close()
37 | end, function(data, menu)
38 | IsInMainMenu = false
39 | menu.close()
40 | CurrentAction = 'job_menu'
41 | CurrentActionData = {}
42 | end)
43 | end)
44 | end
45 |
46 | -- Entered Marker
47 | AddEventHandler('esx_joblisting:hasEnteredMarker', function(zone)
48 | if zone == 'JobLocs' then
49 | CurrentAction = 'job_menu'
50 | CurrentActionMsg = _U('job_menu')
51 | CurrentActionData = {}
52 | end
53 | end)
54 |
55 | -- Exited Marker
56 | AddEventHandler('esx_joblisting:hasExitedMarker', function(zone)
57 | if not IsInMainMenu or IsInMainMenu then
58 | ESX.UI.Menu.CloseAll()
59 | end
60 |
61 | CurrentAction = nil
62 | end)
63 |
64 | -- Resource Stop
65 | AddEventHandler('onResourceStop', function(resource)
66 | if resource == GetCurrentResourceName() then
67 | if IsInMainMenu then
68 | ESX.UI.Menu.CloseAll()
69 | end
70 | end
71 | end)
72 |
73 | -- Enter / Exit marker events & Draw Markers
74 | CreateThread(function()
75 | while true do
76 | Wait(0)
77 | local playerCoords = GetEntityCoords(PlayerPedId())
78 | local isInMarker, letSleep, currentZone = false, true, nil
79 |
80 | for k,v in ipairs(Config.Locs) do
81 | local distance = #(playerCoords - v)
82 |
83 | if distance < Config.DrawDistance then
84 | letSleep = false
85 |
86 | if Config.Marker.Type ~= -1 then
87 | DrawMarker(Config.Marker.Type, v, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, 100, false, true, 2, false, nil, nil, false)
88 | end
89 |
90 | if distance < Config.Marker.x then
91 | isInMarker, currentZone = true, 'JobLocs'
92 | end
93 | end
94 | end
95 |
96 | if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then
97 | HasAlreadyEnteredMarker, LastZone = true, currentZone
98 | LastZone = currentZone
99 | TriggerEvent('esx_joblisting:hasEnteredMarker', currentZone)
100 | end
101 |
102 | if not isInMarker and HasAlreadyEnteredMarker then
103 | HasAlreadyEnteredMarker = false
104 | TriggerEvent('esx_joblisting:hasExitedMarker', LastZone)
105 | end
106 |
107 | if letSleep then
108 | Wait(500)
109 | end
110 | end
111 | end)
112 |
113 | -- Create blips
114 | CreateThread(function()
115 | for k,v in ipairs(Config.Locs) do
116 | local blip = AddBlipForCoord(v)
117 | SetBlipSprite(blip, 407)
118 | SetBlipDisplay(blip, 4)
119 | SetBlipScale(blip, 1.2)
120 | SetBlipColour(blip, 27)
121 | SetBlipAsShortRange(blip, true)
122 | BeginTextCommandSetBlipName('STRING')
123 | AddTextComponentSubstringPlayerName(_U('job_center'))
124 | EndTextCommandSetBlipName(blip)
125 | end
126 | end)
127 |
128 | -- Menu Controls
129 | CreateThread(function()
130 | while true do
131 | Wait(0)
132 |
133 | if CurrentAction then
134 | ESX.ShowHelpNotification(CurrentActionMsg)
135 |
136 | if IsControlJustReleased(0, 38) then
137 | if CurrentAction == 'job_menu' then
138 | ShowJobListingMenu()
139 | end
140 |
141 | CurrentAction = nil
142 | end
143 | else
144 | Wait(500)
145 | end
146 | end
147 | end)
148 |
--------------------------------------------------------------------------------
/esx_joblisting/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 |
4 | Config.DrawDistance = 20 -- Marker Draw Distance.
5 | Config.Marker = {Type = 1, r = 102, g = 102, b = 204, x = 1.5, y = 1.5, z = 1.0} -- Marker Settings.
6 |
7 | Config.Locs = {
8 | vector3(198.13, -935.85, 29.69)
9 | }
10 |
--------------------------------------------------------------------------------
/esx_joblisting/esx_joblisting.sql:
--------------------------------------------------------------------------------
1 | USE `es_extended`;
2 |
3 | ALTER TABLE jobs add whitelisted BOOLEAN NOT NULL DEFAULT FALSE;
4 |
5 | ALTER TABLE `users`
6 | ADD `leo_rank` int(11) NULL DEFAULT '-1',
7 | ADD `ems_rank` int(11) NULL DEFAULT '-1',
8 | ADD `tow_rank` int(11) NULL DEFAULT '-1',
9 | ADD `fish_rank` int(11) NULL DEFAULT '0',
10 | ADD `fuel_rank` int(11) NULL DEFAULT '0',
11 | ADD `lumb_rank` int(11) NULL DEFAULT '0',
12 | ADD `mine_rank` int(11) NULL DEFAULT '0',
13 | ADD `butch_rank` int(11) NULL DEFAULT '0',
14 | ADD `tail_rank` int(11) NULL DEFAULT '0',
15 | ADD `taxi_rank` int(11) NULL DEFAULT '0'
16 | ;
--------------------------------------------------------------------------------
/esx_joblisting/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Job Listing'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@oxmysql/lib/MySQL.lua',
20 | 'server/main.lua'
21 | }
22 |
23 | client_scripts {
24 | 'client/main.lua'
25 | }
26 |
27 | dependencies {
28 | 'es_extended'
29 | }
30 |
--------------------------------------------------------------------------------
/esx_joblisting/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | ['job_menu'] = 'Press ~INPUT_CONTEXT~ to Access ~b~Job Center~s~.',
3 | ['job_center'] = 'Job Center',
4 | ['new_job'] = 'You have a NEW Job!',
5 | }
6 |
--------------------------------------------------------------------------------
/esx_joblisting/server/main.lua:
--------------------------------------------------------------------------------
1 | local availableJobs = {}
2 |
3 | -- Get Job List
4 | ESX.RegisterServerCallback('esx_joblisting:getJobsList', function(source, cb)
5 | local _source = source
6 | local xPlayer = ESX.GetPlayerFromId(_source)
7 | local identifier2 = GetPlayerIdentifiers(source)[1]
8 | local identifier = xPlayer.identifier
9 |
10 | MySQL.query('SELECT name, label FROM jobs WHERE whitelisted = @whitelisted', {
11 | ['@whitelisted'] = false
12 | }, function(result)
13 | local availableJobs = {}
14 |
15 | for i=1, #result, 1 do
16 | table.insert(availableJobs, {
17 | job = result[i].name,
18 | label = result[i].label
19 | })
20 | end
21 |
22 | getPlayerData(source, function(data)
23 | if data.fish > -1 then
24 | table.insert(availableJobs, {job = 'fisherman', label = 'Fisherman'})
25 | end
26 |
27 | if data.fuel > -1 then
28 | table.insert(availableJobs, {job = 'fueler', label = 'Fueler'})
29 | end
30 |
31 | if data.lumb > -1 then
32 | table.insert(availableJobs, {job = 'lumberjack', label = 'Lumberjack'})
33 | end
34 |
35 | if data.mine > -1 then
36 | table.insert(availableJobs, {job = 'miner', label = 'Miner'})
37 | end
38 |
39 | if data.butch > -1 then
40 | table.insert(availableJobs, {job = 'slaughterer', label = 'Butcher'})
41 | end
42 |
43 | if data.tail > -1 then
44 | table.insert(availableJobs, {job = 'tailor', label = 'Tailor'})
45 | end
46 |
47 | if data.taxi > -1 then
48 | table.insert(availableJobs, {job = 'taxi', label = 'Taxi'})
49 | end
50 |
51 | if data.leo > -1 then
52 | table.insert(availableJobs, {job = 'police', label = 'Policing'})
53 | end
54 |
55 | if data.ems > -1 then
56 | table.insert(availableJobs, {job = 'ambulance', label = 'Fire/Rescue'})
57 | end
58 |
59 | if data.tow > -1 then
60 | table.insert(availableJobs, {job = 'mechanic', label = 'Mechanic'})
61 | end
62 |
63 | cb(availableJobs)
64 | end)
65 | end)
66 | end)
67 |
68 | -- Set Job
69 | RegisterServerEvent('esx_joblisting:setJob')
70 | AddEventHandler('esx_joblisting:setJob', function(job)
71 | local _source = source
72 | local xPlayer = ESX.GetPlayerFromId(_source)
73 |
74 | MySQL.query('SELECT whitelisted FROM jobs WHERE name = @name', {
75 | ['@name'] = job
76 | }, function(result)
77 | if not result[1].whitelisted then
78 | xPlayer.setJob(job, 0)
79 | elseif job == 'fisherman' then
80 | getPlayerData2(xPlayer.identifier, function(data)
81 | if data.fish then
82 | xPlayer.setJob(job, data.fish)
83 | else
84 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
85 | end
86 | end)
87 | elseif job == 'fueler' then
88 | getPlayerData2(xPlayer.identifier, function(data)
89 | if data.fuel then
90 | xPlayer.setJob(job, data.fuel)
91 | else
92 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
93 | end
94 | end)
95 | elseif job == 'lumberjack' then
96 | getPlayerData2(xPlayer.identifier, function(data)
97 | if data.lumb then
98 | xPlayer.setJob(job, data.lumb)
99 | else
100 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
101 | end
102 | end)
103 | elseif job == 'miner' then
104 | getPlayerData2(xPlayer.identifier, function(data)
105 | if data.mine then
106 | xPlayer.setJob(job, data.mine)
107 | else
108 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
109 | end
110 | end)
111 | elseif job == 'slaughterer' then
112 | getPlayerData2(xPlayer.identifier, function(data)
113 | if data.butch then
114 | xPlayer.setJob(job, data.butch)
115 | else
116 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
117 | end
118 | end)
119 | elseif job == 'tailor' then
120 | getPlayerData2(xPlayer.identifier, function(data)
121 | if data.tail then
122 | xPlayer.setJob(job, data.tail)
123 | else
124 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
125 | end
126 | end)
127 | elseif job == 'taxi' then
128 | getPlayerData2(xPlayer.identifier, function(data)
129 | if data.taxi then
130 | xPlayer.setJob(job, data.taxi)
131 | else
132 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
133 | end
134 | end)
135 | elseif job == 'police' then
136 | getPlayerData2(xPlayer.identifier, function(data)
137 | if data.leo then
138 | xPlayer.setJob(job, data.leo)
139 | else
140 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
141 | end
142 | end)
143 | elseif job == 'ambulance' then
144 | getPlayerData2(xPlayer.identifier, function(data)
145 | if data.ems then
146 | xPlayer.setJob(job, data.ems)
147 | else
148 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
149 | end
150 | end)
151 | elseif job == 'mechanic' then
152 | getPlayerData2(xPlayer.identifier, function(data)
153 | if data.tow then
154 | xPlayer.setJob(job, data.tow)
155 | else
156 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
157 | end
158 | end)
159 | else
160 | print(('esx_joblisting: %s Attempted to SET a Whitelisted Job! (LUA Injector)'):format(xPlayer.identifier))
161 | end
162 | end)
163 | end)
164 |
165 | -- getPlayerData
166 | function getPlayerData(source, cb)
167 | local xPlayer = ESX.GetPlayerFromId(source)
168 | local result = MySQL.query.await('SELECT `leo_rank`, `ems_rank`, `tow_rank`, `fish_rank`, `fuel_rank`, `lumb_rank`, `mine_rank`, `butch_rank`, `tail_rank`, `taxi_rank` FROM users WHERE identifier = ?', {xPlayer.identifier})
169 | local data = {
170 | leo = result.leo_rank,
171 | ems = result.ems_rank,
172 | tow = result.tow_rank,
173 | fish = result.fish_rank,
174 | fuel = result.fuel_rank,
175 | lumb = result.lumb_rank,
176 | mine = result.mine_rank,
177 | butch = result.butch_rank,
178 | tail = result.tail_rank,
179 | taxi = result.taxi_rank
180 | }
181 |
182 | cb(data)
183 | end
184 |
185 | -- getPlayerData2
186 | function getPlayerData2(identifier, cb)
187 | local result = MySQL.query.await('SELECT `leo_rank`, `ems_rank`, `tow_rank`, `fish_rank`, `fuel_rank`, `lumb_rank`, `mine_rank`, `butch_rank`, `tail_rank`, `taxi_rank` FROM users WHERE identifier = ?', {identifier})
188 | local data = {
189 | leo = result.leo_rank,
190 | ems = result.ems_rank,
191 | tow = result.tow_rank,
192 | fish = result.fish_rank,
193 | fuel = result.fuel_rank,
194 | lumb = result.lumb_rank,
195 | mine = result.mine_rank,
196 | butch = result.butch_rank,
197 | tail = result.tail_rank,
198 | taxi = result.taxi_rank
199 | }
200 |
201 | cb(data)
202 | end
203 |
--------------------------------------------------------------------------------
/esx_licenseshop/README.md:
--------------------------------------------------------------------------------
1 | # About esx_licenseshop:
2 | Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * This currently is setup for: esx_advancedvehicleshop, esx_advancedweaponshop, esx_dmvschool, esx_drugs, esx_vehicleshop, & esx_weaponshop.
6 |
7 | # Requirements:
8 | * Required:
9 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
10 | * Optional:
11 | * [esx_advancedvehicleshop]( https://github.com/HumanTree92/VENT_ESX_Scripts/tree/main/esx_advancedvehicleshop )
12 | * [esx_advancedweaponshop]( https://github.com/HumanTree92/VENT_ESX_Scripts/tree/main/esx_advancedweaponshop )
13 | * [esx_dmvschool]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_dmvschool )
14 | * [esx_drugs]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_drugs )
15 | * [esx_vehicleshop]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_vehicleshop )
16 | * [esx_weaponshop]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_weaponshop )
17 |
18 | # Download & Installation:
19 | 1) Place `esx_licenseshop` in your ESX Directory
20 | 2) Add `start esx_licenseshop` to your server.cfg
21 | 3) Edit the `config.lua` to your liking
22 |
23 | # Known Bugs:
24 | * If a new player gets their DMV License you will have to restart the License Shop or have the Player Re-Log. This can be fixed easily by adding a Resource Restarter to the esx_dmvschool when a player passes their Test. (This will not be added as this is a messy way of handling it.)
25 |
--------------------------------------------------------------------------------
/esx_licenseshop/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 |
4 | Config.DrawDistance = 10 -- Marker Draw Distance.
5 |
6 | Config.MarkerInfo = {Type = 1, r = 102, g = 102, b = 204, x = 2.0, y = 2.0, z = 1.0} -- Marker Settings.
7 | Config.Blip = {Sprite = 408, Color = 0, Display = 2, Scale = 1.0} -- Blip Settings.
8 |
9 | Config.UseBlips = false -- true = Use License Shop Blips
10 | Config.RequireDMV = false -- true = Will Require Players to have Drivers Permit to buy other Licenses.
11 | Config.AdvancedVehicleShop = false -- true = Using esx_advancedvehicleshop
12 | Config.AdvancedWeaponShop = false -- true = Using esx_advancedweaponshop
13 | Config.DMVSchool = false -- true = Using esx_dmvschool
14 | Config.SellDMV = false -- true = If 'Config.RequireDMV' = false & you want Players to be able to buy Drivers Permit.
15 | Config.Drugs = false -- true = Using esx_drugs
16 | Config.WeaponShop = false -- true = Using esx_weaponshop
17 |
18 | Config.Custom = {
19 | Licenses = false, -- true = If wanting to sell Custom Licenses.
20 | C1 = false, -- true= Using Custom License 1
21 | C1Name = 'change_me', -- Name must be LowerCase | Example: chemical
22 | C2 = false, -- true= Using Custom License 2
23 | C2Name = 'change_me', -- Name must be LowerCase | Example: chemical
24 | C3 = false, -- true= Using Custom License 3
25 | C3Name = 'change_me', -- Name must be LowerCase | Example: chemical
26 | C4 = false, -- true= Using Custom License 4
27 | C4Name = 'change_me', -- Name must be LowerCase | Example: chemical
28 | C5 = false, -- true= Using Custom License 5
29 | C5Name = 'change_me' -- Name must be LowerCase | Example: chemical
30 | }
31 |
32 | -- Prices of Licenses
33 | Config.Prices = {
34 | Aircraft = 10000,
35 | Boating = 50,
36 | Melee = 1,
37 | Handgun = 10,
38 | SMG = 100,
39 | Shotgun = 50,
40 | Assault = 250,
41 | LMG = 1000,
42 | Sniper = 1500,
43 | Commercial = 300,
44 | Drivers = 150,
45 | DriversP = 75,
46 | Motorcycle = 225,
47 | Weed = 10000,
48 | Weapon = 1000,
49 | -- Custom Licenses
50 | Custom1 = 1000,
51 | Custom2 = 1000,
52 | Custom3 = 1000,
53 | Custom4 = 1000,
54 | Custom5 = 1000
55 | }
56 |
57 | Config.Locs = {
58 | vector3(241.0, -1378.9, 32.7)
59 | }
60 |
--------------------------------------------------------------------------------
/esx_licenseshop/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX License Shop'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | '@oxmysql/lib/MySQL.lua',
20 | 'server/main.lua'
21 | }
22 |
23 | client_scripts {
24 | 'client/main.lua'
25 | }
26 |
27 | exports {
28 | 'openESXLicenseShop'
29 | }
30 |
31 | dependencies {
32 | 'es_extended'
33 | }
34 |
--------------------------------------------------------------------------------
/esx_licenseshop/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | ['dmv_school'] = 'Open DMV Testing',
3 | ['buy_license'] = 'Buy a License?',
4 | ['where_to_go'] = 'Pick where to Go',
5 | ['press_access'] = 'press ~INPUT_CONTEXT~ to access Licensing Menu',
6 | ['not_enough_money'] = 'you do not have enough money',
7 | ['blip_license_shop'] = 'License Shop',
8 | ['need_dmv'] = 'You must have a Drivers Permit',
9 | ['shop_menu_item'] = '$%s',
10 | -- esx_advancedvehicleshop Licenses
11 | ['license_aircraft'] = 'Aircraft License',
12 | ['license_boating'] = 'Boating License',
13 | -- esx_advancedweaponshop Licenses
14 | ['license_melee'] = 'Melee License',
15 | ['license_handgun'] = 'Handgun License',
16 | ['license_smg'] = 'SMG License',
17 | ['license_shotgun'] = 'Shotgun License',
18 | ['license_assault'] = 'Assault Rifle License',
19 | ['license_lmg'] = 'LMG License',
20 | ['license_sniper'] = 'Sniper Rifle License',
21 | -- esx_dmvschool Licenses
22 | ['license_commercial'] = 'Commercial License',
23 | ['license_drivers'] = 'Drivers License',
24 | ['license_driversp'] = 'Drivers Permit',
25 | ['license_motorcycle'] = 'Motorcycle License',
26 | -- esx_drugs Licenses
27 | ['license_weed'] = 'Weed License',
28 | -- esx_weashop Licenses
29 | ['license_weapon'] = 'Weapons License',
30 | -- Custom Licenses
31 | ['license_custom1'] = 'Custom License',
32 | ['license_custom2'] = 'Custom License',
33 | ['license_custom3'] = 'Custom License',
34 | ['license_custom4'] = 'Custom License',
35 | ['license_custom5'] = 'Custom License',
36 | }
37 |
--------------------------------------------------------------------------------
/esx_licenseshop/server/main.lua:
--------------------------------------------------------------------------------
1 | AddEventHandler('esx:playerLoaded', function(source)
2 | TriggerEvent('esx_license:getLicenses', source, function(licenses)
3 | TriggerClientEvent('esx_licenseshop:loadLicenses', source, licenses)
4 | end)
5 | end)
6 |
7 | function LoadLicenses(source)
8 | TriggerEvent('esx_license:getLicenses', source, function(licenses)
9 | TriggerClientEvent('esx_licenseshop:loadLicenses', source, licenses)
10 | end)
11 | end
12 |
13 | RegisterServerEvent('esx_licenseshop:ServerLoadLicenses')
14 | AddEventHandler('esx_licenseshop:ServerLoadLicenses', function()
15 | local _source = source
16 | LoadLicenses(_source)
17 | end)
18 |
19 | -- Buying License
20 | RegisterServerEvent('esx_licenseshop:buyLicense')
21 | AddEventHandler('esx_licenseshop:buyLicense', function(type)
22 | local _source = source
23 | local xPlayer = ESX.GetPlayerFromId(_source)
24 |
25 | if type == 'buy_license_aircraft' then
26 | local price = Config.Prices.Aircraft
27 |
28 | if xPlayer.getMoney() >= price then
29 | xPlayer.removeMoney(price)
30 |
31 | TriggerEvent('esx_license:addLicense', _source, 'aircraft', function()
32 | LoadLicenses(_source)
33 | end)
34 | else
35 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
36 | end
37 | elseif type == 'buy_license_boating' then
38 | local price = Config.Prices.Boating
39 |
40 | if xPlayer.getMoney() >= price then
41 | xPlayer.removeMoney(price)
42 |
43 | TriggerEvent('esx_license:addLicense', _source, 'boating', function()
44 | LoadLicenses(_source)
45 | end)
46 | else
47 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
48 | end
49 | elseif type == 'buy_license_melee' then
50 | local price = Config.Prices.Melee
51 |
52 | if xPlayer.getMoney() >= price then
53 | xPlayer.removeMoney(price)
54 |
55 | TriggerEvent('esx_license:addLicense', _source, 'weapon_melee', function()
56 | LoadLicenses(_source)
57 | end)
58 | else
59 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
60 | end
61 | elseif type == 'buy_license_handgun' then
62 | local price = Config.Prices.Handgun
63 |
64 | if xPlayer.getMoney() >= price then
65 | xPlayer.removeMoney(price)
66 |
67 | TriggerEvent('esx_license:addLicense', _source, 'weapon_handgun', function()
68 | LoadLicenses(_source)
69 | end)
70 | else
71 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
72 | end
73 | elseif type == 'buy_license_smg' then
74 | local price = Config.Prices.SMG
75 |
76 | if xPlayer.getMoney() >= price then
77 | xPlayer.removeMoney(price)
78 |
79 | TriggerEvent('esx_license:addLicense', _source, 'weapon_smg', function()
80 | LoadLicenses(_source)
81 | end)
82 | else
83 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
84 | end
85 | elseif type == 'buy_license_shotgun' then
86 | local price = Config.Prices.Shotgun
87 |
88 | if xPlayer.getMoney() >= price then
89 | xPlayer.removeMoney(price)
90 |
91 | TriggerEvent('esx_license:addLicense', _source, 'weapon_shotgun', function()
92 | LoadLicenses(_source)
93 | end)
94 | else
95 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
96 | end
97 | elseif type == 'buy_license_assault' then
98 | local price = Config.Prices.Assault
99 |
100 | if xPlayer.getMoney() >= price then
101 | xPlayer.removeMoney(price)
102 |
103 | TriggerEvent('esx_license:addLicense', _source, 'weapon_assault', function()
104 | LoadLicenses(_source)
105 | end)
106 | else
107 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
108 | end
109 | elseif type == 'buy_license_lmg' then
110 | local price = Config.Prices.LMG
111 |
112 | if xPlayer.getMoney() >= price then
113 | xPlayer.removeMoney(price)
114 |
115 | TriggerEvent('esx_license:addLicense', _source, 'weapon_lmg', function()
116 | LoadLicenses(_source)
117 | end)
118 | else
119 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
120 | end
121 | elseif type == 'buy_license_sniper' then
122 | local price = Config.Prices.Sniper
123 |
124 | if xPlayer.getMoney() >= price then
125 | xPlayer.removeMoney(price)
126 |
127 | TriggerEvent('esx_license:addLicense', _source, 'weapon_sniper', function()
128 | LoadLicenses(_source)
129 | end)
130 | else
131 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
132 | end
133 | elseif type == 'buy_license_commercial' then
134 | local price = Config.Prices.Commercial
135 |
136 | if xPlayer.getMoney() >= price then
137 | xPlayer.removeMoney(price)
138 |
139 | TriggerEvent('esx_license:addLicense', _source, 'drive_truck', function()
140 | LoadLicenses(_source)
141 | end)
142 | else
143 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
144 | end
145 | elseif type == 'buy_license_drivers' then
146 | local price = Config.Prices.Drivers
147 |
148 | if xPlayer.getMoney() >= price then
149 | xPlayer.removeMoney(price)
150 |
151 | TriggerEvent('esx_license:addLicense', _source, 'drive', function()
152 | LoadLicenses(_source)
153 | end)
154 | else
155 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
156 | end
157 | elseif type == 'buy_license_driversp' then
158 | local price = Config.Prices.DriversP
159 |
160 | if xPlayer.getMoney() >= price then
161 | xPlayer.removeMoney(price)
162 |
163 | TriggerEvent('esx_license:addLicense', _source, 'dmv', function()
164 | LoadLicenses(_source)
165 | end)
166 | else
167 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
168 | end
169 | elseif type == 'buy_license_motorcycle' then
170 | local price = Config.Prices.Motorcycle
171 |
172 | if xPlayer.getMoney() >= price then
173 | xPlayer.removeMoney(price)
174 |
175 | TriggerEvent('esx_license:addLicense', _source, 'drive_bike', function()
176 | LoadLicenses(_source)
177 | end)
178 | else
179 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
180 | end
181 | elseif type == 'buy_license_weed' then
182 | local price = Config.Prices.Weed
183 |
184 | if xPlayer.getMoney() >= price then
185 | xPlayer.removeMoney(price)
186 |
187 | TriggerEvent('esx_license:addLicense', _source, 'weed_processing', function()
188 | LoadLicenses(_source)
189 | end)
190 | else
191 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
192 | end
193 | elseif type == 'buy_license_weapon' then
194 | local price = Config.Prices.Weapon
195 |
196 | if xPlayer.getMoney() >= price then
197 | xPlayer.removeMoney(price)
198 |
199 | TriggerEvent('esx_license:addLicense', _source, 'weapon', function()
200 | LoadLicenses(_source)
201 | end)
202 | else
203 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
204 | end
205 | elseif type == 'buy_license_custom1' then
206 | local price = Config.Prices.Custom1
207 |
208 | if xPlayer.getMoney() >= price then
209 | xPlayer.removeMoney(price)
210 |
211 | TriggerEvent('esx_license:addLicense', _source, Config.Custom.C1Name, function()
212 | LoadLicenses(_source)
213 | end)
214 | else
215 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
216 | end
217 | elseif type == 'buy_license_custom2' then
218 | local price = Config.Prices.Custom2
219 |
220 | if xPlayer.getMoney() >= price then
221 | xPlayer.removeMoney(price)
222 |
223 | TriggerEvent('esx_license:addLicense', _source, Config.Custom.C2Name, function()
224 | LoadLicenses(_source)
225 | end)
226 | else
227 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
228 | end
229 | elseif type == 'buy_license_custom3' then
230 | local price = Config.Prices.Custom3
231 |
232 | if xPlayer.getMoney() >= price then
233 | xPlayer.removeMoney(price)
234 |
235 | TriggerEvent('esx_license:addLicense', _source, Config.Custom.C3Name, function()
236 | LoadLicenses(_source)
237 | end)
238 | else
239 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
240 | end
241 | elseif type == 'buy_license_custom4' then
242 | local price = Config.Prices.Custom4
243 |
244 | if xPlayer.getMoney() >= price then
245 | xPlayer.removeMoney(price)
246 |
247 | TriggerEvent('esx_license:addLicense', _source, Config.Custom.C4Name, function()
248 | LoadLicenses(_source)
249 | end)
250 | else
251 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
252 | end
253 | elseif type == 'buy_license_custom5' then
254 | local price = Config.Prices.Custom5
255 |
256 | if xPlayer.getMoney() >= price then
257 | xPlayer.removeMoney(price)
258 |
259 | TriggerEvent('esx_license:addLicense', _source, Config.Custom.C5Name, function()
260 | LoadLicenses(_source)
261 | end)
262 | else
263 | TriggerClientEvent('esx:showNotification', _source, _U('not_enough_money'))
264 | end
265 | end
266 | end)
267 |
--------------------------------------------------------------------------------
/esx_vehiclespawner/README.md:
--------------------------------------------------------------------------------
1 | # About esx_vehiclespawner:
2 | Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * Players able to spawn Vehicles/Trailers listed in the config.lua
6 |
7 | # Requirements:
8 | * Required:
9 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
10 | * Optional:
11 | * NONE
12 |
13 | # Download & Installation:
14 | 1) Place `esx_vehiclespawner` in your ESX Directory
15 | 2) Add `start esx_vehiclespawner` to your server.cfg
16 | 3) Edit the `config.lua` to your liking
17 |
--------------------------------------------------------------------------------
/esx_vehiclespawner/client/main.lua:
--------------------------------------------------------------------------------
1 | local CurrentActionData, this_Spawner = {}, {}
2 | local HasAlreadyEnteredMarker, IsInMainMenu = false, false
3 | local LastZone, CurrentAction, CurrentActionMsg
4 |
5 | -- Vehicle Spawn Menu
6 | function OpenSpawnerMenu()
7 | IsInMainMenu = true
8 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', {
9 | title = _U('vehicle_spawner'),
10 | align = GetConvar('esx_MenuAlign', 'top-left'),
11 | elements = {
12 | {label = _U('dont_abuse')},
13 | {label = _U('default_veh'), value = 'default_veh'}
14 | }}, function(data, menu)
15 | local action = data.current.value
16 |
17 | if action == 'default_veh' then
18 | local elements2 = {}
19 |
20 | for i=1, #Config.Vehicles, 1 do
21 | table.insert(elements2, {
22 | label = Config.Vehicles[i].label,
23 | model = Config.Vehicles[i].model
24 | })
25 | end
26 |
27 | ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'default_veh', {
28 | title = _U('default_veh'),
29 | align = GetConvar('esx_MenuAlign', 'top-left'),
30 | elements = elements2
31 | }, function(data, menu)
32 | if ESX.Game.IsSpawnPointClear(this_Spawner.Loc, 5.0) then
33 | IsInMainMenu = false
34 | menu.close()
35 | SpawnVehicle(data.current.model)
36 | else
37 | ESX.ShowNotification(_U('spawnpoint_blocked'))
38 | end
39 | end)
40 | end
41 | end, function(data, menu)
42 | IsInMainMenu = false
43 | menu.close()
44 | CurrentAction = 'spawner_point'
45 | CurrentActionMsg = _U('press_to_enter')
46 | CurrentActionData = {}
47 | end)
48 | end
49 |
50 | -- Vehicle Return Menu
51 | function OpenReturnMenu()
52 | local playerCoords = GetEntityCoords(PlayerPedId())
53 | vehicles = ESX.Game.GetVehiclesInArea(playerCoords, 5.0)
54 |
55 | if #vehicles > 0 then
56 | for i=1, #vehicles, 1 do
57 | Model = GetEntityModel(vehicles[i])
58 |
59 | if isVehicleListed(Model) then
60 | ESX.Game.DeleteVehicle(vehicles[i])
61 | end
62 | end
63 | end
64 | end
65 |
66 | function isVehicleListed(Model)
67 | for _,listedVehicle in pairs(Config.ListedVehicles) do
68 | if Model == GetHashKey(listedVehicle) then
69 | return true
70 | end
71 | end
72 | return false
73 | end
74 |
75 | function SpawnVehicle(model)
76 | ESX.Game.SpawnVehicle(model, this_Spawner.Loc, this_Spawner.Heading)
77 | end
78 |
79 | -- Entered Marker
80 | AddEventHandler('esx_vehiclespawner:hasEnteredMarker', function(zone)
81 | if zone == 'spawner_point' then
82 | CurrentAction = 'spawner_point'
83 | CurrentActionMsg = _U('press_to_enter')
84 | CurrentActionData = {}
85 | elseif zone == 'deleter_point' then
86 | CurrentAction = 'deleter_point'
87 | CurrentActionMsg = _U('press_to_enter2')
88 | CurrentActionData = {}
89 | end
90 | end)
91 |
92 | -- Exited Marker
93 | AddEventHandler('esx_vehiclespawner:hasExitedMarker', function()
94 | if not IsInMainMenu or IsInMainMenu then
95 | ESX.UI.Menu.CloseAll()
96 | end
97 |
98 | CurrentAction = nil
99 | end)
100 |
101 | -- Resource Stop
102 | AddEventHandler('onResourceStop', function(resource)
103 | if resource == GetCurrentResourceName() then
104 | if IsInMainMenu then
105 | ESX.UI.Menu.CloseAll()
106 | end
107 | end
108 | end)
109 |
110 | -- Create Blips
111 | CreateThread(function()
112 | if Config.UseBlips then
113 | for k,v in pairs(Config.Zones) do
114 | local blip = AddBlipForCoord(v.Pos)
115 |
116 | SetBlipSprite (blip, Config.BlipVehicleSpawner.Sprite)
117 | SetBlipColour (blip, Config.BlipVehicleSpawner.Color)
118 | SetBlipDisplay(blip, Config.BlipVehicleSpawner.Display)
119 | SetBlipScale (blip, Config.BlipVehicleSpawner.Scale)
120 | SetBlipAsShortRange(blip, true)
121 |
122 | BeginTextCommandSetBlipName('STRING')
123 | AddTextComponentSubstringPlayerName(_U('blip_spawner'))
124 | EndTextCommandSetBlipName(blip)
125 | end
126 | end
127 | end)
128 |
129 | -- Enter / Exit marker events & Draw Markers
130 | CreateThread(function()
131 | while true do
132 | Wait(0)
133 | local playerCoords = GetEntityCoords(PlayerPedId())
134 | local isInMarker, letSleep, currentZone = false, true, nil
135 |
136 | for k,v in pairs(Config.Zones) do
137 | local distance = #(playerCoords - v.Pos)
138 | local distance2 = #(playerCoords - v.Del)
139 |
140 | if distance < Config.DrawDistance then
141 | letSleep = false
142 |
143 | if Config.MenuMarker.Type ~= -1 then
144 | DrawMarker(Config.MenuMarker.Type, v.Pos, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MenuMarker.x, Config.MenuMarker.y, Config.MenuMarker.z, Config.MenuMarker.r, Config.MenuMarker.g, Config.MenuMarker.b, 100, false, true, 2, false, false, false, false)
145 | end
146 |
147 | if distance < Config.MenuMarker.x then
148 | isInMarker, this_Spawner, currentZone = true, v, 'spawner_point'
149 | end
150 | end
151 |
152 | if distance2 < Config.DrawDistance then
153 | letSleep = false
154 |
155 | if Config.DelMarker.Type ~= -1 then
156 | DrawMarker(Config.DelMarker.Type, v.Del, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.DelMarker.x, Config.DelMarker.y, Config.DelMarker.z, Config.DelMarker.r, Config.DelMarker.g, Config.DelMarker.b, 100, false, true, 2, false, false, false, false)
157 | end
158 |
159 | if distance2 < Config.DelMarker.x then
160 | isInMarker, this_Spawner, currentZone = true, v, 'deleter_point'
161 | end
162 | end
163 | end
164 |
165 | if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then
166 | HasAlreadyEnteredMarker, LastZone = true, currentZone
167 | TriggerEvent('esx_vehiclespawner:hasEnteredMarker', currentZone)
168 | end
169 |
170 | if not isInMarker and HasAlreadyEnteredMarker then
171 | HasAlreadyEnteredMarker = false
172 | TriggerEvent('esx_vehiclespawner:hasExitedMarker', LastZone)
173 | end
174 |
175 | if letSleep then
176 | Wait(500)
177 | end
178 | end
179 | end)
180 |
181 | -- Key Controls
182 | CreateThread(function()
183 | while true do
184 | Wait(0)
185 |
186 | if CurrentAction then
187 | ESX.ShowHelpNotification(CurrentActionMsg)
188 |
189 | if IsControlJustReleased(0, 38) then
190 | if CurrentAction == 'spawner_point' then
191 | OpenSpawnerMenu()
192 | elseif CurrentAction == 'deleter_point' then
193 | OpenReturnMenu()
194 | end
195 |
196 | CurrentAction = nil
197 | end
198 | else
199 | Wait(500)
200 | end
201 | end
202 | end)
203 |
--------------------------------------------------------------------------------
/esx_vehiclespawner/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 |
4 | Config.DrawDistance = 20 -- Marker Draw Distance.
5 | Config.MenuMarker = {Type = 1, r = 0, g = 255, b = 0, x = 1.5, y = 1.5, z = 1.0} -- Enter Location Marker Settings.
6 | Config.DelMarker = {Type = 1, r = 255, g = 0, b = 0, x = 5.0, y = 5.0, z = 1.0} -- Delete Location Marker Settings.
7 | Config.BlipVehicleSpawner = {Sprite = 479, Color = 2, Display = 2, Scale = 1.0} -- Blip Settings.
8 |
9 | Config.UseBlips = false -- true = Use Vehicle Spawner Blips.
10 |
11 | Config.Zones = {
12 | VehicleSpawner1 = { -- Los Santos Docks
13 | Pos = vector3(1246.3, -3256.8, 5.0), -- Enter Marker
14 | Loc = vector3(1250.2, -3243.2, 5.9), -- Spawn Location
15 | Del = vector3(1250.2, -3243.2, 4.9), -- Delete Location
16 | Heading = 179.3
17 | },
18 | VehicleSpawner2 = { -- Sandy Shores U-Tool
19 | Pos = vector3(2691.2, 3461.7, 55.2), -- Enter Marker
20 | Loc = vector3(2683.3, 3456.7, 55.7), -- Spawn Location
21 | Del = vector3(2683.3, 3456.7, 54.7), -- Delete Location
22 | Heading = 248.53
23 | },
24 | VehicleSpawner3 = { -- Paleto Bay Reds
25 | Pos = vector3(-185.1, 6271.8, 30.5), -- Enter Marker
26 | Loc = vector3(-196.7, 6274.1, 31.5), -- Spawn Location
27 | Del = vector3(-196.7, 6274.1, 30.5), -- Delete Location
28 | Heading = 337.68
29 | }
30 | }
31 |
32 | Config.Vehicles = {
33 | {model = 'boattrailer', label = 'Small Boat Trailer | Hitch'},
34 | {model = 'trailersmall', label = 'Small Trailer | Hitch'},
35 | {model = 'tanker', label = 'Black Tanker Trailer | Semi'},
36 | {model = 'tanker2', label = 'Chrome Tanker Trailer | Semi'},
37 | {model = 'docktrailer', label = 'Dock Trailer | Semi'},
38 | {model = 'trailerlogs', label = 'Logs Trailer | Semi'},
39 | {model = 'trailers', label = 'Curtain/Box Trailer | Semi'},
40 | {model = 'trailers2', label = 'Refrigeration Trailer | Semi'},
41 | {model = 'trailers3', label = 'Big G Goods Trailer | Semi'},
42 | {model = 'trailers4', label = 'White Container Trailer | Semi'}
43 | }
44 |
45 | Config.ListedVehicles = {
46 | 'boattrailer',
47 | 'trailersmall',
48 | 'tanker',
49 | 'tanker2',
50 | 'docktrailer',
51 | 'trailerlogs',
52 | 'trailers',
53 | 'trailers2',
54 | 'trailers3',
55 | 'trailers4'
56 | }
57 |
--------------------------------------------------------------------------------
/esx_vehiclespawner/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Vehicle Spawner'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | client_scripts {
19 | 'client/main.lua'
20 | }
21 |
22 | dependencies {
23 | 'es_extended'
24 | }
25 |
--------------------------------------------------------------------------------
/esx_vehiclespawner/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | ['blip_spawner'] = 'Trailer Spawner',
3 | ['vehicle_spawner'] = 'Trailer Spawner',
4 | ['press_to_enter'] = 'Press ~INPUT_PICKUP~ to take out a Trailer.',
5 | ['press_to_enter2'] = 'Press ~INPUT_PICKUP~ to put away a Trailer.',
6 | ['spawner'] = 'Spawner',
7 | ['list_spawners'] = 'List of Trailers',
8 | ['return_spawners'] = 'Return a Trailer',
9 | ['dont_abuse'] = 'If you Abuse this you will be Banned!',
10 | ['default_veh'] = 'Default Trailers',
11 | ['spawnpoint_blocked'] = 'Trailer spawn point is ~r~blocked~s~!',
12 | }
13 |
--------------------------------------------------------------------------------
/esx_vehicletheft/README.md:
--------------------------------------------------------------------------------
1 | # About esx_vehicletheft:
2 | Edited/Made by Human Tree92 ([Velociti Entertainment Customs & Wiki]( http://www.velocitientertainment.com/customs/ ))
3 |
4 | # Helpfull Info:
5 | * There are NO Blips. Thats b/c the location is supposed to be hidden. Not everyone should know the location. Maybe in the future i will add a Blip code for this.
6 | * The Delivery Location & Vehicle you get is Random.
7 |
8 | # Requirements:
9 | * Required:
10 | * [ESX Legacy V1.6+]( https://github.com/esx-framework/esx-legacy/tree/1.6.0 )
11 | * [esx_policejob]( https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_policejob )
12 | * Optional:
13 | * NONE
14 |
15 | # Download & Installation:
16 | 1) Place `esx_vehicletheft` in your ESX Directory
17 | 2) Add `start esx_vehicletheft` to your server.cfg
18 | 3) Edit the `config.lua` to your liking
19 |
20 | # Credits/Original Code:
21 | * [KlibrDM]( https://github.com/KlibrDM )
22 | * [esx_cartheft]( https://github.com/KlibrDM/esx_carthief )
23 | * The ideal was from esx_cartheft but made my own version as mine is more optimized & using better code. In the Future i plan on adding Aircraft & Boat Thefts.
24 |
--------------------------------------------------------------------------------
/esx_vehicletheft/config.lua:
--------------------------------------------------------------------------------
1 | Config = {}
2 | Config.Locale = 'en' -- Set Locale file to use.
3 |
4 | Config.Main = {
5 | DrawDistance = 50, -- Marker Draw Distance.
6 | PoliceReq = 2, -- The Minium Amount of Police to be Online.
7 | BlipTime = 10, -- Blip Update Time in Seconds.
8 | CoolDown = 20, -- How long in Minutes before a New Vehicle Theft can be Started.
9 | AuthorizedJobs = {'unemployed', 'ballas', 'cartel', 'families', 'lostmc', 'vagos'}, -- Jobs that are allowed to do Vehicle Thefts.
10 | Plate = true, -- true = Give Vehicle Custom Plate Text.
11 | SetPlate = ' STOLEN ', -- Custom Plate Text. | Max of 8 Characters including Spaces.
12 | LegacyFuel = true, -- true = Using LegacyFuel.
13 | SetFuel = math.random(50,100) -- If using LegacyFuel give Vehicle Random Fuel.
14 | }
15 |
16 | Config.Zones = {
17 | Markers = {Type = 1, r = 255, g = 0, b = 0, x = 1.5, y = 1.5, z = 1.0}, -- Marker Settings.
18 | Locations = {
19 | Los_Santos_Docks = {
20 | Marker = vector3(1208.6, -3114.88, 4.56), -- Marker Location
21 | Spawner = vector3(1196.82, -3104.65, 6.03), -- Spawn Location
22 | Heading = 0.06 -- Spawn Heading
23 | }
24 | }
25 | }
26 |
27 | Config.Delivery = {
28 | Markers = {Type = 1, r = 204, g = 204, b = 0, x = 3.0, y = 3.0, z = 1.0}, -- Delivery Marker Settings.
29 | Locations = {
30 | Sandy_Shores_Airfield = {
31 | Marker = vector3(1703.47, 3283.23, 40.12), -- Marker Location
32 | Reward = math.random(15000,20000), -- Reward to Give once Delivered.
33 | Vehicles = {'dominator3', 'dukes', 'nightshade', 'phoenix', 'picador', 'ratloader'} -- Random Vehicle to Give Player to Deliver.
34 | },
35 | Grapeseed_ONeil = {
36 | Marker = vector3(2413.76, 4990.87, 45.23), -- Marker Location
37 | Reward = math.random(20000,25000), -- Reward to Give once Delivered.
38 | Vehicles = {'beinjection', 'rebel2', 'sandking', 'trophytruck', 'trophytruck2', 'dune2'} -- Random Vehicle to Give Player to Deliver.
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/esx_vehicletheft/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'adamant'
2 |
3 | game 'gta5'
4 |
5 | author 'Velociti Entertainment aka Human Tree92'
6 |
7 | description 'ESX Vehicle Theft'
8 |
9 | version '1.6+'
10 |
11 | shared_scripts {
12 | '@es_extended/imports.lua',
13 | '@es_extended/locale.lua',
14 | 'config.lua',
15 | 'locales/*.lua'
16 | }
17 |
18 | server_scripts {
19 | 'server/main.lua'
20 | }
21 |
22 | client_scripts {
23 | 'client/main.lua'
24 | }
25 |
26 | dependencies {
27 | 'es_extended'
28 | }
29 |
--------------------------------------------------------------------------------
/esx_vehicletheft/locales/en.lua:
--------------------------------------------------------------------------------
1 | Locales['en'] = {
2 | ['delivery_loc'] = 'Deliver Here',
3 | ['you_earned'] = 'You earned %s Dirty Money for Completing the Vehicle Theft.',
4 | ['theft_cancel'] = '~r~Vehicle Theft Failed. Maybe try again later?~s~',
5 | ['theft_required'] = 'A Minimum of ~b~%s~s~ Policing Officers are required to do a Vehicle Theft.',
6 | ['theft_started'] = 'You started a Vehicle Theft, ~o~Can you Complete the Mission?~s~',
7 | ['theft_in_prog'] = '~r~A Vehicle Theft is already in progress!',
8 | ['theft_wrong'] = '~r~You have to use the Vehicle that was provided & come to a full stop!',
9 | ['left_1m'] = '~r~You have 1 Minute to get back in the Vehicle!',
10 | ['left_10s'] = '~r~You have 10 Seconds to get back in the Vehicle!',
11 | ['police_alert'] = 'Police Alert',
12 | ['police_alert_theft'] = 'Vehicle Theft!',
13 | ['police_alert_started'] = 'A Vehicle Theft has been Started! Vehicle Tracker will be Active on your Radar. Stop them by any means!!!',
14 | ['police_alert_complete'] = 'The Vehicle Theft has been Delivered. ~r~You failed to Stop them!',
15 | ['police_alert_cancelled'] = 'The Vehicle Theft has been Cancelled. ~g~Great Job!',
16 | ['press_theft'] = 'Press ~INPUT_CONTEXT~ to Steal a Vehicle',
17 | ['press_deliver'] = 'Press ~INPUT_CONTEXT~ to Deliver Vehicle',
18 | ['theft_cooldown'] = 'There is currently a Cool Down or a Theft is already in Progress. Come back later.',
19 | ['cant_job'] = 'You are not the Correct Job to Start a Theft!',
20 | }
21 |
--------------------------------------------------------------------------------
/esx_vehicletheft/server/main.lua:
--------------------------------------------------------------------------------
1 | local isCurrentTheft, coolDown = false, false
2 | local theftPlayer = 0
3 |
4 | -- Count Police
5 | ESX.RegisterServerCallback('esx_vehicletheft:checkPolice', function(source, cb)
6 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
7 |
8 | if #xPlayers >= Config.Main.PoliceReq then
9 | cb(true)
10 | else
11 | cb(false)
12 | end
13 | end)
14 |
15 | -- Add Command to Start Timer
16 | ESX.RegisterCommand('theftstart', 'admin', function(xPlayer, args, showError)
17 | TriggerEvent('esx_vehicletheft:startTimer')
18 | end, false, {help = 'Start Vehicle Theft Timer'})
19 |
20 | -- Add Command to Reset Timer
21 | ESX.RegisterCommand('theftreset', 'admin', function(xPlayer, args, showError)
22 | TriggerEvent('esx_vehicletheft:resetTimer')
23 | end, false, {help = 'Reset Vehicle Theft Timer'})
24 |
25 | -- See if there is an On Going Vehicle Thefts & Cool Down has Ended
26 | ESX.RegisterServerCallback('esx_vehicletheft:checkThefts', function(source, cb)
27 | local xPlayer = ESX.GetPlayerFromId(source)
28 | if isCurrentTheft == false and coolDown == false then
29 | cb(true)
30 | else
31 | cb(false)
32 | end
33 | end)
34 |
35 | -- Start Cool Down Timer
36 | RegisterServerEvent('esx_vehicletheft:startTimer')
37 | AddEventHandler('esx_vehicletheft:startTimer', function()
38 | theftPlayer = 0
39 | isCurrentTheft = false
40 | coolDown = true
41 | SetTimeout((Config.Main.CoolDown*60)*1000, function()
42 | coolDown = false
43 | end)
44 | end)
45 |
46 | -- Reset Timer
47 | RegisterServerEvent('esx_vehicletheft:resetTimer')
48 | AddEventHandler('esx_vehicletheft:resetTimer', function()
49 | theftPlayer = 0
50 | isCurrentTheft = false
51 | coolDown = false
52 | end)
53 |
54 | -- Send Payment for Completion
55 | RegisterServerEvent('esx_vehicletheft:sendPayment')
56 | AddEventHandler('esx_vehicletheft:sendPayment', function(reward)
57 | local _source = source
58 |
59 | if isCurrentTheft and not coolDown then
60 | if _source == theftPlayer then
61 | local xPlayer = ESX.GetPlayerFromId(_source)
62 |
63 | xPlayer.addAccountMoney('black_money', reward)
64 | xPlayer.showNotification(_U('you_earned', reward))
65 | TriggerEvent('esx_vehicletheft:startTimer')
66 | end
67 | end
68 | end)
69 |
70 | -- Theft Canceled
71 | RegisterServerEvent('esx_vehicletheft:theftCanceled')
72 | AddEventHandler('esx_vehicletheft:theftCanceled', function()
73 | local _source = source
74 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
75 | isCurrentTheft = false
76 |
77 | for _, xPlayer in pairs(xPlayers) do
78 | TriggerClientEvent('esx_vehicletheft:theftCompNotif', xPlayer.source, false)
79 | end
80 |
81 | if _source == theftPlayer then
82 | local xPlayer = ESX.GetPlayerFromId(_source)
83 | theftPlayer = 0
84 | xPlayer.showNotification(_U('theft_cancel'))
85 | end
86 | end)
87 |
88 | -- Theft in Progress
89 | RegisterServerEvent('esx_vehicletheft:theftInProgress')
90 | AddEventHandler('esx_vehicletheft:theftInProgress', function()
91 | local _source = source
92 | local xPlayer = ESX.GetPlayerFromId(_source)
93 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
94 |
95 | if isCurrentTheft == false then
96 | if #xPlayers < Config.Main.PoliceReq then
97 | xPlayer.showNotification(_U('theft_required', Config.Main.PoliceReq))
98 | return
99 | end
100 |
101 | isCurrentTheft = true
102 | for _, xPlayer in pairs(xPlayers) do
103 | TriggerClientEvent('esx_vehicletheft:theftPoliceNotif', xPlayer.source)
104 | end
105 |
106 | xPlayer.showNotification(_U('theft_started'))
107 | TriggerClientEvent('esx_vehicletheft:startTheft', _source)
108 | theftPlayer = _source
109 | else
110 | xPlayer.showNotification(_U('theft_in_prog'))
111 | end
112 | end)
113 |
114 | -- Alert Police
115 | RegisterServerEvent('esx_vehicletheft:alertPolice')
116 | AddEventHandler('esx_vehicletheft:alertPolice', function(coords)
117 | local _source = source
118 | local xPlayer = ESX.GetPlayerFromId(_source)
119 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
120 |
121 | for _, xPlayer in pairs(xPlayers) do
122 | TriggerClientEvent('esx_vehicletheft:setPoliceBlip', xPlayer.source, coords)
123 | end
124 | end)
125 |
126 | -- Stop Alert Police
127 | RegisterServerEvent('esx_vehicletheft:alertPoliceStop')
128 | AddEventHandler('esx_vehicletheft:alertPoliceStop', function()
129 | local _source = source
130 | local xPlayer = ESX.GetPlayerFromId(_source)
131 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
132 |
133 | for _, xPlayer in pairs(xPlayers) do
134 | TriggerClientEvent('esx_vehicletheft:theftCompNotif', xPlayer.source, true)
135 | end
136 | end)
137 |
138 | -- Stop if Player Leaves
139 | AddEventHandler('esx:playerDropped', function(playerId, reason)
140 | local _source = source
141 | local xPlayer = ESX.GetPlayerFromId(_source)
142 | local xPlayers = ESX.GetExtendedPlayers('job', 'police')
143 |
144 | if playerId == theftPlayer then
145 | isCurrentTheft = false
146 |
147 | for _, xPlayer in pairs(xPlayers) do
148 | TriggerClientEvent('esx_vehicletheft:theftCompNotif', xPlayer.source, false)
149 | end
150 | end
151 | end)
152 |
153 | -- Start Timer
154 | AddEventHandler('onResourceStart', function(resource)
155 | if resource == GetCurrentResourceName() then
156 | TriggerEvent('esx_vehicletheft:startTimer')
157 | return
158 | end
159 | end)
160 |
--------------------------------------------------------------------------------