mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-17 06:16:02 +01:00
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:
@@ -14,12 +14,7 @@ RegisterServerEvent(getScript()..":server:PolCharge", function(citizen, price)
|
|||||||
local price = math.floor(tonumber(price))
|
local price = math.floor(tonumber(price))
|
||||||
|
|
||||||
local commPercent = Config.PolCharge.FineJobs[biller.job] and Config.PolCharge.FineJobs[biller.job].Commission or 0.25
|
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)
|
local commission = math.floor(price * commPercent)
|
||||||
|
|
||||||
if price > 0 then
|
if price > 0 then
|
||||||
|
|||||||
@@ -3,11 +3,9 @@ RegisterServerEvent(getScript()..":Tickets:Give", function(data, biller, gang)
|
|||||||
local activePlayers = GetPlayers()
|
local activePlayers = GetPlayers()
|
||||||
local commPercent = 0
|
local commPercent = 0
|
||||||
jsonPrint(data)
|
jsonPrint(data)
|
||||||
if Config.Receipts.Jobs[data.society] then
|
|
||||||
commPercent = Config.Receipts.Jobs[data.society].Commission
|
local commPercent = Config.PolCharge.FineJobs[data.society] and Config.PolCharge.FineJobs[data.society].Commission or 0.25
|
||||||
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 takecomm = math.floor(data.amount * commPercent)
|
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
|
if biller ~= nil then -- If this is found, it ISN'T a phone payment, so add money to society here
|
||||||
|
|||||||
Reference in New Issue
Block a user