Jump to content

votemanager and play again option.


Fella

Recommended Posts

Hi, im looking for a way to limit the play again option to only 2-3 times in a row.

this code should get the job done:

    local timesMapPlayed = 0 
    local lastMapPlayed = 0 
 if currentMap ~= lastMapPlayed then 
        timesMapPlayed = 1 
        lastMapPlayed = currentMap 
    end 
    if currentMap and timesMapPlayed <= 2 then -- map could be played max. 3 times in row 
        timesMapPlayed = timesMapPlayed + 1 
        table.insert(poll, {"Play again", 'nextMapVoteResult', getRootElement(), currentMap}) 
    end 
  

but for some reason it doesn't. What's wrong?

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