fix: groups nil

This commit is contained in:
Andyyy7666
2023-01-04 19:30:50 +01:00
parent 220ecbbce1
commit 906383bbd9

View File

@@ -348,7 +348,7 @@ function NDCore.Functions.CreateCharacter(player, firstName, lastName, dob, gend
local license = NDCore.Functions.GetPlayerIdentifierFromType("license", player) local license = NDCore.Functions.GetPlayerIdentifierFromType("license", player)
local result = MySQL.query.await("SELECT character_id FROM characters WHERE license = ?", {license}) local result = MySQL.query.await("SELECT character_id FROM characters WHERE license = ?", {license})
if result and config.characterLimit > #result then if result and config.characterLimit > #result then
characterId = MySQL.insert.await("INSERT INTO characters (license, first_name, last_name, dob, gender, cash, bank) VALUES (?, ?, ?, ?, ?, ?, ?)", {license, firstName, lastName, dob, gender, config.startingCash, config.startingBank}) characterId = MySQL.insert.await("INSERT INTO characters (license, first_name, last_name, dob, gender, cash, bank, data) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", {license, firstName, lastName, dob, gender, config.startingCash, config.startingBank, json.encode({groups={}})})
if cb then cb(characterId) end if cb then cb(characterId) end
TriggerClientEvent("ND:returnCharacters", player, NDCore.Functions.GetPlayerCharacters(player)) TriggerClientEvent("ND:returnCharacters", player, NDCore.Functions.GetPlayerCharacters(player))
end end