The "Default" option always winsLua has 1-based arrays. That means the first element in a table has an index of 1.
The table with outcomes has 2 elements: "Low" with an index of 1, and "Default" with an index of 2.
{"Low", "Default"} -- Possible outcomes of the vote
In the beginning of the voteGravDone function, you calculate the winner. The index of the winning element is assigned to the
winner variable. That means
winner will be 1 if the first option won, 2 if the second option won, nil if no one voted.
So when you're checking for the winning option...
if winner == 0 then -- line 25, http://pastebin.com/fYyGQmPN
This statement will always be false: there are no elements with an index of 0.
ulx.rcon is called with a bad argument, causing Lua errorsLua Error: addons/ulx/lua/ulx/log.lua:479: bad argument #2 to 'format' (number expected, got string)Caused by calling ulx.rcon with nil (instead of a Player) as the first argument. That particular function is a callback for a command. It is not really meant to be called directly.
ulx.rcon( _, "sv_gravity 250" ) -- Bad!
You can use
RunConsoleCommand instead.
RunConsoleCommand( "sv_gravity", 250 )