General > Developers Corner
Command that automatically adds to usergroup
(1/1)
billy90210:
Hello, I'm looking to make a command that would automatically add a user to my vip group when they execute !vip . I understand people don't do things here for you. But, I'm not sure how to get started. Any help is appreciated.
JamminR:
I'm pretty sure that at least 2 or 3 conversations of these 2 pages of search results may help get you started
MrPresident:
http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.addUser
reverse engineer any of our commands to find out how to make a chat command for !vip then the above is info on how to add a user to a group with code.
ULib.ucl.addUser( id, allows, denies, group, from_CAMI )
for example: ULib.ucl.addUser( pl:SteamID(), _, _, "VIP", false)
of course this example assumes your player object is pl and your group is "VIP" you'd have to adjust accordingly.
billy90210:
This is what I had came up with from looking at the conversations Jamminr told me
--- Code: ---local CATEGORY_NAME = "SS Commands"
function ulx.vip()
RunConsoleCommand("ulx", "adduser", target_ply:Nick(), premium)
end
local vip = ulx.command (SS Commands, "ulx vip", ulx.vip, "!vip", true )
--- End code ---
Will this work?
Navigation
[0] Message Index
Go to full version