From e90fa911021597ccafe420b125cef54b90ff5a05 Mon Sep 17 00:00:00 2001 From: Borre <103928083+Borreke0@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:27:01 +0100 Subject: [PATCH] TP with heading support Added support for the heading argument when using the /tp command. --- server/commands.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/commands.lua b/server/commands.lua index 5f90980..368736f 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -104,8 +104,9 @@ QBCore.Commands.Add('tp', Lang:t('command.tp.help'), { { name = Lang:t('command. local x = tonumber((args[1]:gsub(',', ''))) + .0 local y = tonumber((args[2]:gsub(',', ''))) + .0 local z = tonumber((args[3]:gsub(',', ''))) + .0 + local heading = args[4] and tonumber((args[4]:gsub(',', ''))) + .0 or false if x ~= 0 and y ~= 0 and z ~= 0 then - TriggerClientEvent('QBCore:Command:TeleportToCoords', source, x, y, z) + TriggerClientEvent('QBCore:Command:TeleportToCoords', source, x, y, z, heading) else TriggerClientEvent('QBCore:Notify', source, Lang:t('error.wrong_format'), 'error') end