1
0
Fork 0
forked from Simnation/Main
Main/resources/[Developer]/[Mark]/av_weather/server/editable/_spawn.lua
2025-06-07 08:51:21 +02:00

18 lines
No EOL
643 B
Lua

-- The following events are used to detect when a player is loaded (qb-qbx and esx)
-- init function is triggered along with player source id to receive all info from zones, time, etc
AddEventHandler("QBCore:Server:PlayerLoaded", function(Player)
init(Player.PlayerData.source)
end)
RegisterServerEvent('esx:onPlayerJoined')
AddEventHandler("esx:onPlayerJoined", function(Player)
local src = Player
if not src or not tonumber(src) then src = source end
init(src)
end)
AddEventHandler("ox:playerLoaded", function(playerId)
if not playerId or not tonumber(playerId) then return end
init(playerId)
end)