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:
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)