diff --git a/server-data/resources/[bpt_addons]/bpt_unicornjob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_unicornjob/client/main.lua index de7616fde..f85dce71f 100644 --- a/server-data/resources/[bpt_addons]/bpt_unicornjob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_unicornjob/client/main.lua @@ -2,20 +2,17 @@ local HasAlreadyEnteredMarker local CurrentAction, CurrentActionMsg, CurrentActionData = nil, "", {} local LastZone -RegisterNetEvent("esx:playerLoaded") -AddEventHandler("esx:playerLoaded", function(xPlayer) +RegisterNetEvent("esx:playerLoaded", function(xPlayer) ESX.PlayerData = xPlayer ESX.PlayerLoaded = true end) -RegisterNetEvent("esx:onPlayerLogout") -AddEventHandler("esx:onPlayerLogout", function() +RegisterNetEvent("esx:onPlayerLogout", function() ESX.PlayerLoaded = false ESX.PlayerData = {} end) -RegisterNetEvent("esx:setJob") -AddEventHandler("esx:setJob", function(job) +RegisterNetEvent("esx:setJob", function(job) ESX.PlayerData.job = job end) @@ -259,7 +256,7 @@ function IsInAuthorizedVehicle() return false end -AddEventHandler("bpt_unicornjob:hasEnteredMarker", function(zone) +RegisterNetEvent("bpt_unicornjob:hasEnteredMarker", function(zone) if zone == "VehicleSpawner" then CurrentAction = "vehicle_spawner" CurrentActionMsg = _U("spawner_prompt") @@ -286,7 +283,7 @@ AddEventHandler("bpt_unicornjob:hasEnteredMarker", function(zone) end end) -AddEventHandler("bpt_unicornjob:hasExitedMarker", function() +RegisterNetEvent("bpt_unicornjob:hasExitedMarker", function() ESX.CloseContext() CurrentAction = nil end) diff --git a/server-data/resources/[bpt_addons]/bpt_unicornjob/server/main.lua b/server-data/resources/[bpt_addons]/bpt_unicornjob/server/main.lua index 2a5137391..3c41fe3bd 100644 --- a/server-data/resources/[bpt_addons]/bpt_unicornjob/server/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_unicornjob/server/main.lua @@ -36,8 +36,7 @@ ESX.RegisterServerCallback("bpt_unicornjob:SpawnVehicle", function(source, cb, m cb() end) -RegisterNetEvent("bpt_unicornjob:getStockItem") -AddEventHandler("bpt_unicornjob:getStockItem", function(itemName, count) +RegisterNetEvent("bpt_unicornjob:getStockItem", function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) if xPlayer.job.name == "unicorn" then @@ -69,8 +68,7 @@ ESX.RegisterServerCallback("bpt_unicornjob:getStockItems", function(_, cb) end) end) -RegisterNetEvent("bpt_unicornjob:putStockItems") -AddEventHandler("bpt_unicornjob:putStockItems", function(itemName, count) +RegisterNetEvent("bpt_unicornjob:putStockItems", function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) local sourceItem = xPlayer.getInventoryItem(itemName) diff --git a/server-data/resources/[esx]/es_extended/server/commands.lua b/server-data/resources/[esx]/es_extended/server/commands.lua index 1c998368f..6f43bca6d 100644 --- a/server-data/resources/[esx]/es_extended/server/commands.lua +++ b/server-data/resources/[esx]/es_extended/server/commands.lua @@ -703,4 +703,4 @@ ESX.RegisterCommand("players", "admin", function() local xPlayer = xPlayers[i] print(("^1[^2ID: ^5%s^0 | ^2Name : ^5%s^0 | ^2Group : ^5%s^0 | ^2Identifier : ^5%s^1]^0\n"):format(xPlayer.source, xPlayer.getName(), xPlayer.getGroup(), xPlayer.identifier)) end -end, true) +end, true) \ No newline at end of file