Kenix Posted October 27, 2011 Share Posted October 27, 2011 Need check if on end poll all select Don't Change ? Help guys. Link to comment
qaisjp Posted October 27, 2011 Share Posted October 27, 2011 Even though it is solved, your post needs to be described correctly and if you solve problems on your own you should post how you fixed it... Link to comment
Kenix Posted October 28, 2011 Author Share Posted October 28, 2011 I just modified the resource votemanager. If someone needs This script changes the map on which all played just if everyone voted for Don't Change this is tested. open script votemanager_server.lua Just find function applyPollResults and replace function with this : function applyPollResults(chosenOption) local optionTable = activePoll[chosenOption] activePoll = nil local result = triggerEvent("onPollEnd", thisResourceRoot, chosenOption) if result == true then outputVoteManager("Vote ended! ["..optionTable[1].."]",rootElement) if string.find(optionTable[1],"Don't change") then local gamemode = exports.mapmanager:getRunningGamemode( ) local rGamemode = exports.mapmanager:getRunningGamemodeMap( ) local complete = exports.mapmanager:isMapCompatibleWithGamemode( rGamemode, gamemode ) if complete then exports.mapmanager:changeGamemodeMap( rGamemode ) end end local optionExecutorType = type(optionTable[2]) if optionExecutorType == "function" then optionTable[2](unpack(optionTable,3)) elseif optionExecutorType == "string" then triggerEvent(optionTable[2], optionTable[3] or rootElement, unpack(optionTable,4)) end end end qaisjp. Yes, I often find the problem and I do not know how to solve but after a while I know how to fix or refine it 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