ViRuZGamiing Posted May 29, 2013 Share 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. Link to comment
ViRuZGamiing Posted May 29, 2013 Author Share Posted May 29, 2013 Ok does this also work with own created Interiors? Link to comment
Castillo Posted May 29, 2013 Share 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. Link to comment
ViRuZGamiing Posted May 29, 2013 Author Share 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? Link to comment
Castillo Posted May 29, 2013 Share Posted May 29, 2013 Yes, there are more than one interior inside ID 1. https://wiki.multitheftauto.com/wiki/Interior_IDs Link to comment
ViRuZGamiing Posted May 29, 2013 Author Share Posted May 29, 2013 So is it possible to make a new room in Interior ID 1 or 2... ? Link to comment
ViRuZGamiing Posted May 29, 2013 Author Share 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 ) Link to comment
PaiN^ Posted May 29, 2013 Share 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 . Link to comment
Castillo Posted May 29, 2013 Share Posted May 29, 2013 Change 'source' to 'hitElement' at setElementInterior. Link to comment
ViRuZGamiing Posted May 29, 2013 Author Share Posted May 29, 2013 Thank You I will try that and reply if it worked or not. Link to comment
ViRuZGamiing Posted May 29, 2013 Author Share Posted May 29, 2013 Thanks, Can I set a Marker in an Interior and how? Link to comment
Metall Posted May 29, 2013 Share Posted May 29, 2013 Thanks, Can I set a Marker in an Interior and how? local marker = createMarker() setElementInterior(marker, interior) setElementDimension(marker, dimension) Link to comment
ViRuZGamiing Posted May 30, 2013 Author Share 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? Link to comment
Castillo Posted May 30, 2013 Share Posted May 30, 2013 Wrong, that makes no sense, you are creating 2 markers, one without any argument at all. Link to comment
jirco Posted May 31, 2013 Share 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 Link to comment
Moderators IIYAMA Posted May 31, 2013 Moderators Share 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 ) Link to comment
ViRuZGamiing Posted May 31, 2013 Author Share 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 Link to comment
Castillo Posted May 31, 2013 Share Posted May 31, 2013 You had it on your code, so he just left it there. Link to comment
ViRuZGamiing Posted May 31, 2013 Author Share 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 Link to comment
PaiN^ Posted June 1, 2013 Share 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 ); Link to comment
iPrestege Posted June 1, 2013 Share 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 . Link to comment
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