mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
+27
-57
@@ -1,23 +1,15 @@
|
||||
local isPaused, isDead, pickups = false, false, {}
|
||||
|
||||
if not Config.UseKashacters then
|
||||
Citizen.CreateThread(function()
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Citizen.Wait(0)
|
||||
|
||||
while true do
|
||||
Citizen.Wait(0)
|
||||
|
||||
if NetworkIsPlayerActive(PlayerId()) then
|
||||
TriggerServerEvent('esx:onPlayerJoined')
|
||||
break
|
||||
end
|
||||
end
|
||||
end)
|
||||
else
|
||||
RegisterNetEvent('esx:kashloaded')
|
||||
AddEventHandler('esx:kashloaded', function()
|
||||
TriggerServerEvent('esx:onPlayerJoined')
|
||||
end)
|
||||
end
|
||||
if NetworkIsPlayerActive(PlayerId()) then
|
||||
TriggerServerEvent('esx:onPlayerJoined')
|
||||
break
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded')
|
||||
AddEventHandler('esx:playerLoaded', function(playerData)
|
||||
@@ -30,7 +22,7 @@ AddEventHandler('esx:playerLoaded', function(playerData)
|
||||
RequestModel(defaultModel)
|
||||
|
||||
while not HasModelLoaded(defaultModel) do
|
||||
Citizen.Wait(25)
|
||||
Citizen.Wait(10)
|
||||
end
|
||||
|
||||
SetPlayerModel(PlayerId(), defaultModel)
|
||||
@@ -68,48 +60,26 @@ AddEventHandler('esx:playerLoaded', function(playerData)
|
||||
})
|
||||
end
|
||||
|
||||
local wait = 4000
|
||||
if Config.UseKashacters then
|
||||
--[[
|
||||
ESX.Game.Teleport(PlayerPedId(), {
|
||||
x = playerData.coords.x,
|
||||
y = playerData.coords.y,
|
||||
z = playerData.coords.z + 0.25,
|
||||
heading = playerData.coords.heading
|
||||
}, function()
|
||||
end)
|
||||
]]--
|
||||
TriggerServerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon
|
||||
TriggerEvent('esx:restoreLoadout')
|
||||
|
||||
Citizen.Wait(0)
|
||||
ShutdownLoadingScreen()
|
||||
FreezeEntityPosition(PlayerPedId(), false)
|
||||
DoScreenFadeIn(0)
|
||||
StartServerSyncLoops()
|
||||
TriggerEvent('esx:loadingScreenOff')
|
||||
|
||||
else
|
||||
ESX.Game.Teleport(PlayerPedId(), {
|
||||
x = playerData.coords.x,
|
||||
y = playerData.coords.y,
|
||||
z = playerData.coords.z + 0.25,
|
||||
heading = playerData.coords.heading
|
||||
ESX.Game.Teleport(PlayerPedId(), {
|
||||
x = playerData.coords.x,
|
||||
y = playerData.coords.y,
|
||||
z = playerData.coords.z + 0.25,
|
||||
heading = playerData.coords.heading
|
||||
}, function()
|
||||
TriggerServerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon
|
||||
TriggerEvent('esx:restoreLoadout')
|
||||
TriggerServerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('esx:onPlayerSpawn')
|
||||
TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon
|
||||
TriggerEvent('esx:restoreLoadout')
|
||||
|
||||
Citizen.Wait(3000)
|
||||
ShutdownLoadingScreen()
|
||||
FreezeEntityPosition(PlayerPedId(), false)
|
||||
DoScreenFadeIn(10000)
|
||||
StartServerSyncLoops()
|
||||
TriggerEvent('esx:loadingScreenOff')
|
||||
Citizen.Wait(4000)
|
||||
ShutdownLoadingScreen()
|
||||
ShutdownLoadingScreenNui()
|
||||
FreezeEntityPosition(PlayerPedId(), false)
|
||||
DoScreenFadeIn(10000)
|
||||
StartServerSyncLoops()
|
||||
end)
|
||||
|
||||
TriggerEvent('esx:loadingScreenOff')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:setMaxWeight')
|
||||
|
||||
@@ -14,4 +14,3 @@ Config.EnableHud = true -- enable the default hud? Display current jo
|
||||
Config.MaxWeight = 24 -- the max inventory weight without backpack
|
||||
Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds
|
||||
Config.EnableDebug = false
|
||||
Config.UseKashacters = false
|
||||
@@ -211,10 +211,10 @@ end
|
||||
ESX.StartDBSync = function()
|
||||
function saveData()
|
||||
ESX.SavePlayers()
|
||||
SetTimeout(15 * 60 * 1000, saveData)
|
||||
SetTimeout(10 * 60 * 1000, saveData)
|
||||
end
|
||||
|
||||
SetTimeout(15 * 60 * 1000, saveData)
|
||||
SetTimeout(10 * 60 * 1000, saveData)
|
||||
end
|
||||
|
||||
ESX.GetPlayers = function()
|
||||
|
||||
Reference in New Issue
Block a user