Jump to content

Need some help


Cizzo

Recommended Posts

I want to make enter in interiors with markers,but something is wrong.When i hit on "enter" marker i got teleport to the sky and falling down.

local teleport = createMarker ( 2232.8212890625, -1159.7487792969, 24.890640258789, "cylinder", 1.5, 0, 255, 0, 175 )
function MarkerHit ( hitPlayer, matchingDimensio )
        if getElementType(hitPlayer)=="player" and source == teleport then
            setElementInterior(source, 15, 2217.6250 , -1150.6580, 1025.7970 )
		 setElementPosition(hitPlayer,2216,-1150,1026)
		 setPedRotation(hitPlayer,90)
        end
end
addEventHandler("onMarkerHit", getRootElement (), MarkerHit)

I think i need to do something with setElementInterior,but i don't know what.

Link to comment

What you do, is actually moving the marker to another interior not the player. You move player to the position where the interior is but you don't change his interior. To solve it, just use setElementInterior with player/ped element in the first argument.

You shouldn't move the marker at all, because when you enter that marker again it will be moved again to the same location, unless you do some checks. To solve that, simply make another marker instead.

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