General > Developers Corner

Automatically move someone to a group if they join the steam group?

<< < (3/4) > >>

Jaden Zepeda:
Thank you all! Once my servers done with maintenance i'll be sure to test this.

Bytewave:

--- Quote from: JamminR on December 21, 2014, 01:20:24 PM ---EDIT - ALSO Bytewave's command (and my original edit) needs spaces to run as is.
Now fixed in my suggestion

--- End quote ---
Whoops! This is why I don't write code when I've just woken up.

JamminR:
No worries Bytewave.
I'm so used to having my nose in the top level Ulib/ULX code base that I had to ask a fellow team member if default group was "user" or "users" for that GetUserGroup command. :)
(it IS user, btw)

Jaden Zepeda:
Well it triggered the command thats for sure, but heres what my console is saying when a player joins the group and respawns

Error, bad server command ulx adduserid STEAM_0:0:86623958 member

JamminR:
Can you run the command without the script?
That doesn't seem like a normal Gmod or ulx console error.

Might be choking on the colon in the actual code?

Whatever the reason, you might try;

--- Code: --- if ply:GetUserGroup() == "user" then game.ConsoleCommand("ulx adduserid \"" .. ply:SteamID() .. "\" member") end
--- End code ---
(Look closely, I added double quotes, so command would be like ulx adduser "steam:0:0:####" member, hopefully server will like it better.
If that doesn't work, we go back to trying ply:Nick() and adduser

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version