Jumba' Posted January 10, 2008 Share Posted January 10, 2008 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
Zonex Favel Posted January 10, 2008 Share Posted January 10, 2008 I think it's because there is only one map for fallout and that is the default one. Don't hold me to it though. Link to comment
Jumba' Posted January 10, 2008 Author Share Posted January 10, 2008 I think it's because there is only one map for fallout and that is the default one. Don't hold me to it though. yea, i thought aout that so I changed it from getMapType to getGameType which should detect a gamemode. Link to comment
eAi Posted January 10, 2008 Share Posted January 10, 2008 You should probably avoid using executeCommandHandler as this is restricted by default (only admin resources can use it). Instead, use call. http://development.mtasa.com/index.php? ... otemanager lists the functions that votemanager lets you call. Link to comment
Jumba' Posted January 10, 2008 Author Share Posted January 10, 2008 Yea, I tried using call but I couldn't get it to work. To get executeCommandHandler to work i added it to the acl, but im just trying to figure out why it starts the vote even if the map is loaded. that's the biggest problem now. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now