Jump to content

[HELP]


noonbr

Recommended Posts

When the usage is the same as the vehicle is teleported along with me, the isPedInVehicle is false.
local tp1 = createMarker(1530.607421875,-1685.4215087891,13.3828125, "cylinder", 1, 255,255,255,100)

function msg(hitElement)

	if (isPedInVehicle(hitElement) == false) then

		outputChatBox("Hello World!", hitElement)
		setElementPosition(hitElement, 1522.2706298828,-1687.1689453125,13.546875, true)

	end
end
addEventHandler("onMarkerHit", tp1, msg)

 

Even if I use a car in the marker it is teleported but the other functions do not occur, just the setElementPosition.

Edited by GM_Goulart
Link to comment

I don't understand what you mean, however, I'd like to point out your code will trigger on any marker instead of only on tp1, because of propagation of events. You need to add a false right aft er the function in the event handler to only bind it on the specified element and not its parents. In other words, you should be using addEventHandler("onMarkerHit", tp1, msg, false)

Also, please, use a proper, more helpful, topic title next time. Just putting in [HELP] doesn't inform us what the problem is, and therefore people are unlikely to click your topic if they don't know the problem relates to their expertise.

Edited by MrTasty
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...