When i tp to coords. no matter what coords it is i always get tped to same location. does anyone know why this is happening
the location i always get tped to
When i tp to coords. no matter what coords it is i always get tped to same location. does anyone know why this is happening
the location i always get tped to
One reason could be the usage of the function.
If you tried with x, y, z then now try without the commas (x y z) instead.
If that doesn’t work then try to provide the code for the teleport.
If you can’t find it then below is a simple teleport-to-coordinates command. Put it in a client script and restart it. Usage /teleportme x y z
RegisterCommand("teleportme", function(source, args, rawCommand)
local x = tonumber(args[1])
local y = tonumber(args[2])
local z = tonumber(args[3])
if x ~= nil or y ~= nil or z ~= nil then
if not GetGroundZFor_3dCoord(x, y, z, true) then
c = true
while c do
Citizen.Wait(0)
if not GetGroundZFor_3dCoord(x, y, z, true) then
z = (z + 0.5)
SetPedCoordsKeepVehicle(PlayerPedId(), x, y, z)
else
c = false
end
end
else
SetPedCoordsKeepVehicle(PlayerPedId(), x, y, z)
end
else
print("Incorrect input, usage: /teleportme x y z")
end
end, true)
What was used to create the above command
How To Create A Command
SetPedCoordsKeepVehicle()
GetGroundZFor_3dCoord()
do you know how to give access to use this command
At the very bottom of the last line, change from true to false to allow for everyone.
end, true)
Or to give specific access, keep it to true, and read here on how to do so.
Did you change anything in the code?
Also, try other coordinates.
Example coordinates: -535.8 -1090.1 22.4
seems to work now thanks 1000x
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.