• Print

Author Topic: Being locked out of the server after being vote kicked  (Read 5507 times)

0 Members and 1 Guest are viewing this topic.

Offline seabeds

  • Newbie
  • *
  • Posts: 35
  • Karma: 0
    • Seaside TTT
Being locked out of the server after being vote kicked
« on: October 12, 2015, 09:45:36 am »
Hello everyone.

I hope this is not in the wrong section. Anyways, if you've ever played TF2 or Cs: GO, you know they have a votekick feature just like the ulx mod. But the difference is on gmod, you can quickly connect back to a server after being kicked. So my question is has anyone made a code change or addon that doesn't let a player quickly reconnect after being kicked?

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Being locked out of the server after being vote kicked
« Reply #1 on: October 12, 2015, 10:52:42 am »
Voteban ,perhaps?
bw81@ulysses-forums ~ % whoami
Homepage

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Being locked out of the server after being vote kicked
« Reply #2 on: November 01, 2015, 05:22:51 am »
This is not tested, nor do I think you should use it as it takes directly from the ULX votekick source code and you have to insert these lines of code on line 319 of your ULX votekick file. Im not doing so thus why its untested, so I am not at fault for any file disruption provided by you adding this to you code. I added notes so you would get how to change it if needed.
Code: Lua
  1. if target == ULib.Kick() then -- Not sure if this is correct, target is the target declared in votekick. ULib.Kick() checks if they are kicked. And if they are, do this. "then"
  2.         timer.Create( "KickDelay", 1, 30, PrintMessage( HUD_PRINTTALK, "The kick delay has past. Votekicked users can now connect." ) ) -- Change 30 to how many seconds you want the timer to last when the player leaves and to rejoin. "KickDelay" timer name, 1 is how many times it counts in seconds, so 1. 30 is how many times the timer runs, 30 times of 1 second. Then after its done it tells the chat/console that he/she can reconnect.
  3. end -- Finishes the if
  4. if timer.TimeLeft( "KickDelay" ) < 30 and GM:PlayerConnect( target, ip ) then -- Edit the 30 to the value declared on line 80. Checks the timer if it has not ended, if so, kick the player again. Target is used instead of a random players name.
  5. ULib.Kick( "You must wait at least 30 seconds before rejoining after being Vote Kicked." ) -- Same thing here, change the 30. Line 81, what happens if the timer is not done.
  6. end -- End the if, when the timer is done he/she can rejoin.

Code for the WHOLE file:
Code: Lua
  1. local CATEGORY_NAME = "Voting"
  2.  
  3. ---------------
  4. --Public vote--
  5. ---------------
  6. if SERVER then ulx.convar( "voteEcho", "0", _, ULib.ACCESS_SUPERADMIN ) end -- Echo votes?
  7.  
  8. -- First, our helper function to make voting so much easier!
  9. function ulx.doVote( title, options, callback, timeout, filter, noecho, ... )
  10.         timeout = timeout or 20
  11.         if ulx.voteInProgress then
  12.                 Msg( "Error! ULX tried to start a vote when another vote was in progress!\n" )
  13.                 return false
  14.         end
  15.  
  16.         if not options[ 1 ] or not options[ 2 ] then
  17.                 Msg( "Error! ULX tried to start a vote without at least two options!\n" )
  18.                 return false
  19.         end
  20.  
  21.         local voters = 0
  22.         local rp = RecipientFilter()
  23.         if not filter then
  24.                 rp:AddAllPlayers()
  25.                 voters = #player.GetAll()
  26.         else
  27.                 for _, ply in ipairs( filter ) do
  28.                         rp:AddPlayer( ply )
  29.                         voters = voters + 1
  30.                 end
  31.         end
  32.  
  33.         umsg.Start( "ulx_vote", rp )
  34.                 umsg.String( title )
  35.                 umsg.Short( timeout )
  36.                 ULib.umsgSend( options )
  37.         umsg.End()
  38.  
  39.         ulx.voteInProgress = { callback=callback, options=options, title=title, results={}, voters=voters, votes=0, noecho=noecho, args={...} }
  40.  
  41.         timer.Create( "ULXVoteTimeout", timeout, 1, ulx.voteDone )
  42.  
  43.         return true
  44. end
  45.  
  46. function ulx.voteCallback( ply, command, argv )
  47.         if not ulx.voteInProgress then
  48.                 ULib.tsayError( ply, "There is not a vote in progress" )
  49.                 return
  50.         end
  51.  
  52.         if not argv[ 1 ] or not tonumber( argv[ 1 ] ) or not ulx.voteInProgress.options[ tonumber( argv[ 1 ] ) ] then
  53.                 ULib.tsayError( ply, "Invalid or out of range vote." )
  54.                 return
  55.         end
  56.  
  57.         if ply.ulxVoted then
  58.                 ULib.tsayError( ply, "You have already voted!" )
  59.                 return
  60.         end
  61.  
  62.         local echo = ULib.toBool( GetConVarNumber( "ulx_voteEcho" ) )
  63.         local id = tonumber( argv[ 1 ] )
  64.         ulx.voteInProgress.results[ id ] = ulx.voteInProgress.results[ id ] or 0
  65.         ulx.voteInProgress.results[ id ] = ulx.voteInProgress.results[ id ] + 1
  66.  
  67.         ulx.voteInProgress.votes = ulx.voteInProgress.votes + 1
  68.  
  69.         ply.ulxVoted = true -- Tag them as having voted
  70.  
  71.         local str = ply:Nick() .. " voted for: " .. ulx.voteInProgress.options[ id ]
  72.         if echo and not ulx.voteInProgress.noecho then
  73.                 ULib.tsay( _, str ) -- TODO, color?
  74.         end
  75.         ulx.logString( str )
  76.         if game.IsDedicated() then Msg( str .. "\n" ) end
  77.  
  78.         if ulx.voteInProgress.votes >= ulx.voteInProgress.voters then
  79.                 ulx.voteDone()
  80.         end
  81. end
  82. if SERVER then concommand.Add( "ulx_vote", ulx.voteCallback ) end
  83.  
  84. function ulx.voteDone( cancelled )
  85.         local players = player.GetAll()
  86.         for _, ply in ipairs( players ) do -- Clear voting tags
  87.                 ply.ulxVoted = nil
  88.         end
  89.  
  90.         local vip = ulx.voteInProgress
  91.         ulx.voteInProgress = nil
  92.         timer.Remove( "ULXVoteTimeout" )
  93.         if not cancelled then
  94.                 ULib.pcallError( vip.callback, vip, unpack( vip.args, 1, 10 ) ) -- Unpack is explicit in length to avoid odd LuaJIT quirk.
  95.         end
  96. end
  97. -- End our helper functions
  98.  
  99.  
  100.  
  101.  
  102.  
  103. local function voteDone( t )
  104.         local results = t.results
  105.         local winner
  106.         local winnernum = 0
  107.         for id, numvotes in pairs( results ) do
  108.                 if numvotes > winnernum then
  109.                         winner = id
  110.                         winnernum = numvotes
  111.                 end
  112.         end
  113.  
  114.         local str
  115.         if not winner then
  116.                 str = "Vote results: No option won because no one voted!"
  117.         else
  118.                 str = "Vote results: Option '" .. t.options[ winner ] .. "' won. (" .. winnernum .. "/" .. t.voters .. ")"
  119.         end
  120.         ULib.tsay( _, str ) -- TODO, color?
  121.         ulx.logString( str )
  122.         Msg( str .. "\n" )
  123. end
  124.  
  125. function ulx.vote( calling_ply, title, ... )
  126.         if ulx.voteInProgress then
  127.                 ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
  128.                 return
  129.         end
  130.  
  131.         ulx.doVote( title, { ... }, voteDone )
  132.         ulx.fancyLogAdmin( calling_ply, "#A started a vote (#s)", title )
  133. end
  134. local vote = ulx.command( CATEGORY_NAME, "ulx vote", ulx.vote, "!vote" )
  135. vote:addParam{ type=ULib.cmds.StringArg, hint="title" }
  136. vote:addParam{ type=ULib.cmds.StringArg, hint="options", ULib.cmds.takeRestOfLine, repeat_min=2, repeat_max=10 }
  137. vote:defaultAccess( ULib.ACCESS_ADMIN )
  138. vote:help( "Starts a public vote." )
  139.  
  140. -- Stop a vote in progress
  141. function ulx.stopVote( calling_ply )
  142.         if not ulx.voteInProgress then
  143.                 ULib.tsayError( calling_ply, "There is no vote currently in progress.", true )
  144.                 return
  145.         end
  146.  
  147.         ulx.voteDone( true )
  148.         ulx.fancyLogAdmin( calling_ply, "#A has stopped the current vote." )
  149. end
  150. local stopvote = ulx.command( CATEGORY_NAME, "ulx stopvote", ulx.stopVote, "!stopvote" )
  151. stopvote:defaultAccess( ULib.ACCESS_SUPERADMIN )
  152. stopvote:help( "Stops a vote in progress." )
  153.  
  154. local function voteMapDone2( t, changeTo, ply )
  155.         local shouldChange = false
  156.  
  157.         if t.results[ 1 ] and t.results[ 1 ] > 0 then
  158.                 ulx.logServAct( ply, "#A approved the votemap" )
  159.                 shouldChange = true
  160.         else
  161.                 ulx.logServAct( ply, "#A denied the votemap" )
  162.         end
  163.  
  164.         if shouldChange then
  165.                 ULib.consoleCommand( "changelevel " .. changeTo .. "\n" )
  166.         end
  167. end
  168.  
  169. local function voteMapDone( t, argv, ply )
  170.         local results = t.results
  171.         local winner
  172.         local winnernum = 0
  173.         for id, numvotes in pairs( results ) do
  174.                 if numvotes > winnernum then
  175.                         winner = id
  176.                         winnernum = numvotes
  177.                 end
  178.         end
  179.  
  180.         local ratioNeeded = GetConVarNumber( "ulx_votemap2Successratio" )
  181.         local minVotes = GetConVarNumber( "ulx_votemap2Minvotes" )
  182.         local str
  183.         local changeTo
  184.         -- Figure out the map to change to, if we're changing
  185.         if #argv > 1 then
  186.                 changeTo = t.options[ winner ]
  187.         else
  188.                 changeTo = argv[ 1 ]
  189.         end
  190.  
  191.         if (#argv < 2 and winner ~= 1) or not winner or winnernum < minVotes or winnernum / t.voters < ratioNeeded then
  192.                 str = "Vote results: Vote was unsuccessful."
  193.         elseif ply:IsValid() then
  194.                 str = "Vote results: Option '" .. t.options[ winner ] .. "' won, changemap pending approval. (" .. winnernum .. "/" .. t.voters .. ")"
  195.  
  196.                 ulx.doVote( "Accept result and changemap to " .. changeTo .. "?", { "Yes", "No" }, voteMapDone2, 30000, { ply }, true, changeTo, ply )
  197.         else -- It's the server console, let's roll with it
  198.                 str = "Vote results: Option '" .. t.options[ winner ] .. "' won. (" .. winnernum .. "/" .. t.voters .. ")"
  199.                 ULib.tsay( _, str )
  200.                 ulx.logString( str )
  201.                 ULib.consoleCommand( "changelevel " .. changeTo .. "\n" )
  202.                 return
  203.         end
  204.  
  205.         ULib.tsay( _, str ) -- TODO, color?
  206.         ulx.logString( str )
  207.         if game.IsDedicated() then Msg( str .. "\n" ) end
  208. end
  209.  
  210. function ulx.votemap2( calling_ply, ... )
  211.         local argv = { ... }
  212.  
  213.         if ulx.voteInProgress then
  214.                 ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
  215.                 return
  216.         end
  217.  
  218.         for i=2, #argv do
  219.             if ULib.findInTable( argv, argv[ i ], 1, i-1 ) then
  220.                 ULib.tsayError( calling_ply, "Map " .. argv[ i ] .. " was listed twice. Please try again" )
  221.                 return
  222.             end
  223.         end
  224.  
  225.         if #argv > 1 then
  226.                 ulx.doVote( "Change map to..", argv, voteMapDone, _, _, _, argv, calling_ply )
  227.                 ulx.fancyLogAdmin( calling_ply, "#A started a votemap with options" .. string.rep( " #s", #argv ), ... )
  228.         else
  229.                 ulx.doVote( "Change map to " .. argv[ 1 ] .. "?", { "Yes", "No" }, voteMapDone, _, _, _, argv, calling_ply )
  230.                 ulx.fancyLogAdmin( calling_ply, "#A started a votemap for #s", argv[ 1 ] )
  231.         end
  232. end
  233. local votemap2 = ulx.command( CATEGORY_NAME, "ulx votemap2", ulx.votemap2, "!votemap2" )
  234. votemap2:addParam{ type=ULib.cmds.StringArg, completes=ulx.maps, hint="map", error="invalid map \"%s\" specified", ULib.cmds.restrictToCompletes, ULib.cmds.takeRestOfLine, repeat_min=1, repeat_max=10 }
  235. votemap2:defaultAccess( ULib.ACCESS_ADMIN )
  236. votemap2:help( "Starts a public map vote." )
  237. if SERVER then ulx.convar( "votemap2Successratio", "0.5", _, ULib.ACCESS_ADMIN ) end -- The ratio needed for a votemap2 to succeed
  238. if SERVER then ulx.convar( "votemap2Minvotes", "3", _, ULib.ACCESS_ADMIN ) end -- Minimum votes needed for votemap2
  239.  
  240.  
  241.  
  242. local function voteKickDone2( t, target, time, ply, reason )
  243.         local shouldKick = false
  244.  
  245.         if t.results[ 1 ] and t.results[ 1 ] > 0 then
  246.                 ulx.logUserAct( ply, target, "#A approved the votekick against #T (" .. (reason or "") .. ")" )
  247.                 shouldKick = true
  248.         else
  249.                 ulx.logUserAct( ply, target, "#A denied the votekick against #T" )
  250.         end
  251.  
  252.         if shouldKick then
  253.                 if reason and reason ~= "" then
  254.                         ULib.kick( target, "Vote kick successful. (" .. reason .. ")" )
  255.                 else
  256.                         ULib.kick( target, "Vote kick successful." )
  257.                 end
  258.         end
  259. end
  260.  
  261. local function voteKickDone( t, target, time, ply, reason )
  262.         local results = t.results
  263.         local winner
  264.         local winnernum = 0
  265.         for id, numvotes in pairs( results ) do
  266.                 if numvotes > winnernum then
  267.                         winner = id
  268.                         winnernum = numvotes
  269.                 end
  270.         end
  271.  
  272.         local ratioNeeded = GetConVarNumber( "ulx_votekickSuccessratio" )
  273.         local minVotes = GetConVarNumber( "ulx_votekickMinvotes" )
  274.         local str
  275.         if winner ~= 1 or winnernum < minVotes or winnernum / t.voters < ratioNeeded then
  276.                 str = "Vote results: User will not be kicked. (" .. (results[ 1 ] or "0") .. "/" .. t.voters .. ")"
  277.         else
  278.                 if not target:IsValid() then
  279.                         str = "Vote results: User voted to be kicked, but has already left."
  280.                 elseif ply:IsValid() then
  281.                         str = "Vote results: User will now be kicked, pending approval. (" .. winnernum .. "/" .. t.voters .. ")"
  282.                         ulx.doVote( "Accept result and kick " .. target:Nick() .. "?", { "Yes", "No" }, voteKickDone2, 30000, { ply }, true, target, time, ply, reason )
  283.                 else -- Vote from server console, roll with it
  284.                         str = "Vote results: User will now be kicked. (" .. winnernum .. "/" .. t.voters .. ")"
  285.                         ULib.kick( target, "Vote kick successful." )
  286.                 end
  287.         end
  288.  
  289.         ULib.tsay( _, str ) -- TODO, color?
  290.         ulx.logString( str )
  291.         if game.IsDedicated() then Msg( str .. "\n" ) end
  292. end
  293.  
  294. function ulx.votekick( calling_ply, target_ply, reason )
  295.         if ulx.voteInProgress then
  296.                 ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
  297.                 return
  298.         end
  299.  
  300.         local msg = "Kick " .. target_ply:Nick() .. "?"
  301.         if reason and reason ~= "" then
  302.                 msg = msg .. " (" .. reason .. ")"
  303.         end
  304.  
  305.         ulx.doVote( msg, { "Yes", "No" }, voteKickDone, _, _, _, target_ply, time, calling_ply, reason )
  306.         if reason and reason ~= "" then
  307.                 ulx.fancyLogAdmin( calling_ply, "#A started a votekick against #T (#s)", minutes, target_ply, reason )
  308.         else
  309.                 ulx.fancyLogAdmin( calling_ply, "#A started a votekick against #T", minutes, target_ply )
  310.         end
  311. end
  312. local votekick = ulx.command( CATEGORY_NAME, "ulx votekick", ulx.votekick, "!votekick" )
  313. votekick:addParam{ type=ULib.cmds.PlayerArg }
  314. votekick:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
  315. votekick:defaultAccess( ULib.ACCESS_ADMIN )
  316. votekick:help( "Starts a public kick vote against target." )
  317. if SERVER then ulx.convar( "votekickSuccessratio", "0.6", _, ULib.ACCESS_ADMIN ) end -- The ratio needed for a votekick to succeed
  318. if SERVER then ulx.convar( "votekickMinvotes", "2", _, ULib.ACCESS_ADMIN ) end -- Minimum votes needed for votekick
  319.  
  320.  
  321.  
  322. local function voteBanDone2( t, nick, steamid, time, ply, reason )
  323.         local shouldBan = false
  324.  
  325.         if t.results[ 1 ] and t.results[ 1 ] > 0 then
  326.                 ulx.fancyLogAdmin( ply, "#A approved the voteban against #s (#s minutes) (#s))", nick, time, reason or "" )
  327.                 shouldBan = true
  328.         else
  329.                 ulx.fancyLogAdmin( ply, "#A denied the voteban against #s", nick )
  330.         end
  331.  
  332.         if shouldBan then
  333.                 ULib.addBan( steamid, time, reason, nick, ply )
  334.         end
  335. end
  336.  
  337. local function voteBanDone( t, nick, steamid, time, ply, reason )
  338.         local results = t.results
  339.         local winner
  340.         local winnernum = 0
  341.         for id, numvotes in pairs( results ) do
  342.                 if numvotes > winnernum then
  343.                         winner = id
  344.                         winnernum = numvotes
  345.                 end
  346.         end
  347.  
  348.         local ratioNeeded = GetConVarNumber( "ulx_votebanSuccessratio" )
  349.         local minVotes = GetConVarNumber( "ulx_votebanMinvotes" )
  350.         local str
  351.         if winner ~= 1 or winnernum < minVotes or winnernum / t.voters < ratioNeeded then
  352.                 str = "Vote results: User will not be banned. (" .. (results[ 1 ] or "0") .. "/" .. t.voters .. ")"
  353.         else
  354.                 reason = ("[ULX Voteban] " .. (reason or "")):Trim()
  355.                 if ply:IsValid() then
  356.                         str = "Vote results: User will now be banned, pending approval. (" .. winnernum .. "/" .. t.voters .. ")"
  357.                         ulx.doVote( "Accept result and ban " .. nick .. "?", { "Yes", "No" }, voteBanDone2, 30000, { ply }, true, nick, steamid, time, ply, reason )
  358.                 else -- Vote from server console, roll with it
  359.                         str = "Vote results: User will now be banned. (" .. winnernum .. "/" .. t.voters .. ")"
  360.                         ULib.addBan( steamid, time, reason, nick, ply )
  361.                 end
  362.         end
  363.  
  364.         ULib.tsay( _, str ) -- TODO, color?
  365.         ulx.logString( str )
  366.         Msg( str .. "\n" )
  367. end
  368.  
  369. function ulx.voteban( calling_ply, target_ply, minutes, reason )
  370.         if ulx.voteInProgress then
  371.                 ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
  372.                 return
  373.         end
  374.  
  375.         local msg = "Ban " .. target_ply:Nick() .. " for " .. minutes .. " minutes?"
  376.         if reason and reason ~= "" then
  377.                 msg = msg .. " (" .. reason .. ")"
  378.         end
  379.  
  380.         ulx.doVote( msg, { "Yes", "No" }, voteBanDone, _, _, _, target_ply:Nick(), target_ply:SteamID(), minutes, calling_ply, reason )
  381.         if reason and reason ~= "" then
  382.                 ulx.fancyLogAdmin( calling_ply, "#A started a voteban of #i minute(s) against #T (#s)", minutes, target_ply, reason )
  383.         else
  384.                 ulx.fancyLogAdmin( calling_ply, "#A started a voteban of #i minute(s) against #T", minutes, target_ply )
  385.         end
  386. end
  387. local voteban = ulx.command( CATEGORY_NAME, "ulx voteban", ulx.voteban, "!voteban" )
  388. voteban:addParam{ type=ULib.cmds.PlayerArg }
  389. voteban:addParam{ type=ULib.cmds.NumArg, min=0, default=1440, hint="minutes", ULib.cmds.allowTimeString, ULib.cmds.optional }
  390. voteban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
  391. voteban:defaultAccess( ULib.ACCESS_ADMIN )
  392. voteban:help( "Starts a public ban vote against target." )
  393. if SERVER then ulx.convar( "votebanSuccessratio", "0.7", _, ULib.ACCESS_ADMIN ) end -- The ratio needed for a voteban to succeed
  394. if SERVER then ulx.convar( "votebanMinvotes", "3", _, ULib.ACCESS_ADMIN ) end -- Minimum votes needed for voteban
  395.  
  396. -- Our regular votemap command
  397. local votemap = ulx.command( CATEGORY_NAME, "ulx votemap", ulx.votemap, "!votemap" )
  398. votemap:addParam{ type=ULib.cmds.StringArg, completes=ulx.votemaps, hint="map", ULib.cmds.takeRestOfLine, ULib.cmds.optional }
  399. votemap:defaultAccess( ULib.ACCESS_ALL )
  400. votemap:help( "Vote for a map, no args lists available maps." )
  401.  
  402. -- Our veto command
  403. local veto = ulx.command( CATEGORY_NAME, "ulx veto", ulx.votemapVeto, "!veto" )
  404. veto:defaultAccess( ULib.ACCESS_ADMIN )
  405. veto:help( "Veto a successful votemap." )

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Being locked out of the server after being vote kicked
« Reply #3 on: November 01, 2015, 07:39:16 am »
Simply use voteban with a short duration.
No code editing necessary.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Being locked out of the server after being vote kicked
« Reply #4 on: November 04, 2015, 10:39:13 pm »
Simply use voteban with a short duration.
No code editing necessary.

Wait, you can voteban with time duration, omg.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Being locked out of the server after being vote kicked
« Reply #5 on: November 05, 2015, 07:02:26 pm »
Wait, you can voteban with time duration, omg.

Yes, if no time/no integer given after target, defaults to 1440 minutes.
Code: [Select]
local voteban = ulx.command( CATEGORY_NAME, "ulx voteban", ulx.voteban, "!voteban" )
voteban:addParam{ type=ULib.cmds.PlayerArg }
voteban:addParam{ type=ULib.cmds.NumArg, min=0, default=1440, hint="minutes", ULib.cmds.allowTimeString, ULib.cmds.optional }
voteban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
voteban:defaultAccess( ULib.ACCESS_ADMIN )
voteban:help( "Starts a public ban vote against target." )
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Being locked out of the server after being vote kicked
« Reply #6 on: November 05, 2015, 09:55:29 pm »
Yes, if no time/no integer given after target, defaults to 1440 minutes.
Code: [Select]
local voteban = ulx.command( CATEGORY_NAME, "ulx voteban", ulx.voteban, "!voteban" )
voteban:addParam{ type=ULib.cmds.PlayerArg }
voteban:addParam{ type=ULib.cmds.NumArg, min=0, default=1440, hint="minutes", ULib.cmds.allowTimeString, ULib.cmds.optional }
voteban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
voteban:defaultAccess( ULib.ACCESS_ADMIN )
voteban:help( "Starts a public ban vote against target." )

Oh my jesus baby, god. I've always disabled it because of that, now that I know there is a time, I'm assuming that you can restrict certain amounts of time, just like !armor and it's limit.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Being locked out of the server after being vote kicked
« Reply #7 on: November 05, 2015, 10:49:37 pm »
Hehe, Apple, may I suggest trying "ulx help" from our non-edited your-self-mutilated version of ULX?
The voteban command help text specifically says that :)
 o ulx voteban <player> [<minutes: 0<=x, default 1440>] [{reason}] - Starts a public ban vote against target. (say: !voteban)
 
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print