Jump to content

Checkpoint: cylinder


Buffalo

Recommended Posts

Posted

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.

Powered by Kimsufi©

n-560x95_FFFFFF_FFFFFF_000000_000000.png

ZHP on FacebookZHP on YoutubeSupport us

Posted

Post a snippet of your code. It seems likely that the problem is hidden within there.

http://www.valhallagaming.net

[MTA] Roleplay Server - 69.4.236.229:7777

[sAMP] Roleplay Server - 67.228.177.232:7777

[GTAIV] Server coming soon -

[CoD4] Hardcore Server - Offline

[L4D] Server coming soon -

[CS] Standard settings - ?

[CS] Zombie Mode - ?

Posted

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"

Powered by Kimsufi©

n-560x95_FFFFFF_FFFFFF_000000_000000.png

ZHP on FacebookZHP on YoutubeSupport us

  • Recently Browsing   0 members

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