I can't votekick players off the server.
I can start the vote but when it hits "admin approval." it messes up (im superadmin)
local function voteKickDone( t, target, time, ply, reason )
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 ratioNeeded = GetConVarNumber( "ulx_votekickSuccessratio" )
local minVotes = GetConVarNumber( "ulx_votekickMinvotes" )
local str
if winner ~= 1 or winnernum < minVotes or winnernum / t.voters < ratioNeeded then
str = "Vote results: User will not be kicked. (" .. (results[ 1 ] or "0") .. "/" .. t.voters .. ")"
else
str = "Vote results: User will now be kicked, pending admin approval. (" .. winnernum .. "/" .. t.voters .. ")"
ulx.doVote( "Accept result and kick " .. target:Nick() .. "?", { "Yes", "No" }, voteKickDone2, 30000, { ply }, true, target, time, ply, reason )
end
EDIT by Megiddo: Language, remember we have all age ranges here. Don't say something you wouldn't to a stranger's child in person.