From c7cc06532ce6bf99a23d871d1e20f6e06f9ca7e6 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Wed, 13 Apr 2022 20:35:02 +0200 Subject: [PATCH] Update main.lua --- ND_Core/source/server/main.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ND_Core/source/server/main.lua b/ND_Core/source/server/main.lua index 679ed2d..a77ea7c 100644 --- a/ND_Core/source/server/main.lua +++ b/ND_Core/source/server/main.lua @@ -122,18 +122,19 @@ AddEventHandler("newCharacter", function(newCharacter) local departmentCheck = validateDepartment(player, newCharacter.department) if not departmentCheck then return end + local startingCash = newCharacter.startingCash + local startingBank = newCharacter.startingBank + print(startingCash) if config.enableMoneySystem then - local startingCash = newCharacter.startingCash - local startingBank = newCharacter.startingBank - -- Don't trust the client, validate maximum amounts. - local moneyCheck = validateMoney(startingCash, 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 - end + -- 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)