ViRuZGamiing Posted May 29, 2013 Posted May 29, 2013 Hello Community, I want to make a Marker (createMarker) when onMarkerHit I want to enter an interior. How can I make it enter it and how to return with another marker. Thanks.
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 Ok does this also work with own created Interiors?
Castillo Posted May 29, 2013 Posted May 29, 2013 What do you mean by "own created interiors"? you can create objects inside an interior ( on a free space ), then use that interior ID at setElementInterior, but you can't add new interior IDs.
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 + Where can I get the Id's for the interiors in this function? @SolidSnake14 Is every Interior an new dimension? So I can create as example an interior in ID 1 and use other coordinates? + Are there more Interiors in 1 ID but other coordinates?
Castillo Posted May 29, 2013 Posted May 29, 2013 Yes, there are more than one interior inside ID 1. https://wiki.multitheftauto.com/wiki/Interior_IDs
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 So is it possible to make a new room in Interior ID 1 or 2... ?
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 Here's my code, No Errors but Marker dissapears after hit and nothing happens furter. local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler local elementType = getElementType( hitElement ) -- get the hit element's type setElementInterior(source, 3, 1494.3350, 1305.6510, 1093.2890) end addEventHandler( "onMarkerHit", myMarker, MarkerHit )
PaiN^ Posted May 29, 2013 Posted May 29, 2013 The source of onMarkerHit event is the marker that got hit, It's dissapearing because you're sending it to another interior .
Castillo Posted May 29, 2013 Posted May 29, 2013 Change 'source' to 'hitElement' at setElementInterior.
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 Thank You I will try that and reply if it worked or not.
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 Thanks, Can I set a Marker in an Interior and how?
Metall Posted May 29, 2013 Posted May 29, 2013 Thanks, Can I set a Marker in an Interior and how? local marker = createMarker() setElementInterior(marker, interior) setElementDimension(marker, dimension)
ViRuZGamiing Posted May 30, 2013 Author Posted May 30, 2013 local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) setElementInterior(source, 3, 1494.3350, 1305.6510, 1093.2890) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) local marker = createMarker() setElementInterior(myMarker, 1494.3350, 1305.6510, 1093.2890) setElementDimension(myMarker, 3) Correct?
Castillo Posted May 30, 2013 Posted May 30, 2013 Wrong, that makes no sense, you are creating 2 markers, one without any argument at all.
jirco Posted May 31, 2013 Posted May 31, 2013 Yea I think I get I will upload the code this evening when i'm on my PC @Sended on my friends PC
Moderators IIYAMA Posted May 31, 2013 Moderators Posted May 31, 2013 remove: local marker = createMarker() -- line 9 Also: setElementInterior(myMarker, 1494.3350, 1305.6510, 1093.2890) setElementInterior ( element theElement, int interior [, float x, float y, float z] ) -- read syntax clearly local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890) end end setElementInterior(myMarker,3, 1494.3350, 1305.6510, 1093.2890)-- I have set it to interior 3, if that isn't your interior you have to change the value setElementDimension(myMarker, 3) addEventHandler( "onMarkerHit", myMarker, MarkerHit )
ViRuZGamiing Posted May 31, 2013 Author Posted May 31, 2013 Thanks but where is a Dimension needed for? (Noob question) I know an Interior is in an other world then but still Dimension 0
ViRuZGamiing Posted May 31, 2013 Author Posted May 31, 2013 local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890) end end setElementInterior(myMarker,3, 1494.3350, 1305.6510, 1093.2890)-- I have set it to interior 3, if that isn't your interior you have to change the value setElementDimension(myMarker, 3) addEventHandler( "onMarkerHit", myMarker, MarkerHit ) doesn't work
PaiN^ Posted June 1, 2013 Posted June 1, 2013 Try this : local myMarker = createMarker( -2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150 ); setElementInterior( myMarker, 3, 1494.3350, 1305.6510, 1093.2890 ); setElementDimension( myMarker, 3 ); function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == 'player' then setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890 ); end end addEventHandler( 'onMarkerHit', myMarker, MarkerHit );
iPrestege Posted June 1, 2013 Posted June 1, 2013 Try this : local myMarker = createMarker( -2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150 ); setElementInterior( myMarker, 3, 1494.3350, 1305.6510, 1093.2890 ); setElementDimension( myMarker, 3 ); function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == 'player' then setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890 ); end end addEventHandler( 'onMarkerHit', myMarker, MarkerHit ); What's the point to use ( setElementInterior ) Function? The player hit the marker when it's already at the interior 3 use ( setElementPosition ) Would be much better .
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now