Jump to content

[Marker]Markers are not destroyed


BriGhtx3

Recommended Posts

  
-- 
--Die function job muss angepasst werden, da ich die Variablen etc, nicht kenne 
-- 
  
-- VARIABLEN 
pMal = 0 
  
function job(thePlayer) 
if (getElementData(thePlayer, "Job") == true) then 
outputChatBox('Du hast bereits einen Job!', thePlayer, 255, 0, 0) 
else 
outputChatBox('Du hast den Job angenommen!', thePlayer, 0, 255, 0) 
setElementData(thePlayer, "Job", true) 
setElementData(thePlayer, "JobLevel", 1) 
end 
end 
addCommandHandler("job", job) 
  
function startJob1(thePlayer) 
if (getElementData(thePlayer, "Job") == true) then 
---- Level1 
if (getElementData(thePlayer, "JobLevel") < 5) then 
setElementPosition(thePlayer, -1184, -1126, 130) 
setCameraTarget(thePlayer,thePlayer) 
------------ 
pickup1 = createPickup(-1045, -1020, 128, 3, 1453) 
marker1 = createMarker(-1045, -1020, 128, checkpoint, 0.5, 255, 0, 0) 
------------ 
outputChatBox('Sammle das Heu auf und bringe es zur Scheune', thePlayer) 
end 
end 
end 
addCommandHandler("starten1", startJob1) 
  
function pickups(hitPlayer) 
if isElementWithinMarker(hitPlayer, marker1 ) then 
outputChatBox('Gehe nun zur Scheune!', thePlayer) 
markerS = createMarker(-1184, -1126, 130, checkpoint, 0.5, 255, 0, 0 ) 
destroyElement(marker1) 
end 
-------------- 
if isElementWithinMarker(hitPlayer, markerS) then 
pMal = pMal + 1 
outputChatBox('Hole noch mehr Heu!', thePlayer) 
pickup2 = createPickup(-1122, -953, 128, 3, 1453) 
marker2 = createMarker(-1122, -953, 128, checkpoint, 0.5, 255, 0, 0) 
destroyElement(MarkerS) 
end 
-------------- 
if isElementWithinMarker(hitPlayer, marker2 ) then 
outputChatBox('Gehe nun zur Scheune!', thePlayer) 
markerS2 = createMarker(-1184, -1126, 130, checkpoint, 0.5, 255, 0, 0 ) 
destroyElement(marker2) 
end 
-------------- 
if isElementWithinMarker(hitPlayer, markerS2) then 
pMal = pMal + 1 
outputChatBox('Hole noch mehr Heu!', thePlayer) 
pickup3 = createPickup(-11185, -1000, 128, 3, 1453) 
marker3 = createMarker(-11185, -1000, 128, checkpoint, 0.5, 255, 0, 0) 
destroyElement(MarkerS2) 
end 
-------------- 
if isElementWithinMarker(hitPlayer, marker3 ) then 
outputChatBox('Gehe nun zur Scheune!', thePlayer) 
markerS3 = createMarker(-1184, -1126, 130, checkpoint, 0.5, 255, 0, 0 ) 
destroyElement(marker3) 
end 
-------------- 
if isElementWithinMarker(hitPlayer, markerS3) then 
pMal = pMal + 1 
if pMal == 3 then 
destroyElement(MarkerS3) 
local pMoney = getPlayerMoney(hitPlayer) 
setPlayerMoney(hitPlayer, pMoney + 75) 
end 
end 
end 
addEventHandler("onMarkerHit", getRootElement(), pickups) 
  

This is my Code... When I hit the first marker (marker1), it gets destroyed. But when I hit the second one (markerS) it gets not destroyed (shouldn't be so), (but the marker after it (marker3) is visible (should be like this)). But now when I go

to the next (marker3) the message is shown thousands of times and nothing gets along.

Now : How can I fix it? - Every marker should be destroyed after hitting it and then the next shown.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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