Buffalo Posted March 15, 2008 Share Posted March 15, 2008 I made a script with mission markers (cyliners), but there is one bug with them. When i destoyed first cylinder marker, and created another, it didnt pass through onMarkerHit or onPlayerMarkerHit. The first marker passed it succesfully, but after destroyElement() the next one doesnt. Link to comment
Morelli Posted March 16, 2008 Share Posted March 16, 2008 Post a snippet of your code. It seems likely that the problem is hidden within there. Link to comment
Buffalo Posted March 16, 2008 Author Share Posted March 16, 2008 Don't think so, "checkpoint" is fully working. Link to comment
Phat Looser Posted March 17, 2008 Share Posted March 17, 2008 Don't think so, "checkpoint" is fully working. Just post the code and let the developers see what you did. Link to comment
Buffalo Posted March 18, 2008 Author Share Posted March 18, 2008 ok.. here it is: function consoleDrift ( player) spawnPlayer ( player, -2414.1169433594, -603.33264160156, 132.5625, 0, 43) local driftMarker = createMarker ( -2431.5637207031, -596.71917724609, 131.91340637207, "cylinder", 5, 255, 255, 0, 170, player ) outputChatBox(getClientName(player).." has teleported to drift area (/drift)") setElementData(player, "driftingmarker", driftMarker) setElementData(player, "marker", 1) end addCommandHandler("drift",consoleDrift) function checkMarker (markerHit, matchingDimension ) local driftingMarker=getElementData ( source, "driftingmarker" ) local markerNumb=getElementData ( source, "marker" ) if(markerHit==driftingMarker) then if(markerNumb==1) then setElementData(source, "marker", 2) destroyElement ( driftingMarker ) -- <-- destroys first marker "cylinder" local driftMarker = createMarker ( -2779.9223632813, -491.24954223633, 6.9137630462646, "cylinder", 5, 255, 255, 0, 170, source ) setElementData(source, "driftingmarker", driftMarker) elseif(markerNumb==2) then setElementData(source, "marker", 0) destroyElement( driftingMarker ) -- <-- doesnt destroy second cylinder end end end addEventHandler("onPlayerMarkerHit", getRootElement (), checkMarker) it works with "checkpoint" Link to comment
Recommended Posts