1
0
Fork 0
forked from Simnation/Main
Main/resources/[qb]/Duck_Relog/client.lua

43 lines
1 KiB
Lua
Raw Normal View History

2025-06-27 11:32:02 +02:00
RegisterCommand("relog", function()
2025-06-27 11:43:55 +02:00
local ped = PlayerPedId()
2025-06-27 11:58:14 +02:00
if not DoesEntityExist(ped) then
print("Fehler: Spieler-Entity existiert nicht")
return
end
2025-06-27 11:43:55 +02:00
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
2025-06-27 11:39:45 +02:00
2025-06-27 13:08:39 +02:00
2025-06-27 11:39:45 +02:00
TriggerServerEvent("duckrelog:saveCoords", {
x = coords.x,
y = coords.y,
z = coords.z,
w = heading
})
2025-06-27 11:43:55 +02:00
end, false)
2025-06-27 11:32:02 +02:00
2025-06-27 13:08:39 +02:00
2025-06-27 11:43:55 +02:00
RegisterNetEvent("duckrelog:openCharMenu", function()
2025-06-27 11:32:02 +02:00
ShutdownLoadingScreenNui()
2025-06-27 13:08:39 +02:00
2025-06-27 11:58:14 +02:00
TriggerEvent("qb-multicharacter:client:chooseChar")
2025-06-27 11:32:02 +02:00
TriggerEvent("um-multichar:client:chooseChar")
end)
2025-06-27 13:08:39 +02:00
2025-06-27 11:39:45 +02:00
RegisterNetEvent("duckrelog:setCoords", function(pos)
2025-06-27 11:32:02 +02:00
if pos then
local ped = PlayerPedId()
RequestCollisionAtCoord(pos.x, pos.y, pos.z)
SetEntityCoordsNoOffset(ped, pos.x, pos.y, pos.z, false, false, false)
SetEntityHeading(ped, pos.w or 0.0)
end
end)
2025-06-27 11:43:55 +02:00
2025-06-27 13:08:39 +02:00
2025-06-27 11:43:55 +02:00
RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()
TriggerServerEvent("duckrelog:requestCoords")
end)