TP with heading support

Added support for the heading argument when using the /tp command.
This commit is contained in:
Borre
2025-01-24 19:27:01 +01:00
committed by GitHub
parent 989868262c
commit e90fa91102
+2 -1
View File
@@ -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 x = tonumber((args[1]:gsub(',', ''))) + .0
local y = tonumber((args[2]:gsub(',', ''))) + .0 local y = tonumber((args[2]:gsub(',', ''))) + .0
local z = tonumber((args[3]: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 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 else
TriggerClientEvent('QBCore:Notify', source, Lang:t('error.wrong_format'), 'error') TriggerClientEvent('QBCore:Notify', source, Lang:t('error.wrong_format'), 'error')
end end