23.09.2010, 18:48
@******63:
You mean like this?
If so, this is slower..
You mean like this?
pawn Код:
stock returnWeaponSlot(weaponid)
{
new
weaponSlots[13][9] =
{
{ 0, 1 },
{ 2, 3, 4, 5, 6, 7, 8, 9 },
{ 22, 23, 24 },
{ 25, 26, 27 },
{ 28, 29 },
{ 30, 31 },
{ 33, 34 },
{ 35, 36, 37, 38 },
{ 16, 17, 18, 39 },
{ 41, 42, 43 },
{ 10, 11, 12, 13, 14, 15 },
{ 44, 45, 46 },
{ 40 }
}
;
for(new x; x != 13; ++x)
{
for(new y; y != 9; ++y)
{
if(weaponSlots[x][y] == weaponid) return x;
}
}
return -1;
}