Merge branch 'main' into main

This commit is contained in:
Kakarot
2026-06-17 13:02:53 -05:00
committed by GitHub
+5 -1
View File
@@ -575,7 +575,11 @@ function QBCore.Player.ForceDeleteCharacter(citizenid)
local queries = {} local queries = {}
local existing = QBCore.Functions.GetPlayerByCitizenId(citizenid) local existing = QBCore.Functions.GetPlayerByCitizenId(citizenid)
if existing then if existing then
DropPlayer(existing.PlayerData.source, 'An admin deleted the character which you are currently using') local src = existing.PlayerData.source
-- clear refs to prevent playerDropped from saving
QBCore.Players[src] = nil
QBCore.PlayersByCitizenId[citizenid] = nil
DropPlayer(src, 'An admin deleted the character which you are currently using')
end end
for i = 1, #playertables do for i = 1, #playertables do
queries[i] = { query = query:format(playertables[i].table), values = { citizenid } } queries[i] = { query = query:format(playertables[i].table), values = { citizenid } }