• ULX "Promote"
    5 replies, posted
Hey, I need something like "ulx adduser", just that it promotes people without demoting Example: "promote Username operator" user -> operator What I don't want it to do: "promote Username user" operator -> user So actually no demoting at all for this command. Could somebody please help me out? :)
Do you want a ulx command that promotes people? If you want that test out this code(im not sure if it will work but I think so) [CODE]function ulx.promote( calling_ply, target_ply, rank ) ULib.ucl.addUser(target_ply:SteamID(), {}, {}, rank) ulx.fancyLogAdmin( calling_ply, "#A promoted #T ", target_ply ) end local promote = ulx.command( CATEGORY_NAME, "ulx promote", ulx.promote, "!promote" ) promote:addParam{ type=ULib.cmds.PlayerArg } promote:addParam{ type=ULib.cmds.StringArg, hint="rank"} promote:defaultAccess( ULib.ACCESS_SUPERADMIN ) promote:help( "Promotes target." )[/CODE]
No he is basically asking for a system where there is basically a chain of command on his server and a command that can only bring a person up the chain of command not down.
I want following... Lets say the admin is called.. serveradmin. and the user... guest. serveradmin uses this promote command (promote guest operator) guest ranks up from user -> operator what should NOT happen: serveradmin uses this promote command (promote guest user) guest loses the operator rank, operator -> user So that the second one isn't possible. [Because a promotion which gives you a worse rank SHOULD NOT be possible] [QUOTE=CoreBase;46026356]Do you want a ulx command that promotes people? If you want that test out this code(im not sure if it will work but I think so) [CODE]function ulx.promote( calling_ply, target_ply, rank ) ULib.ucl.addUser(target_ply:SteamID(), {}, {}, rank) ulx.fancyLogAdmin( calling_ply, "#A promoted #T ", target_ply ) end local promote = ulx.command( CATEGORY_NAME, "ulx promote", ulx.promote, "!promote" ) promote:addParam{ type=ULib.cmds.PlayerArg } promote:addParam{ type=ULib.cmds.StringArg, hint="rank"} promote:defaultAccess( ULib.ACCESS_SUPERADMIN ) promote:help( "Promotes target." )[/CODE][/QUOTE] I am gonna try that, thanks! Edit: That actually is like adduser, so you can do that: admin -> user, I want that to be not possible. user>operator>admin>superadmin E
ULX allows for an inheritance "tree", which means you don't always necessarily have a linear chain of command for groups (although most people set it up that way). However, you can use [url=http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.getInheritanceTree]ULib.ucl.getInheritanceTree[/url] as an easy way to figure out what the next level up is likely to be.
Sorry, you need to Log In to post a reply to this thread.