General > Developers Corner

Hook for Ban/Kick

<< < (2/2)

iViscosity:
The best way I think would be via server logs if you have access to those.

BLEEP_BLOOP:
I wanted to check for a kick/ban through Lua not to actually look at server logs.

roastchicken:
You can use the ULibCommandCalled hook to detect when a player is banned. I'm not sure if this will be 100% reliable as it may still be called even if the commands arguments are invalid (i.e. the player will not be banned), but it's your best bet other than parsing the ULX logs.

As for the logs, it is possible to find bans in them via the file library. It's just a bit of work figuring out which pattern(s) you need in order to get the bans.

JamminR:
There is also ULibPostTranslatedCommand , which might be better as it's only hooks when the ulx commands are properly completed.
The challenge with using ULib library to monitor for kick or ban using commandcalled or posttranslatedcommand is that an admin or above could use standard server kick or ban commands instead of the ULX version. It's possible not many admins might know how to use those two commands, but I used to use them from console when in a hurry.
Ulib would never see those.

Navigation

[0] Message Index

[*] Previous page

Go to full version