Merge pull request #265 from savagefromlx/main

tweak(es_Extended/server/functions.lua): warn when an unregisted item is used
This commit is contained in:
Mycroft
2022-05-19 21:15:14 +01:00
committed by GitHub
2 changed files with 8 additions and 5 deletions
+3 -4
View File
@@ -163,14 +163,13 @@ ESX.RegisterCommand('info', {"user", "admin"}, function(xPlayer, args, showError
end, true)
ESX.RegisterCommand('coords', "admin", function(xPlayer, args, showError)
local coords = GetEntityCoords(GetPlayerPed(xPlayer.source), false)
local heading = GetEntityHeading(GetPlayerPed(xPlayer.source))
local ped = GetPlayerPed(xPlayer.source)
local coords = GetEntityCoords(ped, false)
local heading = GetEntityHeading(ped)
print("Coords - Vector3: ^5".. vector3(coords.x,coords.y,coords.z).. "^0")
print("Coords - Vector4: ^5".. vector4(coords.x, coords.y, coords.z, heading) .. "^0")
end, true)
ESX.RegisterCommand('tpm', "admin", function(xPlayer, args, showError)
xPlayer.triggerEvent("esx:tpm")
end, true)
+5 -1
View File
@@ -259,7 +259,11 @@ function ESX.RegisterUsableItem(item, cb)
end
function ESX.UseItem(source, item, data)
Core.UsableItemsCallbacks[item](source, item, data)
if ESX.Items[item] then
Core.UsableItemsCallbacks[item](source, item, data)
else
print(('[^3WARNING^7] Item ^5"%s"^7 was used but does not exist!'):format(item))
end
end
function ESX.GetItemLabel(item)