18.02.2014, 23:56
Today I learned that you can actually pass "inline" arrays to functions;
pawn Code:
if(in_array(GetPlayerWeapon(playerid), {22,26,28,29,30,31,32}))
{
printf("stuff");
}
else
{
printf("no stuff");
}
pawn Code:
in_array(needle, const haystack[], size = sizeof haystack)
{
for(new i; i < size; i++)
if(haystack[i] == needle) return true;
return false;
}