toptional Posted November 18, 2012 Posted November 18, 2012 Whats wrong with this? It just doesnt work setTimer(begin, math.random(200, 400), 1) function startCapture(hitElement) local team = getPlayerTeam(hitElement) capturing = setTimer(Capture, 60000, 1) outputChatBox(team.." is capturing the Weapon Boat! 60 seconds till capture!", 150,150,150) end addEventHandler( "onMarkerHit", captureMarker, startCapture ) function endCapture() killTimer(capturing) end addEventHandler( "onMarkerLeave", captureMarker, endCapture )
manve1 Posted November 18, 2012 Posted November 18, 2012 1. There is nothing verified for "begin" 2. There is nothing verified for "capture" Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted November 18, 2012 Posted November 18, 2012 --declare some vars & timers setTimer( Begin, math.random( 200, 400 ), 1 ); -- Begin is not declared local pCapture; --declare functions function StartCapture( ele ) if ( ele and ( getElementType( ele ) == 'player' ) ) then --starts capture local szTeam = getTeamName( getPlayerTeam( ele ) ); -- you were getting team element and trying to output it later if ( isTimer( pCapture ) ) then killTimer( pCapture ); end pCapture = setTimer( Capture, 60000, 1 ); outputChatBox( szTeam .. " is capturing the weapon boat! 60 seconds till capture!", root, 150, 150, 150, false ); -- there was a parameter missing; visible to param end end addEventHandler( "onMarkerHit", captureMarker, StartCapture ); Check comments. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now