Tidy up the double check for commPercent

Left in the old code for commission calculation

I don't think it was making a difference but it wasn't needed
This commit is contained in:
Jim Shield
2025-05-14 20:24:47 +01:00
parent f869c682c1
commit e73520a10c
2 changed files with 4 additions and 11 deletions

View File

@@ -14,12 +14,7 @@ RegisterServerEvent(getScript()..":server:PolCharge", function(citizen, price)
local price = math.floor(tonumber(price))
local commPercent = Config.PolCharge.FineJobs[biller.job] and Config.PolCharge.FineJobs[biller.job].Commission or 0.25
if Config.PolCharge.FineJobs[biller.job] then
commPercent = Config.PolCharge.FineJobs[biller.job].Commission
else
commPercent = 0.25
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)
if price > 0 then

View File

@@ -3,11 +3,9 @@ RegisterServerEvent(getScript()..":Tickets:Give", function(data, biller, gang)
local activePlayers = GetPlayers()
local commPercent = 0
jsonPrint(data)
if Config.Receipts.Jobs[data.society] then
commPercent = Config.Receipts.Jobs[data.society].Commission
else commPercent = 0.25
print("^1Error^7: ^2Can't find job in ^7'^3Config^7.^3Receipts^7.^3Jobs^7', ^2defaulting to 0.25 (25% commission)^7")
end
local commPercent = Config.PolCharge.FineJobs[data.society] and Config.PolCharge.FineJobs[data.society].Commission or 0.25
local takecomm = math.floor(data.amount * commPercent)
if biller ~= nil then -- If this is found, it ISN'T a phone payment, so add money to society here