Update main.lua

This commit is contained in:
Andyyy7666
2022-04-11 03:00:20 +02:00
committed by GitHub
parent fb9b58e91e
commit d251acece6

View File

@@ -122,16 +122,18 @@ AddEventHandler("newCharacter", function(newCharacter)
local departmentCheck = validateDepartment(player, newCharacter.department)
if not departmentCheck then return end
local startingCash = newCharacter.startingCash
local startingBank = newCharacter.startingBank
-- Don't trust the client, validate maximum amounts.
local moneyCheck = validateMoney(startingCash, startingBank)
if config.enableMoneySystem
local startingCash = newCharacter.startingCash
local startingBank = newCharacter.startingBank
-- Don't trust the client, validate maximum amounts.
local moneyCheck = validateMoney(startingCash, startingBank)
-- Set money to maximum amount in the config .
-- Only triggers if the client is sending an amount that exceeds the maximum.
if not moneyCheck then
startingCash = config.maxStartingCash
startingBank = config.maxStartingBank
-- Set money to maximum amount in the config .
-- Only triggers if the client is sending an amount that exceeds the maximum.
if not moneyCheck then
startingCash = config.maxStartingCash
startingBank = config.maxStartingBank
end
end
exports.oxmysql:query("SELECT character_id FROM characters WHERE license = ?", {GetPlayerIdentifierFromType("license", player)}, function(result)