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. "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
manawydan Posted May 29, 2013 Posted May 29, 2013 setElementInterior ? "Querer não é poder, mas tentar é avançar"!
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 Ok does this also work with own created Interiors? "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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? "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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... ? "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
Castillo Posted May 29, 2013 Posted May 29, 2013 You can create it, yes. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ) "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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 . " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Castillo Posted May 29, 2013 Posted May 29, 2013 Change 'source' to 'hitElement' at setElementInterior. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 Thank You I will try that and reply if it worked or not. "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
ViRuZGamiing Posted May 29, 2013 Author Posted May 29, 2013 Thanks, Can I set a Marker in an Interior and how? "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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? "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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 "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
Castillo Posted May 31, 2013 Posted May 31, 2013 You had it on your code, so he just left it there. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
Moderators IIYAMA Posted May 31, 2013 Moderators Posted May 31, 2013 error? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
ViRuZGamiing Posted May 31, 2013 Author Posted May 31, 2013 none "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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 ); " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
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