forked from Simnation/Main
clear Scrip
This commit is contained in:
parent
93bfe0575d
commit
de9c6aeb91
3 changed files with 0 additions and 73 deletions
|
@ -1,38 +0,0 @@
|
|||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local savedLocation = nil
|
||||
|
||||
RegisterCommand("relog", function()
|
||||
local ped = PlayerPedId()
|
||||
local coords = GetEntityCoords(ped)
|
||||
local heading = GetEntityHeading(ped)
|
||||
local cid = QBCore.Functions.GetPlayerData().citizenid
|
||||
|
||||
-- Speicher Ort vor Relog
|
||||
TriggerServerEvent("qb-relogsave:server:saveLocation", cid, {
|
||||
x = coords.x,
|
||||
y = coords.y,
|
||||
z = coords.z
|
||||
}, heading)
|
||||
|
||||
TriggerEvent("qb-multicharacter:client:chooseChar")
|
||||
end, false)
|
||||
|
||||
RegisterNetEvent("qb-relogsave:client:restoreLocation", function(pos, heading)
|
||||
savedLocation = {
|
||||
pos = pos,
|
||||
heading = heading
|
||||
}
|
||||
end)
|
||||
|
||||
RegisterNetEvent("qb-spawn:client:spawned", function()
|
||||
if savedLocation then
|
||||
DoScreenFadeOut(500)
|
||||
Wait(500)
|
||||
SetEntityCoords(PlayerPedId(), savedLocation.pos.x, savedLocation.pos.y, savedLocation.pos.z)
|
||||
SetEntityHeading(PlayerPedId(), savedLocation.heading)
|
||||
Wait(500)
|
||||
DoScreenFadeIn(500)
|
||||
|
||||
savedLocation = nil
|
||||
end
|
||||
end)
|
|
@ -1,12 +0,0 @@
|
|||
fx_version 'cerulean'
|
||||
game 'gta5'
|
||||
|
||||
description 'relog system'
|
||||
author 'Duck'
|
||||
version '1.0.0'
|
||||
|
||||
client_script 'client.lua'
|
||||
server_script 'server.lua'
|
||||
|
||||
shared_script '@qb-core/shared/locale.lua'
|
||||
dependency 'qb-core'
|
|
@ -1,23 +0,0 @@
|
|||
local savedLocations = {}
|
||||
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterNetEvent("qb-relogsave:server:saveLocation", function(cid, coords, heading)
|
||||
savedLocations[cid] = {
|
||||
pos = coords,
|
||||
heading = heading
|
||||
}
|
||||
end)
|
||||
|
||||
AddEventHandler('QBCore:Server:PlayerLoaded', function(Player)
|
||||
local cid = Player.PlayerData.citizenid
|
||||
|
||||
if savedLocations[cid] then
|
||||
local pos = savedLocations[cid].pos
|
||||
local heading = savedLocations[cid].heading
|
||||
|
||||
TriggerClientEvent("qb-relogsave:client:restoreLocation", Player.PlayerData.source, pos, heading)
|
||||
|
||||
savedLocations[cid] = nil
|
||||
end
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue