On my Prophunt server when noone votes for a gamemode i get this error. Is there any way to remove the voting or just prevent this error?
[IMG]http://i.imgur.com/72a1e7p.jpg[/IMG]
Here are the lines containing the error.
[code]
35- function GetNumberOfGamemodeMaps( gm )
36-
37- return table.Count( g_PlayableGamemodes[ gm or GAMEMODE.FolderName ].maps )
38-
39- end
[/code]
[code]
260- function GM:StartMapVote()
261-
262- // If there's only one map, let the 'random map' thing choose it
263- if ( GetNumberOfGamemodeMaps( GAMEMODE.WinningGamemode ) == 1 ) then
364- return GAMEMODE:FinishMapVote( true )
265- end
[/code]
[code]
318- function GM:FinishGamemodeVote()
319-
320- GAMEMODE.WinningGamemode = GAMEMODE:WorkOutWinningGamemode()
321- GAMEMODE:ClearPlayerWants()
322-
323- // Send bink bink notification
324- BroadcastLua( "GAMEMODE:GamemodeWon( '"..GAMEMODE.WinningGamemode.."' )" );
325-
326- // Start map vote..
327- timer.Simple( 2, function() GAMEMODE:StartMapVote() end )
328-
329- end
[/code]
fretta_voting 0
[QUOTE=JetBoom;42896250]fretta_voting 0[/QUOTE]
Ive already tried that, but all it does is not let people vote.
I also am having this issue.
I'm having this issue as well. What would need to be removed or changed to completely take out gamemode voting altogether? Better yet, how do you fix this error?
GAMEMODE.WinningGamemode is nil. GAMEMODE:WorkOutWinningGamemode() doesn't return anything when noone voted. Go and edit GAMEMODE:WorkOutWinningGamemode() to return a random gamemode if noone voted. That's how you fix it.
That works, but how would you go about removing gamemode voting completely and leaving in map voting?
That I do not know.
[QUOTE=Robotboy655;42928159]GAMEMODE.WinningGamemode is nil. GAMEMODE:WorkOutWinningGamemode() doesn't return anything when noone voted. Go and edit GAMEMODE:WorkOutWinningGamemode() to return a random gamemode if noone voted. That's how you fix it.[/QUOTE]
If you don't mind me asking, how can I do that? Sorry im sorta a nub in lua :(
I commented out the contents of this function and replaced it with "return GAMEMODE.FolderName" so no matter what it will just return the current gamemode.
[CODE]function GM:WorkOutWinningGamemode()
--[[
if ( GAMEMODE.WinningGamemode ) then return GAMEMODE.WinningGamemode end
// Gamemode Voting disabled, return current gamemode
if ( !fretta_voting:GetBool() ) then
return GAMEMODE.FolderName
end
local winner = GAMEMODE:GetWinningWant()
if ( !winner ) then return GetRandomGamemodeName() end
return winner
--]]
return GAMEMODE.FolderName
end[/CODE]
[QUOTE=Chiz Dippler;42941815]I commented out the contents of this function and replaced it with "return GAMEMODE.FolderName" so no matter what it will just return the current gamemode.
[CODE]function GM:WorkOutWinningGamemode()
--[[
if ( GAMEMODE.WinningGamemode ) then return GAMEMODE.WinningGamemode end
// Gamemode Voting disabled, return current gamemode
if ( !fretta_voting:GetBool() ) then
return GAMEMODE.FolderName
end
local winner = GAMEMODE:GetWinningWant()
if ( !winner ) then return GetRandomGamemodeName() end
return winner
--]]
return GAMEMODE.FolderName
end[/CODE][/QUOTE]
Thanks :D
Sorry, you need to Log In to post a reply to this thread.