Small question.
#1

Is there a simpiler way to doing this?

pawn Код:
if(weaponid == 10 || weaponid == 11 || weaponid == 12 || weaponid == 13 || weaponid == 16 || weaponid == 17 || weaponid == 18
        || weaponid == 35 || weaponid == 36 || weaponid == 37 || weaponid == 38 || weaponid == 39 || weaponid == 40 || weaponid == 44 || weaponid == 45)
        {
            new string[128];
            format(string, sizeof(string), "**Ban: %s Has been banned for weapon hacks!", PlayerName(i));
          SendClientMessageToAll(COLOR_RED, string);
          BanEx(i, string);
          return 1;
        }
i'm mainly reffering to the weapon check.
Reply
#2

Quote:
Originally Posted by G Spot ©
Is there a simpiler way to doing this?

pawn Код:
if(weaponid == 10 || weaponid == 11 || weaponid == 12 || weaponid == 13 || weaponid == 16 || weaponid == 17 || weaponid == 18
        || weaponid == 35 || weaponid == 36 || weaponid == 37 || weaponid == 38 || weaponid == 39 || weaponid == 40 || weaponid == 44 || weaponid == 45)
        {
            new string[128];
            format(string, sizeof(string), "**Ban: %s Has been banned for weapon hacks!", PlayerName(i));
          SendClientMessageToAll(COLOR_RED, string);
          BanEx(i, string);
          return 1;
        }
i'm mainly reffering to the weapon check.
if((weaponid >= 10 && weaponid <= 1 || (weaponid >= 35 && weaponid <= 40))

Reply
#3

Or you could
pawn Код:
new Weapons[] =
{
  10, 11, 12, 13, 14, 15, 16, 17, 18, 35, 36, 37, 38, 39, 40, 44, 45
};

for(new s; s<sizeof(Weapons); s++)
{
  if(weaponid == Weapons)
  {
    new string[128];
    format(string, sizeof(string), "**Ban: %s Has been banned for weapon hacks!", PlayerName(i));
    SendClientMessageToAll(COLOR_RED, string);
    BanEx(i, string);
    return 1;
  }
}
But peep's is better if you want to do a range, if you want to add more, this may be better.
Reply
#4

thx yew
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)