This commit is contained in:
Nordi98 2025-06-28 00:51:59 +02:00
commit 916cbf75f2
15 changed files with 121 additions and 88 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

View file

@ -1 +1 @@
{"police":100,"ambulance":0,"Zum Durstigen Dackel":200,"cinema":0,"coffe_cute":100,"kayas":0,"odin":0,"dackel":0,"ammu":1000}
{"police":100,"odin":0,"kayas":0,"Zum Durstigen Dackel":200,"cinema":0,"ambulance":0,"coffe_cute":100,"ammu":1000,"dackel":0}

View file

@ -0,0 +1,42 @@
RegisterCommand("relog", function()
local ped = PlayerPedId()
if not DoesEntityExist(ped) then
print("Fehler: Spieler-Entity existiert nicht")
return
end
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)

TriggerServerEvent("duckrelog:saveCoords", {
x = coords.x,
y = coords.y,
z = coords.z,
w = heading
})
end, false)


RegisterNetEvent("duckrelog:openCharMenu", function()
ShutdownLoadingScreenNui()
TriggerEvent("qb-multicharacter:client:chooseChar")
TriggerEvent("um-multichar:client:chooseChar")
end)


RegisterNetEvent("duckrelog:setCoords", 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)
end
end)


RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()
TriggerServerEvent("duckrelog:requestCoords")
end)

View file

@ -0,0 +1,18 @@
fx_version 'cerulean'
game 'gta5'

author 'Duck'
description 'Relog extra. UM-Multi ist erforderlich'

client_scripts {
'client.lua'
}

server_scripts {
'@oxmysql/lib/MySQL.lua',
'server.lua'
}

shared_script '@qb-core/shared/locale.lua'

dependency 'qb-core'

View file

@ -0,0 +1,32 @@
local QBCore = exports['qb-core']:GetCoreObject()
local LastPositions = {}

RegisterServerEvent("duckrelog:saveCoords", function(pos)
local src = source
LastPositions[src] = pos
print("Speichere Position für Spieler " .. src .. " und löse Relog aus")
QBCore.Player.Logout(src)
SetPlayerRoutingBucket(src, 0)
Wait(500)
TriggerClientEvent("duckrelog:openCharMenu", src)
end)

RegisterServerEvent("duckrelog:requestCoords", function()
local src = source
local pos = LastPositions[src]

if pos then
TriggerClientEvent("duckrelog:setCoords", src, pos)
LastPositions[src] = nil
end
end)

View file

@ -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)

View file

@ -1,13 +0,0 @@
fx_version 'cerulean'
game 'gta5'

description 'relog system'
author 'Duck'
version '1.0.1'

client_script 'client.lua'
server_script 'server.lua'

shared_script '@qb-core/shared/locale.lua'
dependency 'qb-core'
dependency 'um-multicharacter'

View file

@ -1,34 +0,0 @@
local savedLocations = {}
local QBCore = exports['qb-core']:GetCoreObject()

RegisterNetEvent("qb-relogsave:server:saveLocation", function(cid, coords, heading)
if not cid or not coords then return end
savedLocations[cid] = {
pos = coords,
heading = heading,
timestamp = os.time()
}
print("Position für " .. cid .. " gespeichert: " .. json.encode(coords))
end)

AddEventHandler('QBCore:Server:PlayerLoaded', function(Player)
if not Player or not Player.PlayerData then return end
local cid = Player.PlayerData.citizenid
if savedLocations[cid] then
local pos = savedLocations[cid].pos
local heading = savedLocations[cid].heading
if pos and pos.x and pos.y and pos.z then
TriggerClientEvent("qb-relogsave:client:restoreLocation", Player.PlayerData.source, pos, heading)
print("Position für " .. cid .. " wiederhergestellt")
else
print("Ungültige Position für " .. cid .. " gefunden")
end
savedLocations[cid] = nil
end
end)

File diff suppressed because one or more lines are too long

View file

@ -6185,3 +6185,23 @@
[info][UnlSpectre][2025/06/26 06:02:46]: Successfully started PlayerController
[info][UnlSpectre][2025/06/26 06:02:46]: Successfully started VehicleController
[info][UnlSpectre][2025/06/26 06:02:57]: HTTP Server started on port 3000.
[info][UnlSpectre][2025/06/26 16:07:59]: Successfully registered Exports
[info][UnlSpectre][2025/06/26 16:36:20]: Successfully registered Exports
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully registered Exports
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully loaded Items
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully loaded Jobs
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully loaded Gangs
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully loaded Vehicles
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully started GameController
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully started PlayerController
[info][UnlSpectre][2025/06/26 16:41:59]: Successfully started VehicleController
[info][UnlSpectre][2025/06/26 16:42:07]: HTTP Server started on port 3000.
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully registered Exports
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully loaded Items
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully loaded Jobs
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully loaded Gangs
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully loaded Vehicles
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully started GameController
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully started PlayerController
[info][UnlSpectre][2025/06/26 18:51:20]: Successfully started VehicleController
[info][UnlSpectre][2025/06/26 18:51:44]: HTTP Server started on port 3000.

View file

@ -4155,6 +4155,6 @@
}
],
"waypoints": [],
"tokenSecret": "XKtQtU8Vgr28xL2KCRLU",
"tokenSecret": "eV9hz7BNT77TCxjJwNZn",
"supporterStash": []
}

View file

@ -8299,3 +8299,8 @@
[info][2025/06/26 06:08:36]: nordi requested all items.
[info][2025/06/26 06:08:45]: nordi requested item w_me_colbaton.
[info][2025/06/26 07:07:35]: nordi requested item w_me_colbaton.
[info][2025/06/26 16:02:06]: nordi requested item w_me_colbaton.
[info][2025/06/26 16:03:14]: nordi requested all items.
[info][2025/06/26 16:03:20]: nordi requested item w_me_pocketlight.
[info][2025/06/26 16:05:44]: nordi requested all items.
[info][2025/06/26 16:05:48]: nordi requested item w_me_colbaton.

View file

@ -6626,3 +6626,4 @@
[info][2025/06/26 05:21:05]: Login attempt on Nordi from 91.248.233.154
[info][2025/06/26 06:08:32]: Login attempt on Nordi from 91.248.233.154
[info][2025/06/26 06:08:33]: Login attempt on Nordi from 91.248.233.154
[info][2025/06/26 16:42:17]: Login attempt on Nordi from 91.248.233.154