Dunno if you're still here, but...
This isn't tested. But it should work in theory.
local CATEGORY_NAME = "Voting"
function ulx.tttvotekick( calling_ply, target_ply, reason )
if GetRoundState() == ROUND_ACTIVE then
ULib.tsayError( calling_ply, "You must wait for the round to be over!", true )
return
end
if voteInProgress then
ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
return
end
local msg = "Kick " .. target_ply:Nick() .. "?"
if reason and reason ~= "" then
msg = msg .. " (" .. reason .. ")"
end
ulx.doVote( msg, { "Yes", "No" }, voteKickDone, _, _, _, target_ply, time, calling_ply, reason )
ulx.fancyLogAdmin( calling_ply, "#A started a votekick against #T", target_ply )
end
local tttvotekick = ulx.command( CATEGORY_NAME, "ulx tttvotekick", ulx.tttvotekick, "!vkick" )
tttvotekick:addParam{ type=ULib.cmds.PlayerArg }
tttvotekick:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
tttvotekick:defaultAccess( ULib.ACCESS_ADMIN )
tttvotekick:help( "Starts a public kick vote against target." )
function ulx.tttvoteban( calling_ply, target_ply, minutes, reason )
if GetRoundState() == ROUND_ACTIVE then
ULib.tsayError( calling_ply, "You must wait for the round to be over!", true )
return
end
if voteInProgress then
ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
return
end
local msg = "Ban " .. target_ply:Nick() .. " for " .. minutes .. " minutes?"
if reason and reason ~= "" then
msg = msg .. " (" .. reason .. ")"
end
ulx.doVote( msg, { "Yes", "No" }, voteBanDone, _, _, _, target_ply, minutes, calling_ply, reason )
if reason and reason ~= "" then
ulx.fancyLogAdmin( calling_ply, "#A started a voteban of #i minute(s) against #T (#s)", minutes, target_ply, reason )
else
ulx.fancyLogAdmin( calling_ply, "#A started a voteban of #i minute(s) against #T", minutes, target_ply )
end
end
local tttvoteban = ulx.command( CATEGORY_NAME, "ulx tttvoteban", ulx.tttvoteban, "!vban" )
tttvoteban:addParam{ type=ULib.cmds.PlayerArg }
tttvoteban:addParam{ type=ULib.cmds.NumArg, min=0, default=1440, hint="minutes", ULib.cmds.allowTimeString, ULib.cmds.optional }
tttvoteban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
tttvoteban:defaultAccess( ULib.ACCESS_ADMIN )
tttvoteban:help( "Starts a public ban vote against target." )