General > Developers Corner

ULX Hook for adduser?

(1/2) > >>

lynx:
I'm trying to integrate two systems that use ULX as a base. One sets a players forum rank based on their usergroup ingame on join, and the other updates their ingame rank on join. I want to change the first one (setting forum rank) to only run when the users group is changed (as we have a donation system that does it) so that if their forum rank gets changed their ingame rank will change on join instead of the other way around.

I'm a decent coder (in my opinion) but I've not coded for ULX before. Is there any hook I could use so that when a users group is changed it will call a hook that could be used with hook.Add? Or will I have to integrate a hook.Call with ULX so that it can call the external plugin when it happens?

Cobalt:
A hook you can use is UCLChanged. It doesn't pass any args but you can use it to check usergroups and such.
I made this script for PUDS, you can modify it for your project: http://puu.sh/6dixt.lua

lynx:
Thanks. I'll try that out in a bit. Looking through the ulib code and found the ULib.HOOK_UCLAUTH hook which passes 2 arguments (one being _ which is some data and the other being the player) so going to try that out a bit before having to loop through users every time something changes.

Edit:
It actually only parses 1 argument. The player.

Megiddo:
You can find the documentation for the hook here: http://ulyssesmod.net/docs/files/lua/ulib/shared/defines-lua.html#UCLAuthed

JamminR:
RE: Our ULib docs Megiddo linked -
And many other documented features of ULib. :)

Though people are welcome to build upon ULX, it wasn't originally intended to be and therefore not documented publicly. (Plenty of comments in the code itself)
ULX is built upon ULib, which has been documented extensively. :)

Navigation

[0] Message Index

[#] Next page

Go to full version