Tadpole Posted December 21, 2008 Share Posted December 21, 2008 I'm makeing a marker from a house i build to go into maddoggs house and well now that ive made the marker its affecting every marker :\ then after im in my leave marker tele's me right bak to his mansion :\ heres my code :: enterhouse = createMarker ( -1418.4084, -261.6748, 27.1063, "ring", 1, 25, 50, 39, 75, getRootElement() ) exithouse = createMarker ( 1298.8835, -795.8101, 1084.0078, "arrow", 1, 25, 155, 45, 100) function enterhome ( hitPlayer, matchingDimension ) setElementInterior ( hitPlayer, 5, 1272.9116, -768.9028, 1084.5097 ) end addEventHandler ( "onMarkerHit", getRootElement(), enterhome ) function exithome ( hitPlayer, matchingDimension ) if exithome then setElementInterior ( hitPlayer, 0, -1425.4689, -270.7399, 27.1067 ) else return end end addEventHandler ( "onMarkerHit", exithouse, exithome ) Can some 1 plz help me thx in advance ^^ Link to comment
robhol Posted December 21, 2008 Share Posted December 21, 2008 instead of the getRootElement() inside the addEventHandler() calls, use the marker. Link to comment
Tadpole Posted December 22, 2008 Author Share Posted December 22, 2008 ok i did that but it still isint working it takes me straight to the outside of my house were i would be if i walked through the exitmarker an witch i havent walked through it so it dont take me into house now thanks for the reply ^^ EDIT:it worked forgot to refresh server window X.X thanks for the help! Link to comment
greacius Posted March 18, 2009 Share Posted March 18, 2009 enterhouse = createMarker ( -1418.4084, -261.6748, 27.1063, "ring", 1, 25, 50, 39, 75, ) setElementData ( enterhouse, "type", "enterhouse" ) exithouse = createMarker ( 1298.8835, -795.8101, 1084.0078, "arrow", 1, 25, 155, 45, 100 ) setElementData ( exithouse, ""type", "exithouse" ) function exitenter ( hitPlayer, matchingDimension ) if getElementData ( source, "type" ) == "enterhouse" then setElementInterior ( hitPlayer, 5, 1272.9116, -768.9028, 1084.5097 ) elseif getElementData ( source, "type" ) == "exithouse" then setElementInterior ( hitPlayer, 0, -1425.4689, -270.7399, 27.1067 ) end end addEventHandler ( "onMarkerHit", getRootElement(), exitenter ) Maybe try this or make a .map file..... Link to comment
jkub Posted March 18, 2009 Share Posted March 18, 2009 as the beast philly himself Ive went through this before try this. It should work enterhouse = createMarker ( -1418.4084, -261.6748, 27.1063, "ring", 1, 25, 50, 39, 75 ) exithouse = createMarker ( 1298.8835, -795.8101, 1084.0078, "arrow", 1, 25, 155, 45, 100 ) function exitenter ( hitPlayer, matchingDimension ) if source == enterhouse then -- if the marker is the enterhouse marker setElementInterior ( hitPlayer, 5, 1272.9116, -768.9028, 1084.5097 ) elseif source == exithouse then -- if it is not enterhouse but the exithouse marker setElementInterior ( hitPlayer, 0, -1425.4689, -270.7399, 27.1067 ) end end addEventHandler ( "onMarkerHit", getRootElement(), exitenter ) If I am correct when you use the "onMarkerHit" event handler then the source for that handler is always the marker that was hit. 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