Ulysses

Ulysses Stuff => Suggestions => Topic started by: Fleamonji on January 24, 2011, 04:11:12 PM

Title: Action hooks
Post by: Fleamonji on January 24, 2011, 04:11:12 PM
Hooks when someone gets kicked/banned would be nice.  I'm trying to make ULX store every kick into a MySQL database, but it's pretty much impossible without a hook
Title: Re: Action hooks
Post by: JamminR on January 24, 2011, 05:03:36 PM
Could easily write your own ULX ban/kick monitoring hook.
http://ulyssesmod.net/docs/files/lua/ulib/shared/defines-lua.html#ULibPlayerTarget

As for when rcon/server did it without ULX, not sure what the hook might be.
Title: Re: Action hooks
Post by: Stickly Man! on January 24, 2011, 11:02:37 PM
http://ulyssesmod.net/docs/files/lua/ulib/shared/defines-lua.html#ULibPostTranslatedCommand

if ( commandName == "ulx ban" or commandName == "ulx banid" ...

Et cetera..
Title: Re: Action hooks
Post by: JamminR on January 25, 2011, 02:23:08 PM
Yes, what Sticky said for 'after' the command is performed would, logically, be even better.
However, that stilll doesn't account for non ULX commands 'kick, kickid, ban, banid, etc'.
Those are server functions, and I'm not sure Garry ever made lua hooks for them.
I poked around the Gmod wiki. Seems Gamemode.PlayerDisconnected itself only kicks off when a 'normal' disconnect occurs (quit, etc)