Author Topic: Silent kick/ban  (Read 3430 times)

0 Members and 1 Guest are viewing this topic.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Silent kick/ban
« on: November 22, 2013, 02:03:10 PM »
Hello.
Lately I've been developing a few silent commands, mainly kick and ban.
It actually took me a while, until I realized I could use parts of ULX's code (hope you don't mind that I did that and I was planning to release it as an addon on these forums). Although, the "silent" part didn't really work out for me.
Every time someone gets banned through RCON, it seems to print out "Player disconnected (reason "Kicked by Admin (Banned for 1 minute(s): Reason)")". (This is by using ULib.kickban in the command, like the normal "ulx ban") When I tested this, it printed out to everyone. Sometimes (and only sometimes, not every time, it seems) when I banned myself, it also printed. With and without a reason. When I banned someone else, or they banned me, it didn't print at all.

This only seems to happen when I use the "silent ban" command though, when I tried my "silent kick" it didn't print at all. So I have no clue what's causing it (although, it may be Player.Kick, but since it doesn't do it all the time, I don't know).
My code is here, but it's pretty much just the normal "ulx ban" command:
Code: [Select]
function ulx.sban( calling_ply, target_ply, minutes, reason )
ULib.kickban( target_ply, minutes, reason, calling_ply )
local time = ""
if minutes == 0 then
time = "permanently"
elseif minutes == 1 then
time = "for 1 minute"
else
time = "for " .. minutes .. " minutes"
end
local str = "#A banned #T" .. time
if reason and reason ~= "" then
str = str .. " (#s)"
end
ulx.fancyLogAdmin( calling_ply, true, str, target_ply, minutes ~= 0 and minutes or reason, reason )
end
Any clues?

(This was only tested on TTT, but I don't believe it really matters if I test on SandBox either)
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Silent kick/ban
« Reply #1 on: November 22, 2013, 03:23:44 PM »
As far as I remember, the players on the server will always be notified of kicks and bans, since the message is coming from Source. I believe you'd need a module to make it truly silent.
Experiencing God's grace one day at a time.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Silent kick/ban
« Reply #2 on: November 22, 2013, 03:27:34 PM »
That's actually what I thought, but I was just making sure. Thanks for verifying.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given