From 4546c3d04ccccabc4fcd5e1e1fcfbe42cffcbd82 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Tue, 6 Apr 2021 22:57:06 +0100 Subject: [PATCH] Revert "kashacters changes" This reverts commit 372774b8e4376d854b6ca53d9e2d6519e2ad4516. --- client/main.lua | 84 ++++++++++++++------------------------------ config.lua | 1 - server/functions.lua | 4 +-- 3 files changed, 29 insertions(+), 60 deletions(-) diff --git a/client/main.lua b/client/main.lua index 737384c4..1ab413e2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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') diff --git a/config.lua b/config.lua index 85b95982..93e400db 100644 --- a/config.lua +++ b/config.lua @@ -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 \ No newline at end of file diff --git a/server/functions.lua b/server/functions.lua index 866f8b7b..eca0a20d 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -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()