Hi guys,
function startNextMapVote()
exports.votemanager:stopPoll()
if maybeApplyForcedNextMap() then
return
end
local compatibleMaps = exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource())
if #compatibleMaps > 9 then
math.randomseed(getTickCount())
repeat
table.remove(compatibleMaps, math.random(1, #compatibleMaps))
until #compatibleMaps == 9
elseif #compatibleMaps < 2 then
return false, errorCode.onlyOneCompatibleMap
end
for i,map in ipairs(compatibleMaps) do
local swapWith = math.random(1, #compatibleMaps)
local temp = compatibleMaps[i]
compatibleMaps[i] = compatibleMaps[swapWith]
compatibleMaps[swapWith] = temp
end
local poll = {
title="Choose the next map:",
visibleTo=getRootElement(),
percentage=51,
timeout=15,
allowchange=true;
}
for index, map in ipairs(compatibleMaps) do
local mapName = getResourceInfo(map, "name") or getResourceName(map)
table.insert(poll, {mapName, 'nextMapVoteResult', getRootElement(), map})
end
local currentMap = exports.mapmanager:getRunningGamemodeMap()
if currentMap then
table.insert(poll, {"Play again", 'nextMapVoteResult', getRootElement(), currentMap})
end
This code to start vote for next map when map ended in race gm
How i can change it to be like this example?
E.g : http://www.m5zn.com/newuploads/2013/09/ ... 6ba140.png
?