QBCore.Commands.Add("tp", "Teleport naar een speler of location", {{name="id/x", help="ID van een speler of X positie"}, {name="y", help="Y positie"}, {name="z", help="Z positie"}}, false, function(source, args)
if (args[1] ~= nil and (args[2] == nil and args[3] == nil)) then
-- tp to player
local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
if Player ~= nil then
TriggerClientEvent('QBCore:Command:TeleportToPlayer', source, GetEntityCoords(GetPlayerPed(Player.PlayerData.source)))
else
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Oyuncu Online Değil")
end
else
-- tp to location
if args[1] ~= nil and args[2] ~= nil and args[3] ~= nil then
local x = tonumber(args[1])
local y = tonumber(args[2])
local z = tonumber(args[3])
TriggerClientEvent('QBCore:Command:TeleportToCoords', source, x, y, z)
else
TriggerClientEvent('chatMessage', source, "SYSTEM", "error", "Konum geçersiz (x, y, z)")
end
end
end, "god")