Ulysses

General => Developers Corner => Topic started by: billy90210 on September 17, 2019, 04:33:08 PM

Title: Command that automatically adds to usergroup
Post by: billy90210 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.
Title: Re: Command that automatically adds to usergroup
Post by: JamminR 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 (https://forums.ulyssesmod.net/index.php?action=search2;params=eJwtzMsKgCAQheFXiTZtC3of0XHIwhwZLxH48I3h7j_f4mhbdQC0bWlrm5vhXtsumRw9CuiOHjMKdirmQsiKgn-HEGcpRo__zyBlTxa2mKALagYnu55xOphK_AC2JS6X) may help get you started
Title: Re: Command that automatically adds to usergroup
Post by: MrPresident 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.
Title: Re: Command that automatically adds to usergroup
Post by: billy90210 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?