Jump to content

judge script


MatXpl

Recommended Posts

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        executeSQLQuery ( "CREATE TABLE IF NOT EXISTS votes (nick TEXT, map TEXT, vote TEXT)" ) 
    end 
) 
  
function vote ( p, command, vote ) 
    local nick = getPlayerNametagText ( p ) 
    local mapName = getResourceName ( exports [ "mapmanager" ]:getRunningGamemodeMap ( ) ) 
    local check = executeSQLSelect ( "votes", "*", "nick = '".. tostring ( nick ) .."' AND map = '".. mapName .."'" ) 
    if ( type ( check ) == "table" and #check == 0 ) or not check then 
        executeSQLQuery ( "INSERT INTO votes VALUES (?,?,?)", nick, mapName, vote ) 
    end 
end 
addCommandHandler ( "vote", vote ) 

Try that.

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