ULX Command to add player with a specific user group to a different user group

Hey, I am trying to create a command which can use if ply:IsUserGroup(“rank”).

It doesn’t seem to work because it always returns me this:


[ERROR] addons/ulx/lua/ulx/modules/sh/user.lua:372: attempt to call method 'IsUserGroup' (a nil value)
  1. call - addons/ulx/lua/ulx/modules/sh/user.lua:372
   2. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
    3. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
     4. unknown - lua/includes/modules/concommand.lua:69

The actual idea behind this is making it impossible for admins/op’s to become e.g. donators.

Here is my code:


function ulx.donator( ply, calling_ply, target_ply, rank )
	if ply:IsUserGroup("user") then
		ULib.ucl.addUser(target_ply:SteamID(), {}, {}, "donator")
	end
end
local donator = ulx.command( CATEGORY_NAME, "ulx donator", ulx.donator, "!donator" )
donator:addParam{ type=ULib.cmds.PlayerArg }
donator:defaultAccess( ULib.ACCESS_SUPERADMIN )
donator:help( "Test." )

Any help?

Why did you create a new thread? Post your issue here instead http://www.facepunch.com/showthread.php?t=1411111