Jump to content

Get poll state


Mefisto_PL

Recommended Posts

Hi ! I want to make anty spam when poll ( from votemanager ) is running, but idk how.. I tried with "onPollStarting" + "onPlayerChat" events, but it doesn't good. Please help me :/

numbers = {"1","2","3","4","5","6","7","8","9"} 
  
function antiVoteSpam ( msg, msgType ) 
    for i, v in pairs ( numbers ) do 
        if string.find ( msg, v ) then 
            cancelEvent() 
        end 
    end 
end 
addEvent("onPollStarting",true) 
addEventHandler("onPollStarting", root, antiVoteSpam) 
addEventHandler("onPlayerChat", root, antiVoteSpam) 

Link to comment
numbers = {"1","2","3","4","5","6","7","8","9"} 
  
function antiVoteSpam ( msg, msgType ) 
    if isPollActive then 
        for i, v in pairs ( numbers ) do 
            if string.find ( msg, v ) then 
                cancelEvent() 
            end 
        end 
    end 
end 
addEventHandler("onPlayerChat", root, antiVoteSpam) 
  
addEventHandler("onPollStart", root, function() isPollActive = true end) 
addEventHandler("onPollEnd", root, function() isPollActive = false end) 
addEventHandler("onPollStop", root, function() isPollActive = false end) 

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