General > Developers Corner

Using ULib as an all around admin system

<< < (4/5) > >>

aschmack:
I got a cheap fix, this should work, sadly it requires you to suicide once when you connect. I suppose that someone could add in a silent kill, but I don't really feel like doing that now.

JamminR, ULib.mainUcl is the access table that gets added from users.ini, so yes, I got it right.

PASTE this over the hooks and CONCOMMANDS at the bottom of eSWEPmenu.lua. Then change the name of ulx_init.lua to aulx_init.lua (so that it loads before everything.


New Version Below.

JamminR:
Sounds like an odd hack that the person has to 'kill' themselves.
Like you said, sounds as though thier access is being loaded after this script.
Any errors being returned in console?
Two suggestions... use a timer to count 2 seconds before testing access?
Or, hook eventPlayerActive instead? This is called after connecting of course, might give the necessary time needed. (Then again, might be too slow)

The project I'm working on had odd results using the HookEvent(eventPlayerActive) command, which calls a function that was supposed to declare some key tables and switches for those tables related to the user. Doesn't seem to call it
So what I've done is wrote the code so that when the console command to turn on my project is turned 'on', it tests to see if those variables are set, if not, it too calls the original 'setup' function, then returns to turn on the project.

So far, its worked, and better than having to have my user reconnect or respawn. :)


An Error Has Occurred!

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

[0] Board index

Go to full version