Jump to content

Dont work


toptional

Recommended Posts

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 ) 

Link to comment
--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.

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