General > Developers Corner

Add user to group via lua

(1/2) > >>

BigBrainAFK:
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

Aaron113:
Why don't you just run the already existing command (ulx adduser) using RunConsoleCommand()?

BigBrainAFK:
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.

Caustic Soda-Senpai:
RunConsoleCommand("ulx", "adduser", target_ply, group)

Bytewave:

--- Quote from: syst3M4TiK on April 09, 2015, 02:29:41 PM ---RunConsoleCommand("ulx", "adduser", target_ply, group)

--- End quote ---
target_ply:Nick() *

Navigation

[0] Message Index

[#] Next page

Go to full version