Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local results = t.results
- local winner
- local winnernum = 0
- for id, numvotes in pairs( results ) do
- if numvotes > winnernum then
- winner = id
- winnernum = numvotes
- end
- end
- local str
- if not winner then
- str = "Vote results: No option won because no one voted!"
- else
- str = "Vote results: Option '" .. t.options[ winner ] .. "' won. (" .. winnernum .. "/" .. t.voters .. ")"
- end
- ULib.tsay( _, str ) -- TODO, color?
- ulx.logString( str )
- Msg( str .. "\n" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement