07.03.2014, 14:48
Let's say for an example I have a array with the objective of holding strings, such as "cow", "Potato", etc.
The problem here is not getting the name of this as I obviously understand that, but the main issue is getting the name of an integer. Let me explain with code.
What I mean by this is getting the itemname dependent on what [i] is, so if the inventoryslot 0 would be 0 it would be potato 1 potato2. I honestly got no clue at this point, as doing it simply as above "itemname[invslot[playerid][i]]", gives me a clear Array index out bounds error.
If someone could help me, I'd appreciate it massively!
Thanks!
The problem here is not getting the name of this as I obviously understand that, but the main issue is getting the name of an integer. Let me explain with code.
Код:
new itemnames[MAX_ITEMS][] = { "potato", "potato2" };
Код:
for(new i; i!= MAX_INVENTORY; i++) { format(str, sizeof(str), "ItemName: %s",itemnames[invslot[playerid][i]); }
If someone could help me, I'd appreciate it massively!
Thanks!