Posts: 57
Threads: 7
Joined: Aug 23, 2009
With the latest release, admins can hear players on the other team. Is it possible to turn this off, or is it an undocumented permission level?
Also, could you run down what the last argument for the lua function Vote is?
Posts: 5,877
Threads: 182
Joined: Dec 11, 2004
The permission is "hearall" and it's grouped with 8192 access. denyAdminCmd = hearall should disable it.
The parameters for Vote are defined in lua\includes\vote.lua and are:
votetext, choices, showtime, append, voteover
Choices should be a table, like:
{"Yes, this is the first choice", "No, this is the second choice"}
Append is some text that show after the choices.
Voteover is a function that is called when the vote is over.
Posts: 57
Threads: 7
Joined: Aug 23, 2009
Thanks for the clarification on hearall.
With Vote, where are the results outputted?
Posts: 5,877
Threads: 182
Joined: Dec 11, 2004
The results are passed into the function you specify. Checkout mapveto.lua.
Code:
function mapveto_voteover(vote)
local yesvotes = vote.picks[1]
local total = vote.picks[1] + vote.picks[2]
local nonvoters = table.Count(player.GetAll()) - total
local yespercentage = (yesvotes / total) * 100
local percentyes = tostring(math.floor(yespercentage)) .. "%"
...
end
Posts: 57
Threads: 7
Joined: Aug 23, 2009
Posts: 1,460
Threads: 125
Joined: Jan 26, 2006
Posts: 5,877
Threads: 182
Joined: Dec 11, 2004