Revert "kashacters changes"

This reverts commit 372774b8e4.
This commit is contained in:
Mycroft
2021-04-06 22:57:06 +01:00
parent c31f1c62b1
commit 4546c3d04c
3 changed files with 29 additions and 60 deletions
+27 -57
View File
@@ -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')
-1
View File
@@ -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
+2 -2
View File
@@ -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()