Trying to add a "vgm" rank / command

Results 1 to 5 of 5
  1. #1

    Trying to add a "vgm" rank / command

    Hello,

    I am trying to add a vgm rank that will have few admin commands such as admin_wall, admin_mute, admin_kick..

    I have added "CIF_VGM", "CCF_VGM", "IsVGMGrade()" and changed the commands to be like;

    _CC_AC("admin_wall", &ChatCmd_AdminAnnounce, CCF_ADMIN, ARGVNoMin, 1 , true,"/admin_wall <message>", "");
    _CC_AC("admin_wall", &ChatCmd_AdminAnnounce, CCF_ADMIN|CCF_VGM, ARGVNoMin, 1 , true,"/admin_wall <message>", "");
    But the weird part is when I get in-game, I get the username color that I set for VGM's but the commands not working. For VGM rank is showing just as text, and for admin rank it doesn't show anything, nor it executes the cmd.

    Something might be wrong in those places I guess;
    http://i.imgur.com/S9Rcshf.png
    http://i.imgur.com/Usztvla.png (set it to 0x3 because it was not declared before)
    http://i.imgur.com/RkKerqu.png
    http://i.imgur.com/OB0MKys.png

    I have tried to build & replace matchserver aswell, it didn't work.
    Last edited by ThroneX; 03-01-16 at 04:27 AM.


  2. #2
    Aristrum Mark is offline
    MemberRank
    Aug 2007 Join Date
    United KingdomLocation
    474Posts

    Re: Trying to add a "vgm" rank / command

    An immediate issue I've noticed is that CIF_VGM is meant to be a bit flag.

    Bit flags are an integer with each bit representing a true/false (or on/off, 0/1) state. This means you want each individual flag to look like this, so that each flag is on it's own bit:

    Code:
    FLAG1 = 00000001 (1 in decimal)
    FLAG2 = 00000010 (2 in decimal)
    FLAG3 = 00000100 (4 in decimal)
    FLAG4 = 00001000 (8 in decimal)
    ...
    FLAG8 = 10000000 (128 in decimal)
    However, you set CIF_VGM to 3 which means it's like this: 00000011. This means setting CIF_VGM currently sets CIF_NORMAL|CIF_ADMIN instead of being it's own flag. This might be causing the logic errors.

    To fix this, make the new flag the next available power of 2 - in this case, setting CIF_VGM to 8.

    Change that over, and see if any issues remain.
    Last edited by Mark; 03-01-16 at 02:59 PM. Reason: CCF -> CIF

  3. #3

    Re: Trying to add a "vgm" rank / command

    Quote Originally Posted by Mark View Post
    An immediate issue I've noticed is that CCF_VGM is meant to be a bit flag.

    Bit flags are an integer with each bit representing a true/false (or on/off, 0/1) state. This means you want each individual flag to look like this, so that each flag is on it's own bit:

    Code:
    FLAG1 = 00000001 (1 in decimal)
    FLAG2 = 00000010 (2 in decimal)
    FLAG3 = 00000100 (4 in decimal)
    FLAG4 = 00001000 (8 in decimal)
    ...
    FLAG8 = 10000000 (128 in decimal)
    However, you set CCF_VGM to 3 which means it's like this: 00000011. This means setting CCF_VGM currently sets CCF_NORMAL|CCF_ADMIN instead of being it's own flag. This might be causing the logic errors.

    To fix this, make the new flag the next available power of 2 - in this case, setting CCF_VGM to 8.

    Change that over, and see if any issues remain.
    This is really good point, I have tried to change the CIF_VGM to 0x8 and CCF_VGM to 0x160 as you can see below but it's still not working.

    http://i.imgur.com/3hNAVrS.png
    http://i.imgur.com/0Nxu5sh.png

    By the way, on my 255 ranked account it shows the syntax of command usage but it doesn't function. Still nothing working on the vgm grade.

  4. #4
    Aristrum Mark is offline
    MemberRank
    Aug 2007 Join Date
    United KingdomLocation
    474Posts

    Re: Trying to add a "vgm" rank / command

    The value of CCF_VGM in ZChatCmdFlag should be 0x100, not 0x160. Once that is changed over, you can try attaching the debugger to the matchserver/client with breakpoints in the relevant places to figure out what is going wrong.

  5. #5

    Re: Trying to add a "vgm" rank / command

    Quote Originally Posted by Mark View Post
    The value of CCF_VGM in ZChatCmdFlag should be 0x100, not 0x160. Once that is changed over, you can try attaching the debugger to the matchserver/client with breakpoints in the relevant places to figure out what is going wrong.
    I have figured it out, thank you so much.



Advertisement