Small question. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Small question. (
/showthread.php?tid=121418)
Small question. -
DiddyBop - 16.01.2010
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.
Re: Small question. -
Peep - 16.01.2010
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))
Re: Small question. -
[HiC]TheKiller - 16.01.2010
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.
Re: Small question. -
DiddyBop - 16.01.2010
thx yew