mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user