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, {} 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 if NetworkIsPlayerActive(PlayerId()) then
Citizen.Wait(0) TriggerServerEvent('esx:onPlayerJoined')
break
if NetworkIsPlayerActive(PlayerId()) then end
TriggerServerEvent('esx:onPlayerJoined') end
break end)
end
end
end)
else
RegisterNetEvent('esx:kashloaded')
AddEventHandler('esx:kashloaded', function()
TriggerServerEvent('esx:onPlayerJoined')
end)
end
RegisterNetEvent('esx:playerLoaded') RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(playerData) AddEventHandler('esx:playerLoaded', function(playerData)
@@ -30,7 +22,7 @@ AddEventHandler('esx:playerLoaded', function(playerData)
RequestModel(defaultModel) RequestModel(defaultModel)
while not HasModelLoaded(defaultModel) do while not HasModelLoaded(defaultModel) do
Citizen.Wait(25) Citizen.Wait(10)
end end
SetPlayerModel(PlayerId(), defaultModel) SetPlayerModel(PlayerId(), defaultModel)
@@ -68,48 +60,26 @@ AddEventHandler('esx:playerLoaded', function(playerData)
}) })
end end
local wait = 4000 ESX.Game.Teleport(PlayerPedId(), {
if Config.UseKashacters then x = playerData.coords.x,
--[[ y = playerData.coords.y,
ESX.Game.Teleport(PlayerPedId(), { z = playerData.coords.z + 0.25,
x = playerData.coords.x, heading = playerData.coords.heading
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
}, function() }, function()
TriggerServerEvent('esx:onPlayerSpawn') TriggerServerEvent('esx:onPlayerSpawn')
TriggerEvent('esx:onPlayerSpawn') TriggerEvent('esx:onPlayerSpawn')
TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon
TriggerEvent('esx:restoreLoadout') TriggerEvent('esx:restoreLoadout')
Citizen.Wait(3000) Citizen.Wait(4000)
ShutdownLoadingScreen() ShutdownLoadingScreen()
FreezeEntityPosition(PlayerPedId(), false) ShutdownLoadingScreenNui()
DoScreenFadeIn(10000) FreezeEntityPosition(PlayerPedId(), false)
StartServerSyncLoops() DoScreenFadeIn(10000)
TriggerEvent('esx:loadingScreenOff') StartServerSyncLoops()
end) end)
TriggerEvent('esx:loadingScreenOff')
end) end)
RegisterNetEvent('esx:setMaxWeight') 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.MaxWeight = 24 -- the max inventory weight without backpack
Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds
Config.EnableDebug = false Config.EnableDebug = false
Config.UseKashacters = false
+2 -2
View File
@@ -211,10 +211,10 @@ end
ESX.StartDBSync = function() ESX.StartDBSync = function()
function saveData() function saveData()
ESX.SavePlayers() ESX.SavePlayers()
SetTimeout(15 * 60 * 1000, saveData) SetTimeout(10 * 60 * 1000, saveData)
end end
SetTimeout(15 * 60 * 1000, saveData) SetTimeout(10 * 60 * 1000, saveData)
end end
ESX.GetPlayers = function() ESX.GetPlayers = function()