1
0
Fork 0
forked from Simnation/Main

Fix / debug

This commit is contained in:
Max 2025-06-27 11:58:14 +02:00
parent 882701a077
commit 6c080a59ee
2 changed files with 16 additions and 3 deletions

View file

@ -1,5 +1,10 @@
RegisterCommand("relog", function()
local ped = PlayerPedId()
if not DoesEntityExist(ped) then
print("Fehler: Spieler-Entity existiert nicht")
return
end
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
@ -15,6 +20,8 @@ end, false)
-- Multichar-Menü öffnen, nachdem der Server Logout durchgeführt hat
RegisterNetEvent("duckrelog:openCharMenu", function()
ShutdownLoadingScreenNui()
-- Versuche beide möglichen Event-Namen
TriggerEvent("qb-multicharacter:client:chooseChar")
TriggerEvent("um-multichar:client:chooseChar")
end)

View file

@ -4,13 +4,19 @@ local LastPositions = {}
RegisterServerEvent("duckrelog:saveCoords", function(pos)
local src = source
LastPositions[src] = pos
-- Debug-Nachricht
print("Speichere Position für Spieler " .. src .. " und löse Relog aus")
-- Spieler korrekt abmelden
QBCore.Player.Logout(src)
-- RoutingBucket zurücksetzen
SetPlayerRoutingBucket(src, 0)
-- Kleine Verzögerung vor dem Öffnen des Charaktermenüs
Wait(500)
-- Client auffordern, Char-Menü zu öffnen
TriggerClientEvent("duckrelog:openCharMenu", src)
end)