forked from Simnation/Main
fix
This commit is contained in:
parent
8fd0da7d21
commit
d620dd2499
2 changed files with 24 additions and 33 deletions
|
@ -1,20 +1,27 @@
|
|||
local hasUsedRelog = false
|
||||
|
||||
RegisterCommand("relog", function()
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
TriggerServerEvent("relog:saveCoords", coords)
|
||||
hasUsedRelog = true
|
||||
local heading = GetEntityHeading(PlayerPedId())
|
||||
|
||||
|
||||
TriggerServerEvent("duckrelog:saveCoords", {
|
||||
x = coords.x,
|
||||
y = coords.y,
|
||||
z = coords.z,
|
||||
w = heading
|
||||
})
|
||||
|
||||
|
||||
ShutdownLoadingScreenNui()
|
||||
TriggerEvent("um-multichar:client:chooseChar")
|
||||
end, false)
|
||||
|
||||
-- Wenn Spieler geladen wurde, Position vom Server anfordern
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
|
||||
TriggerServerEvent("relog:checkLastPosition")
|
||||
TriggerServerEvent("duckrelog:requestCoords")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("relog:teleportPlayer", function(pos)
|
||||
-- Spieler teleportieren
|
||||
RegisterNetEvent("duckrelog:setCoords", function(pos)
|
||||
if pos then
|
||||
local ped = PlayerPedId()
|
||||
RequestCollisionAtCoord(pos.x, pos.y, pos.z)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue