Skip to content

Commit

Permalink
Merge pull request #102 from zh-development/main
Browse files Browse the repository at this point in the history
Add Realparking to config
  • Loading branch information
hoangducvn authored Apr 4, 2022
2 parents 8ffb0fb + 0b0d456 commit 842cfd2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 9 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ cleanUpThresholdTime = 24 * 7
-- this controls the distance at which vehicles will spawn to the closest player
-- (in meters)
spawnDistance = 200.0

Realparking = true -- Controle Realparking True or false if false it return cars to garage on server restart

Realdepot = 2500 -- price depot when realparking is false has to be higher then 0

UsingMojiaVehiclekeys = true

-- set this to false if you do not want entities render as scorched when they
-- are completely broken
UsingMojiaVehiclekeys = true
renderScorched = true

CustomFont = nil --[nil]: use system default font - or ['name of your custom font']: You need your_custum_font.gfx EX: CustomFont = 'Oswald'

Garages = {
--Public Garage:
['garage1'] = {
Expand Down
8 changes: 6 additions & 2 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,12 @@ end)
AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
Wait(100)
if AutoRespawn then
MySQL.Async.execute('UPDATE player_vehicles SET state = 1 WHERE state = 0 AND depotprice = 0', {})
if Realparking then
print("Respawning cars")
else
local price = Realdepot
MySQL.Async.execute('UPDATE player_vehicles SET state = ?, depotprice = ? WHERE state = 0 AND depotprice = 0',
{0, price})
end
end
end)
Expand Down

0 comments on commit 842cfd2

Please sign in to comment.