Ulysses
General => Developers Corner => Topic started by: BigBrainAFK on April 09, 2015, 01:23:44 PM
-
Hello,
I'm working on a TTT server and I have the problem that i don't know how to add a user in ulx to a usergroup via lua script say for example like in an achievement system or something like that.
As far as I know it doesn't work via ply:SetUserGroup so how should i do it then?
P.S.: It would be cool if it says "(Someone) added *INSERT NAME HERE* to *INSERT GROUP HERE*" like if a real admin adds the player
-
Why don't you just run the already existing command (ulx adduser) using RunConsoleCommand()?
-
I kind of remember that I saw a thread already talking about RunConsoleCommand and how it don't work with ULX but i think i give it a try.
-
RunConsoleCommand("ulx", "adduser", target_ply, group)
-
RunConsoleCommand("ulx", "adduser", target_ply, group)
target_ply:Nick() *
-
of, if you want to just bypass that entirely, you can go straight to UCL.
ULib.ucl.addUser( target_ply:SteamID(), nil, nil, group )
-
Yes indeed.
In theory, you wouldn't even need ULX installed. Only ULib.
See our ULib docs page, linked from the sticky post(s) at front of the Dev corner forum area.
-
Got it working now and i wanted to thank you guys for the quick help :D
-
In theory, you wouldn't even need ULX installed. Only ULib.
How is this??? If ULX is not installed how would the person be in a group???
-
How is this??? If ULX is not installed how would the person be in a group???
Because ULX uses ULib's group system, and you can add users to ULib using Lua and not just ULX.