17.12.2018, 08:33
Why not do it like this?
PHP код:
enum eItem
{
Type,
Value,
Exist,
Drop
};
new Inventar[MAX_PLAYERS][50][eItem]; //you can say 50 Items for Player
stock CanBuildTorch(playerid)
{
new wood,grass;
for(new i; i<sizeof(Inventar[]); i++)
{
if(!Inventar[playerid][i][Exist]) continue;
switch(Inventar[playerid][i][Type])
{
case 0: wood++;
case 1: grass++;
}
}
return (wood >= 3 && grass >= 4);
}