Jump to content

Problem with a script.


Jumba'

Recommended Posts

Ok, so I made a script to start a map vote on join if there's no map and it works, but it also starts a vote when there IS a map loaded.

here's the script.

  
function startVote( ) 
     local joinedPlayerName = getClientName ( source ) 
     local mode = getGameType () 
     if( mode == nil ) then 
     executeCommandHandler ( "votemode", source ) 
     outputChatBox ( "Welcome to the server" .. joinedPlayerName .. ". There's currently no map running so choose one. " , source, 255, 255, 0 ) 
    end 
end 
  
addEventHandler ( "onPlayerJoin", getRootElement(), startVote ) 
  

-edit-

i think it always starts the vote because it told me that mode was nil even thought i was running fallout. any idea what could be causing this?

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