place start functions behind onResourceStart()

ESX helper
This commit is contained in:
Jim Shield
2025-05-12 22:49:28 +01:00
parent 2b92f749b5
commit 49f4d404e3
3 changed files with 78 additions and 76 deletions

View File

@@ -1,9 +1,11 @@
registerCommand("polcharge", {
locale("command", "charge"), {}, false,
function(source)
TriggerClientEvent(getScript()..":client:PolCharge", source)
end
})
onResourceStart(function()
registerCommand("polcharge", {
locale("command", "charge"), {}, false,
function(source)
TriggerClientEvent(getScript()..":client:PolCharge", source)
end
})
end, true)
RegisterServerEvent(getScript()..":server:PolCharge", function(citizen, price)
local src = source
@@ -19,7 +21,7 @@ RegisterServerEvent(getScript()..":server:PolCharge", function(citizen, price)
print("^3Warning^7: ^2Can't find player's job in ^7'Config.Polcharge.FineJobs', ^2defaulting to 0.25 (25% commission)^7")
end
local commission = math.floor(price * commPercent)
print(commission)
if price > 0 then
if not Config.PolCharge.FineJobConfirmation then
polCharge({