View Full Version : [SOLVED] VIP Commands Problem

01-23-2014, 11:38 AM
So I used this script to add vip comamnds http://pastebin.com/0QXFMUaB then I compiled and everything worked fine.
Then I added the commands into the world commands table.Then added them into rbac_permissions and then liked them to the vip rank.
I did that before with the world chat command and it worked just fine but this time it doesn't work.When I access the command it says "there is no such subcommand"(obviusly the account i'm trying to access the commands has vip rank)
So now i'm asking you what else do I need to do to make it work.

01-23-2014, 12:40 PM
{"Buff", SEC_PLAYER, true, &HandleBuffCommand, "",},
{"Reset cooldowns", SEC_PLAYER, true, &HandleResetCooldownsCommand, "",},
{"Repair", SEC_PLAYER, true, &HandleRepairCommand, "",},
{"Heal", SEC_PLAYER, true, &HandleHealCommand, "",},
{ NULL, 0, false, NULL, "", NULL }


static ChatCommand commandTable[] =
{ "vip", 0, true, NULL, "", vipCommandTable},
See TC example command scripts.
Red parts are wrong bove, also makes me wonder what you added to the rbac tables ...

ALL permissions, commands and groups are in rbac_permissions.
The command script (red part) and world->commands table as well as auth->rbac_permissions use the same number as ID.
rbac_default_permissions holds GM rank relations to linked IDs. Note that these IDs are groups by default.
rbac_linked_permissions can be used to group permissions/commands or just grant them to a specific GM rank.

This means that to add a new command, the command (each command!) needs to have an unique permission ID in the script, which is then used in the DB like so:

-- define our command (.additem)
INSERT INTO `command` (`name`, `permission`, `help`) VALUES
('additem', 488, 'Syntax: .additem #itemid');
INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
(488, 'Command: additem');

-- link our command to admin command group (add .additem to admin group)
INSERT INTO `rbac_linked_permissions` (`id`, `linkedId`) VALUES
(196, 488);

Orange marks the groupID for administrative commands (note that this group is by default only used for GM rank 3)
Green marked is the unique ID for .additem command
Note that ONLY the permissions and commands are defined in the core. (in RBAC.h)

01-23-2014, 01:35 PM
That command script wont work without it being linked to the RBAC role for that command.

01-23-2014, 02:51 PM
This is what shows me in world log

These are the commands that I added into world commands table

The commands added into rbac_permissions

And this is how I linked them into rbac_linked_permissions

191 is the vip rank

Now please tell me what did I do wrong?
I also tried to link them to a gm rank but it didn't work eather

01-23-2014, 03:15 PM
Did you set the IDs to the script as well? In place of the SEC_PLAYER

01-23-2014, 03:28 PM
It worked.
Thank you for your help