mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-03 03:38:53 +00:00
Fix TP
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
-- QBCore Command Events
|
||||
RegisterNetEvent('QBCore:Command:TeleportToPlayer')
|
||||
AddEventHandler('QBCore:Command:TeleportToPlayer', function(coords)
|
||||
local ped = PlayerPedId()
|
||||
SetPedCoordsKeepVehicle(ped, coords.x, coords.y, coords.z)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Command:TeleportToCoords')
|
||||
AddEventHandler('QBCore:Command:TeleportToCoords', function(x, y, z)
|
||||
local ped = PlayerPedId()
|
||||
SetPedCoordsKeepVehicle(ped, x, y, z)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Command:SpawnVehicle')
|
||||
AddEventHandler('QBCore:Command:SpawnVehicle', function(model)
|
||||
QBCore.Functions.SpawnVehicle(model, function(vehicle)
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ QBCore.Commands.Add("tp", "TP To Player or Coords (Admin Only)", {{name="id/x",
|
||||
local target = GetPlayerPed(tonumber(args[1]))
|
||||
if target ~= 0 then
|
||||
local coords = GetEntityCoords(target)
|
||||
SetPedCoordsKeepVehicle(player, coords.x, coords.y, coords.z)
|
||||
TriggerClientEvent('QBCore:Command:TeleportToPlayer', source, coords)
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, "Player Not Online", "error")
|
||||
end
|
||||
@@ -40,7 +40,7 @@ QBCore.Commands.Add("tp", "TP To Player or Coords (Admin Only)", {{name="id/x",
|
||||
local y = tonumber(args[2])
|
||||
local z = tonumber(args[3])
|
||||
if (x ~= 0) and (y ~= 0) and (z ~= 0) then
|
||||
SetPedCoordsKeepVehicle(player, x, y, z)
|
||||
TriggerClientEvent('QBCore:Command:TeleportToCoords', source, x, y, z)
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, "Incorrect Format", "error")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user