mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:01:22 +00:00
@@ -4,5 +4,5 @@ end)
|
||||
|
||||
AddEventHandler("esx:getSharedObject", function()
|
||||
local Invoke = GetInvokingResource()
|
||||
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
|
||||
error(("Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
|
||||
end)
|
||||
|
||||
@@ -140,12 +140,13 @@ function ESX.RefreshContext(...)
|
||||
end
|
||||
|
||||
function ESX.RegisterInput(command_name, label, input_group, key, on_press, on_release)
|
||||
RegisterCommand(on_release and '+' .. command_name or command_name, on_press)
|
||||
Core.Input[command_name] = ESX.HashString(command_name)
|
||||
local command = on_release and '+' .. command_name or command_name
|
||||
RegisterCommand(command, on_press)
|
||||
Core.Input[command_name] = ESX.HashString(command)
|
||||
if on_release then
|
||||
RegisterCommand('-' .. command_name, on_release)
|
||||
end
|
||||
RegisterKeyMapping(command_name, label or '', input_group or 'keyboard', key or '')
|
||||
RegisterKeyMapping(command, label or '', input_group or 'keyboard', key or '')
|
||||
end
|
||||
|
||||
function ESX.UI.Menu.RegisterType(menuType, open, close)
|
||||
@@ -321,7 +322,7 @@ function ESX.Game.Teleport(entity, coords, cb)
|
||||
end
|
||||
|
||||
function ESX.Game.SpawnObject(object, coords, cb, networked)
|
||||
local obj = CreateObject(ESX.Streaming.RequestModel(object), coords.x, coords.y. coords.z, networked == nil or networked, false, true)
|
||||
local obj = CreateObject(ESX.Streaming.RequestModel(object), coords.x, coords.y, coords.z, networked == nil or networked, false, true)
|
||||
return cb and cb(obj) or obj
|
||||
end
|
||||
|
||||
@@ -352,7 +353,7 @@ function ESX.Game.SpawnVehicle(vehicleModel, coords, heading, cb, networked)
|
||||
local dist = #(playerCoords - vector)
|
||||
if dist > 424 then -- Onesync infinity Range (https://docs.fivem.net/docs/scripting-reference/onesync/)
|
||||
local executingResource = GetInvokingResource() or "Unknown"
|
||||
return print(("[^1ERROR^7] Resource ^5%s^7 Tried to spawn vehicle on the client but the position is too far away (Out of onesync range)."):format(executingResource))
|
||||
return error(("Resource ^5%s^7 Tried to spawn vehicle on the client but the position is too far away (Out of onesync range)."):format(executingResource))
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
@@ -491,8 +492,9 @@ end
|
||||
|
||||
function ESX.Game.RaycastScreen(depth, ...)
|
||||
local world, normal = GetWorldCoordFromScreenCoord(.5, .5)
|
||||
local origin = world + normal
|
||||
local target = world + normal * depth
|
||||
return target, ESX.Game.GetShapeTestResultAsync(StartShapeTestLosProbe(world + normal, target, ...))
|
||||
return target, ESX.Game.GetShapeTestResultSync(StartShapeTestLosProbe(origin.x, origin.y, origin.z, target.x, target.y, target.z, ...))
|
||||
end
|
||||
|
||||
function ESX.Game.GetClosestEntity(entities, isPlayerEntities, coords, modelFilter)
|
||||
@@ -507,7 +509,7 @@ function ESX.Game.GetClosestEntity(entities, isPlayerEntities, coords, modelFilt
|
||||
|
||||
if modelFilter then
|
||||
filteredEntities = {}
|
||||
|
||||
|
||||
for currentEntityIndex = 1, #entities do
|
||||
if modelFilter[GetEntityModel(entities[currentEntityIndex])] then
|
||||
filteredEntities[#filteredEntities + 1] = entities[currentEntityIndex]
|
||||
|
||||
@@ -37,7 +37,7 @@ function ESX.SpawnPlayer(skin, coords, cb)
|
||||
while not HasCollisionLoadedAroundEntity(playerPed) and (GetGameTimer() - timer) < 5000 do
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
|
||||
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, true, false)
|
||||
TriggerEvent('playerSpawned', coords)
|
||||
cb()
|
||||
@@ -337,17 +337,17 @@ if not Config.OxInventory then
|
||||
|
||||
RegisterNetEvent("esx:addWeapon")
|
||||
AddEventHandler("esx:addWeapon", function()
|
||||
print("[^1ERROR^7] event ^5'esx:addWeapon'^7 Has Been Removed. Please use ^5xPlayer.addWeapon^7 Instead!")
|
||||
error("event ^5'esx:addWeapon'^7 Has Been Removed. Please use ^5xPlayer.addWeapon^7 Instead!")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx:addWeaponComponent")
|
||||
AddEventHandler("esx:addWeaponComponent", function()
|
||||
print("[^1ERROR^7] event ^5'esx:addWeaponComponent'^7 Has Been Removed. Please use ^5xPlayer.addWeaponComponent^7 Instead!")
|
||||
error("event ^5'esx:addWeaponComponent'^7 Has Been Removed. Please use ^5xPlayer.addWeaponComponent^7 Instead!")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx:setWeaponAmmo")
|
||||
AddEventHandler("esx:setWeaponAmmo", function()
|
||||
print("[^1ERROR^7] event ^5'esx:setWeaponAmmo'^7 Has Been Removed. Please use ^5xPlayer.addWeaponAmmo^7 Instead!")
|
||||
error("event ^5'esx:setWeaponAmmo'^7 Has Been Removed. Please use ^5xPlayer.addWeaponAmmo^7 Instead!")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx:setWeaponTint")
|
||||
@@ -357,7 +357,7 @@ if not Config.OxInventory then
|
||||
|
||||
RegisterNetEvent("esx:removeWeapon")
|
||||
AddEventHandler("esx:removeWeapon", function()
|
||||
print("[^1ERROR^7] event ^5'esx:removeWeapon'^7 Has Been Removed. Please use ^5xPlayer.removeWeapon^7 Instead!")
|
||||
error("event ^5'esx:removeWeapon'^7 Has Been Removed. Please use ^5xPlayer.removeWeapon^7 Instead!")
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx:removeWeaponComponent")
|
||||
@@ -721,4 +721,4 @@ end)
|
||||
|
||||
RegisterNetEvent('esx:updatePlayerData', function(key, val)
|
||||
ESX.SetPlayerData(key, val)
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -16,7 +16,7 @@ end
|
||||
|
||||
RegisterNetEvent("esx:serverCallback", function(requestId, invoker, ...)
|
||||
if not serverRequests[requestId] then
|
||||
return print(("[^1ERROR^7] Server Callback with requestId ^5%s^7 Was Called by ^5%s^7 but does not exist."):format(requestId, invoker))
|
||||
return error(("Server Callback with requestId ^5%s^7 Was Called by ^5%s^7 but does not exist."):format(requestId, invoker))
|
||||
end
|
||||
|
||||
serverRequests[requestId](...)
|
||||
@@ -31,7 +31,7 @@ end
|
||||
|
||||
RegisterNetEvent("esx:triggerClientCallback", function(eventName, requestId, invoker, ...)
|
||||
if not clientCallbacks[eventName] then
|
||||
return print(("[^1ERROR^7] Client Callback not registered, name: ^5%s^7, invoker resource: ^5%s^7"):format(eventName, invoker))
|
||||
return error(("Client Callback not registered, name: ^5%s^7, invoker resource: ^5%s^7"):format(eventName, invoker))
|
||||
end
|
||||
|
||||
clientCallbacks[eventName](function(...)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
Config = {}
|
||||
Config.Locale = GetConvar("esx:locale", "en")
|
||||
|
||||
local txAdminLocale = GetConvar("txAdmin-locale", "en")
|
||||
local esxLocale = GetConvar("esx:locale", "invalid")
|
||||
|
||||
Config.Locale = (esxLocale ~= "invalid") and esxLocale or (txAdminLocale ~= "custom" and txAdminLocale) or "en"
|
||||
|
||||
Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Locales = {}
|
||||
|
||||
function Translate(str, ...) -- Translate string
|
||||
if not str then
|
||||
print(("[^1ERROR^7] Resource ^5%s^7 You did not specify a parameter for the Translate function or the value is nil!"):format(GetInvokingResource() or GetCurrentResourceName()))
|
||||
error(("Resource ^5%s^7 You did not specify a parameter for the Translate function or the value is nil!"):format(GetInvokingResource() or GetCurrentResourceName()))
|
||||
return "Given translate function parameter is nil!"
|
||||
end
|
||||
if Locales[Config.Locale] then
|
||||
|
||||
@@ -273,7 +273,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
function self.setAccountMoney(accountName, money, reason)
|
||||
reason = reason or "unknown"
|
||||
if not tonumber(money) then
|
||||
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
error(("Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
return
|
||||
end
|
||||
if money >= 0 then
|
||||
@@ -286,10 +286,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
self.triggerEvent("esx:setAccountMoney", account)
|
||||
_TriggerEvent("esx:setAccountMoney", self.source, accountName, money, reason)
|
||||
else
|
||||
print(("[^1ERROR^7] Tried To Set Invalid Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
error(("Tried To Set Invalid Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
end
|
||||
else
|
||||
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
error(("Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -300,7 +300,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
function self.addAccountMoney(accountName, money, reason)
|
||||
reason = reason or "Unknown"
|
||||
if not tonumber(money) then
|
||||
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
error(("Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
return
|
||||
end
|
||||
if money > 0 then
|
||||
@@ -312,10 +312,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
self.triggerEvent("esx:setAccountMoney", account)
|
||||
_TriggerEvent("esx:addAccountMoney", self.source, accountName, money, reason)
|
||||
else
|
||||
print(("[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
error(("Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
end
|
||||
else
|
||||
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
error(("Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -326,7 +326,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
function self.removeAccountMoney(accountName, money, reason)
|
||||
reason = reason or "Unknown"
|
||||
if not tonumber(money) then
|
||||
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
error(("Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
return
|
||||
end
|
||||
if money > 0 then
|
||||
@@ -335,7 +335,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
if account then
|
||||
money = account.round and ESX.Math.Round(money) or money
|
||||
if self.accounts[account.index].money - money > self.accounts[account.index].money then
|
||||
print(("[^1ERROR^7] Tried To Underflow Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
error(("Tried To Underflow Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
return
|
||||
end
|
||||
self.accounts[account.index].money = self.accounts[account.index].money - money
|
||||
@@ -343,10 +343,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
self.triggerEvent("esx:setAccountMoney", account)
|
||||
_TriggerEvent("esx:removeAccountMoney", self.source, accountName, money, reason)
|
||||
else
|
||||
print(("[^1ERROR^7] Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
error(("Tried To Set Add To Invalid Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
|
||||
end
|
||||
else
|
||||
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
error(("Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -396,7 +396,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
self.triggerEvent("esx:removeInventoryItem", item.name, item.count)
|
||||
end
|
||||
else
|
||||
print(("[^1ERROR^7] Player ID:^5%s Tried remove a Invalid count -> %s of %s"):format(self.playerId, count, itemName))
|
||||
error(("Player ID:^5%s Tried remove a Invalid count -> %s of %s"):format(self.playerId, count, itemName))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -598,7 +598,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
local weaponLabel, playerPed <const> = nil, _GetPlayerPed(self.source)
|
||||
|
||||
if not playerPed then
|
||||
return print("[^1ERROR^7] xPlayer.removeWeapon ^5invalid^7 player ped!")
|
||||
return error("xPlayer.removeWeapon ^5invalid^7 player ped!")
|
||||
end
|
||||
|
||||
for k, v in ipairs(self.loadout) do
|
||||
@@ -755,12 +755,12 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
end
|
||||
|
||||
if type(index) ~= "string" then
|
||||
return print("[^1ERROR^7] xPlayer.getMeta ^5index^7 should be ^5string^7!")
|
||||
return error("xPlayer.getMeta ^5index^7 should be ^5string^7!")
|
||||
end
|
||||
|
||||
local metaData = self.metadata[index]
|
||||
if metaData == nil then
|
||||
return Config.EnableDebug and print(("[^1ERROR^7] xPlayer.getMeta ^5%s^7 not exist!"):format(index)) or nil
|
||||
return Config.EnableDebug and error(("xPlayer.getMeta ^5%s^7 not exist!"):format(index)) or nil
|
||||
end
|
||||
|
||||
if subIndex and type(metaData) == "table" then
|
||||
@@ -779,14 +779,14 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
if type(key) == "string" then
|
||||
returnValues[key] = self.getMeta(index, key)
|
||||
else
|
||||
print(("[^1ERROR^7] xPlayer.getMeta subIndex should be ^5string^7 or ^5table^7! that contains ^5string^7, received ^5%s^7!, skipping..."):format(type(key)))
|
||||
error(("xPlayer.getMeta subIndex should be ^5string^7 or ^5table^7! that contains ^5string^7, received ^5%s^7!, skipping..."):format(type(key)))
|
||||
end
|
||||
end
|
||||
|
||||
return returnValues
|
||||
end
|
||||
|
||||
return print(("[^1ERROR^7] xPlayer.getMeta subIndex should be ^5string^7 or ^5table^7!, received ^5%s^7!"):format(_type))
|
||||
return error(("xPlayer.getMeta subIndex should be ^5string^7 or ^5table^7!, received ^5%s^7!"):format(_type))
|
||||
end
|
||||
|
||||
return metaData
|
||||
@@ -798,28 +798,28 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
---@return void
|
||||
function self.setMeta(index, value, subValue)
|
||||
if not index then
|
||||
return print("[^1ERROR^7] xPlayer.setMeta ^5index^7 is Missing!")
|
||||
return error("xPlayer.setMeta ^5index^7 is Missing!")
|
||||
end
|
||||
|
||||
if type(index) ~= "string" then
|
||||
return print("[^1ERROR^7] xPlayer.setMeta ^5index^7 should be ^5string^7!")
|
||||
return error("xPlayer.setMeta ^5index^7 should be ^5string^7!")
|
||||
end
|
||||
|
||||
if value == nil then
|
||||
return print("[^1ERROR^7] xPlayer.setMeta value is missing!")
|
||||
return error("xPlayer.setMeta value is missing!")
|
||||
end
|
||||
|
||||
local _type = type(value)
|
||||
|
||||
if not subValue then
|
||||
if _type ~= "number" and _type ~= "string" and _type ~= "table" then
|
||||
return print(("[^1ERROR^7] xPlayer.setMeta ^5%s^7 should be ^5number^7 or ^5string^7 or ^5table^7!"):format(value))
|
||||
return error(("xPlayer.setMeta ^5%s^7 should be ^5number^7 or ^5string^7 or ^5table^7!"):format(value))
|
||||
end
|
||||
|
||||
self.metadata[index] = value
|
||||
else
|
||||
if _type ~= "string" then
|
||||
return print(("[^1ERROR^7] xPlayer.setMeta ^5value^7 should be ^5string^7 as a subIndex!"):format(value))
|
||||
return error(("xPlayer.setMeta ^5value^7 should be ^5string^7 as a subIndex!"):format(value))
|
||||
end
|
||||
|
||||
if not self.metadata[index] or type(self.metadata[index]) ~= "table" then
|
||||
@@ -834,16 +834,16 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
|
||||
function self.clearMeta(index, subValues)
|
||||
if not index then
|
||||
return print("[^1ERROR^7] xPlayer.clearMeta ^5index^7 is Missing!")
|
||||
return error("xPlayer.clearMeta ^5index^7 is Missing!")
|
||||
end
|
||||
|
||||
if type(index) ~= "string" then
|
||||
return print("[^1ERROR^7] xPlayer.clearMeta ^5index^7 should be ^5string^7!")
|
||||
return error("xPlayer.clearMeta ^5index^7 should be ^5string^7!")
|
||||
end
|
||||
|
||||
local metaData = self.metadata[index]
|
||||
if metaData == nil then
|
||||
return Config.EnableDebug and print(("[^1ERROR^7] xPlayer.clearMeta ^5%s^7 does not exist!"):format(index)) or nil
|
||||
return Config.EnableDebug and error(("xPlayer.clearMeta ^5%s^7 does not exist!"):format(index)) or nil
|
||||
end
|
||||
|
||||
if not subValues then
|
||||
@@ -854,7 +854,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
if type(metaData) == "table" then
|
||||
metaData[subValues] = nil
|
||||
else
|
||||
return print(("[^1ERROR^7] xPlayer.clearMeta ^5%s^7 is not a table! Cannot clear subValue ^5%s^7."):format(index, subValues))
|
||||
return error(("xPlayer.clearMeta ^5%s^7 is not a table! Cannot clear subValue ^5%s^7."):format(index, subValues))
|
||||
end
|
||||
elseif type(subValues) == "table" then
|
||||
-- If subValues is a table, we will clear multiple subValues within the table
|
||||
@@ -864,14 +864,14 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
if type(metaData) == "table" then
|
||||
metaData[subValue] = nil
|
||||
else
|
||||
print(("[^1ERROR^7] xPlayer.clearMeta ^5%s^7 is not a table! Cannot clear subValue ^5%s^7."):format(index, subValue))
|
||||
error(("xPlayer.clearMeta ^5%s^7 is not a table! Cannot clear subValue ^5%s^7."):format(index, subValue))
|
||||
end
|
||||
else
|
||||
print(("[^1ERROR^7] xPlayer.clearMeta subValues should contain ^5string^7, received ^5%s^7, skipping..."):format(type(subValue)))
|
||||
error(("xPlayer.clearMeta subValues should contain ^5string^7, received ^5%s^7, skipping..."):format(type(subValue)))
|
||||
end
|
||||
end
|
||||
else
|
||||
return print(("[^1ERROR^7] xPlayer.clearMeta ^5subValues^7 should be ^5string^7 or ^5table^7, received ^5%s^7!"):format(type(subValues)))
|
||||
return error(("xPlayer.clearMeta ^5subValues^7 should be ^5string^7 or ^5table^7, received ^5%s^7!"):format(type(subValues)))
|
||||
end
|
||||
self.triggerEvent('esx:updatePlayerData', 'metadata', self.metadata)
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ end)
|
||||
|
||||
AddEventHandler("esx:getSharedObject", function()
|
||||
local Invoke = GetInvokingResource()
|
||||
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
|
||||
error(("Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
|
||||
end)
|
||||
|
||||
exports("getSharedObject", function()
|
||||
|
||||
@@ -260,7 +260,7 @@ function loadESXPlayer(identifier, playerId, isNew)
|
||||
|
||||
local name = ("%s %s"):format(result.firstname, result.lastname)
|
||||
userData.name = name
|
||||
|
||||
|
||||
xPlayer.set("firstName", result.firstname)
|
||||
xPlayer.set("lastName", result.lastname)
|
||||
xPlayer.setName(name)
|
||||
@@ -689,13 +689,13 @@ AddEventHandler("onResourceStart", function(key)
|
||||
end
|
||||
|
||||
StopResource(key)
|
||||
print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
|
||||
error(("WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
|
||||
end
|
||||
end)
|
||||
|
||||
for key in pairs(DoNotUse) do
|
||||
if GetResourceState(key) == "started" or GetResourceState(key) == "starting" then
|
||||
StopResource(key)
|
||||
print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
|
||||
error(("WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ end
|
||||
|
||||
RegisterNetEvent("esx:triggerServerCallback", function(eventName, requestId, invoker, ...)
|
||||
if not serverCallbacks[eventName] then
|
||||
return print(("[^1ERROR^7] Server Callback not registered, name: ^5%s^7, invoker resource: ^5%s^7"):format(eventName, invoker))
|
||||
return error(("Server Callback not registered, name: ^5%s^7, invoker resource: ^5%s^7"):format(eventName, invoker))
|
||||
end
|
||||
|
||||
local source = source
|
||||
@@ -35,7 +35,7 @@ end
|
||||
|
||||
RegisterNetEvent("esx:clientCallback", function(requestId, invoker, ...)
|
||||
if not clientRequests[requestId] then
|
||||
return print(("[^1ERROR^7] Client Callback with requestId ^5%s^7 Was Called by ^5%s^7 but does not exist."):format(requestId, invoker))
|
||||
return error(("Client Callback with requestId ^5%s^7 Was Called by ^5%s^7 but does not exist."):format(requestId, invoker))
|
||||
end
|
||||
|
||||
clientRequests[requestId](...)
|
||||
|
||||
@@ -93,14 +93,14 @@ function ESX.OneSync.SpawnVehicle(model, coords, heading, properties, cb)
|
||||
if vehicleType then
|
||||
local createdVehicle = CreateVehicleServerSetter(vehicleModel, vehicleType, coords, heading)
|
||||
if not DoesEntityExist(createdVehicle) then
|
||||
return print("[^1ERROR^7] Unfortunately, this vehicle has not spawned")
|
||||
return error("Unfortunately, this vehicle has not spawned")
|
||||
end
|
||||
|
||||
local networkId = NetworkGetNetworkIdFromEntity(createdVehicle)
|
||||
Entity(createdVehicle).state:set("VehicleProperties", vehicleProperties, true)
|
||||
cb(networkId)
|
||||
else
|
||||
print(("[^1ERROR^7] Tried to spawn invalid vehicle - ^5%s^7!"):format(model))
|
||||
error(("Tried to spawn invalid vehicle - ^5%s^7!"):format(model))
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -17,6 +17,3 @@ Interested in helping us? [Take a look at our patreon](https://www.patreon.com/e
|
||||
| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum |
|
||||
| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community |
|
||||
------
|
||||
|
||||
<br>
|
||||
Powered by [Oxygenserv](https://www.oxygenserv.com/en/)
|
||||
|
||||
+3
-1
@@ -29,7 +29,9 @@ set onesync on # Enable OneSync [REQUIRED FOR LEGACY 1.7.5 +]
|
||||
set mysql_connection_string "mysql://user:password@localhost/es_extended?waitForConnections=true&charset=utf8mb4"
|
||||
set mysql_ui true
|
||||
|
||||
setr esx:locale "en"
|
||||
## Umcomment to set your own locale,
|
||||
## if not, it will use the language you have selected in txAdmin.
|
||||
#setr esx:locale "en"
|
||||
|
||||
## These resources will start by default.
|
||||
ensure chat
|
||||
|
||||
Reference in New Issue
Block a user