Jump to content

Checkpoint: cylinder


Buffalo

Recommended Posts

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...