[Help]Item command up to +9

07/08/2009 13:15 ~*NewDuuDe*~#1
Well this is kinda the secound thread I'm making about this, which I am sorry for.
I'm trying to get the player item command to go only up to +9 even when they try getting +12 items.
This is what I've tried:
Code:
Item.Plus = byte.Parse(Cmd[3]); 
          if (Item.Plus >= 9)
          {
                  Item.Plus = 9;
           }
--------------------------
Item.Plus = byte.Parse(Cmd[3]);
 if (Item.Plus = 9)
   {
              Item.Plus = 9;
    }
-------------------------


Item.Plus = (byte)(Math.Min((byte)8, byte.Parse(Cmd[3])));
The result of all of them was that they made 2 items one +9 and one +12 when trying to do /item xxx xx 12 x xxx xx xx.
The only one which somewhat succeeded was the first one which only gave 1 item when typing in /item xxx xx 9 x xxx xx xx.
But then again the same happened when trying to get a +12.
I also tried editing the rest of the command/re-writing it but that just threw me a bunch of errors.
I know that I can change my packets to the LOTF version of them, which might work, but I don't really know how.
Help Plox.
07/08/2009 17:36 _tao4229_#2
Item.Plus = Client.Flags >= AdminFlags.GM ? Math.Min((byte)12, byte.Parse(cmds[3])) : Math.Min((byte)9, byte.Parse(cmds[3]));