ULX

Author Topic: Command that automatically adds to usergroup  (Read 4247 times)

0 Members and 1 Guest are viewing this topic.

Offline billy90210

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Command that automatically adds to usergroup
« on: September 17, 2019, 04:33:08 PM »
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.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Command that automatically adds to usergroup
« Reply #1 on: September 17, 2019, 06:45:43 PM »
I'm pretty sure that at least 2 or 3 conversations of these 2 pages of search results may help get you started
« Last Edit: September 17, 2019, 06:47:25 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Command that automatically adds to usergroup
« Reply #2 on: September 17, 2019, 09:31:38 PM »
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.

Offline billy90210

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Command that automatically adds to usergroup
« Reply #3 on: September 18, 2019, 07:59:05 PM »
This is what I had came up with from looking at the conversations Jamminr told me
Code: [Select]
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 )

Will this work?