diff --git a/[core]/es_extended/server/commands.lua b/[core]/es_extended/server/commands.lua index 6b6b33bd..80548c17 100644 --- a/[core]/es_extended/server/commands.lua +++ b/[core]/es_extended/server/commands.lua @@ -1,4 +1,4 @@ -ESX.RegisterCommand('setcoords', 'admin', function(xPlayer, args) +ESX.RegisterCommand({'setcoords', 'tp'}, 'admin', function(xPlayer, args) xPlayer.setCoords({ x = args.x, y = args.y, z = args.z }) if Config.AdminLogging then ESX.DiscordLogFields("UserActions", "Set Coordinates /setcoords Triggered!", "pink", { @@ -13,9 +13,9 @@ end, false, { help = TranslateCap('command_setcoords'), validate = true, arguments = { - { name = 'x', help = TranslateCap('command_setcoords_x'), type = 'number' }, - { name = 'y', help = TranslateCap('command_setcoords_y'), type = 'number' }, - { name = 'z', help = TranslateCap('command_setcoords_z'), type = 'number' } + { name = 'x', help = TranslateCap('command_setcoords_x'), type = 'coordinate' }, + { name = 'y', help = TranslateCap('command_setcoords_y'), type = 'coordinate' }, + { name = 'z', help = TranslateCap('command_setcoords_z'), type = 'coordinate' } } }) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index 0050ed63..90c5765e 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -113,7 +113,14 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion) local merge = table.concat(args, " ") newArgs[v.name] = string.sub(merge, lenght) - end + elseif v.type == 'coordinate' then + local coord = tonumber(args[k]:match("(-?%d+%.?%d*)")) + if(not coord) then + error = TranslateCap('commanderror_argumentmismatch_number', k) + else + newArgs[v.name] = coord + end + end end --backwards compatibility