QBUS - TPing to same location everytime error

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

  1. 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.

  2. 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
2021-10-31 13_17_13-FiveM - 🌄 DK ⛱️ SandCityRP 2.0 _ 15+ _ Custom Scripts _ VOIP _ Allowlist _ Mu

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.

then i get these errrors

Did you change anything in the code?

Also, try other coordinates.
Example coordinates: -535.8 -1090.1 22.4

didnt change anything no i doesnt seem to work. i only get these errors

Try this. It’s the same code, but as a resource.

r1_test.rar (600 Bytes)

seems to work now thanks 1000x

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.