Author Topic: creating ulx group thorugh lua  (Read 1704 times)

0 Members and 1 Guest are viewing this topic.

Offline dankpepe

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 1
creating ulx group thorugh lua
« on: May 08, 2016, 11:44:23 AM »


    I'm trying to make a lua autorun script that creates a group called usor and inherits from superadmin. I have this:

    RunConsoleCommand( "ulx hide", "ulx addgroup", "usor superadmin" )

    It creates the usor group just fine, but it doesn't inherit from superadmin.


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: creating ulx group thorugh lua
« Reply #1 on: May 08, 2016, 11:49:20 AM »
"usor" and "superadmin" are separate arguments, and would need to be separated in the function call.

But, you should really use the API -- http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.addGroup
Experiencing God's grace one day at a time.

Offline dankpepe

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 1
Re: creating ulx group thorugh lua
« Reply #2 on: May 08, 2016, 12:15:54 PM »
How would I use the API? I've tried to use it, but it wasn't working. I have tried:

ULib.ucl.addGroup( usor, _ , superadmin, _ )

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given