feat: use first char group for new chars

This commit is contained in:
0xDEMXN
2022-02-18 11:51:30 +01:00
parent 084dc23e50
commit e4d8fd8d1e
+5
View File
@@ -70,6 +70,11 @@ function createESXPlayer(identifier, playerId, data)
defaultGroup = "user"
end
if Config.Multichar and not identifier:find('char1:') then
local char1 = MySQL.single.await(loadPlayer, {identifier:gsub('char%d+:', 'char1:')})
if char1 then defaultGroup = char1.group end
end
if not Config.Multichar then
MySQL.prepare(newPlayer, { json.encode(accounts), identifier, defaultGroup }, function()
loadESXPlayer(identifier, playerId, true)