forked from Simnation/Main
Script
Komplett neu geschrieben
This commit is contained in:
parent
da481ae71b
commit
8fd0da7d21
3 changed files with 81 additions and 0 deletions
25
resources/[qb]/Duck_Relog/client.lua
Normal file
25
resources/[qb]/Duck_Relog/client.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
local hasUsedRelog = false
|
||||
|
||||
RegisterCommand("relog", function()
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
TriggerServerEvent("relog:saveCoords", coords)
|
||||
hasUsedRelog = true
|
||||
|
||||
|
||||
ShutdownLoadingScreenNui()
|
||||
TriggerEvent("um-multichar:client:chooseChar")
|
||||
end, false)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
|
||||
TriggerServerEvent("relog:checkLastPosition")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("relog:teleportPlayer", function(pos)
|
||||
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)
|
||||
FreezeEntityPosition(ped, false)
|
||||
end
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue