Jump to content

KIll timer is not working!


Xwad

Recommended Posts

Hi i want to make that if a player leaves the marker then the timer stops. I made it but its not working:( This is a part of the script.

  
--on marker hit 
function createMarker(hitElement, matchingDimension) 
if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "German" then 
outputChatBox("Please,Stay 10 Secs in the marker to capture the area!",thePlayer,255,109 ,109 ) 
local timer = setTimer ( captureAreaG, 4000, 1 ) 
else 
outputChatBox("Please,Stay 10 Secs in the marker to capture the area!",thePlayer,255,109 ,109 ) 
local timer = setTimer ( captureAreaA, 4000, 1 ) 
end 
end 
addEventHandler("onMarkerHit", marker, createMarker) 
  
  
  
  
--on marker leave 
function markerLeave( leaveElement, matchingDimension, theTimer, thePlayer ) 
outputChatBox("You have failed to capture the area!",getRootElement(), 255, 50, 50) 
if  isTimer ( timer ) then 
killTimer ( timer ) 
end 
addEventHandler( "onMarkerLeave", marker, markerLeave ) 

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...