01.06.2015, 19:10
As you can add more data to the array, comparing one by one would be bad so a loop is just what you need.
It will return the name of it if it exists, else N/A.
PHP код:
DefineGuns(playerid)
{
new string[32] = "N/A";
for (new i; i != sizeof (InvItems); ++i)
{
if(Player[playerid][pWeapon] == InvItems[i][InvItem])
{
strcat((string[0] = EOS, string), InvItems[i][InvName], sizeof (string));
break;
}
}
return string;
}