forked from Simnation/Main
fix
This commit is contained in:
parent
6c080a59ee
commit
9772b8a23e
2 changed files with 10 additions and 10 deletions
|
@ -8,7 +8,7 @@ RegisterCommand("relog", function()
|
||||||
local coords = GetEntityCoords(ped)
|
local coords = GetEntityCoords(ped)
|
||||||
local heading = GetEntityHeading(ped)
|
local heading = GetEntityHeading(ped)
|
||||||
|
|
||||||
-- Position an Server senden
|
|
||||||
TriggerServerEvent("duckrelog:saveCoords", {
|
TriggerServerEvent("duckrelog:saveCoords", {
|
||||||
x = coords.x,
|
x = coords.x,
|
||||||
y = coords.y,
|
y = coords.y,
|
||||||
|
@ -17,15 +17,15 @@ RegisterCommand("relog", function()
|
||||||
})
|
})
|
||||||
end, false)
|
end, false)
|
||||||
|
|
||||||
-- Multichar-Menü öffnen, nachdem der Server Logout durchgeführt hat
|
|
||||||
RegisterNetEvent("duckrelog:openCharMenu", function()
|
RegisterNetEvent("duckrelog:openCharMenu", function()
|
||||||
ShutdownLoadingScreenNui()
|
ShutdownLoadingScreenNui()
|
||||||
-- Versuche beide möglichen Event-Namen
|
|
||||||
TriggerEvent("qb-multicharacter:client:chooseChar")
|
TriggerEvent("qb-multicharacter:client:chooseChar")
|
||||||
TriggerEvent("um-multichar:client:chooseChar")
|
TriggerEvent("um-multichar:client:chooseChar")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Spielerposition wiederherstellen
|
|
||||||
RegisterNetEvent("duckrelog:setCoords", function(pos)
|
RegisterNetEvent("duckrelog:setCoords", function(pos)
|
||||||
if pos then
|
if pos then
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
|
@ -35,7 +35,7 @@ RegisterNetEvent("duckrelog:setCoords", function(pos)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Nach Login, Server fragen ob Position wiederhergestellt werden soll
|
|
||||||
RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()
|
RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()
|
||||||
TriggerServerEvent("duckrelog:requestCoords")
|
TriggerServerEvent("duckrelog:requestCoords")
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -5,19 +5,19 @@ RegisterServerEvent("duckrelog:saveCoords", function(pos)
|
||||||
local src = source
|
local src = source
|
||||||
LastPositions[src] = pos
|
LastPositions[src] = pos
|
||||||
|
|
||||||
-- Debug-Nachricht
|
|
||||||
print("Speichere Position für Spieler " .. src .. " und löse Relog aus")
|
print("Speichere Position für Spieler " .. src .. " und löse Relog aus")
|
||||||
|
|
||||||
-- Spieler korrekt abmelden
|
|
||||||
QBCore.Player.Logout(src)
|
QBCore.Player.Logout(src)
|
||||||
|
|
||||||
-- RoutingBucket zurücksetzen
|
|
||||||
SetPlayerRoutingBucket(src, 0)
|
SetPlayerRoutingBucket(src, 0)
|
||||||
|
|
||||||
-- Kleine Verzögerung vor dem Öffnen des Charaktermenüs
|
|
||||||
Wait(500)
|
Wait(500)
|
||||||
|
|
||||||
-- Client auffordern, Char-Menü zu öffnen
|
|
||||||
TriggerClientEvent("duckrelog:openCharMenu", src)
|
TriggerClientEvent("duckrelog:openCharMenu", src)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue