Getting name of array
#1

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.
Код:
new itemnames[MAX_ITEMS][] = {
"potato",
"potato2"
};
Код:
for(new i; i!= MAX_INVENTORY; i++)
{
format(str, sizeof(str), "ItemName: %s",itemnames[invslot[playerid][i]);
}
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!
Reply


Messages In This Thread
Getting name of array - by RollingFlow - 07.03.2014, 14:48
Re: Getting name of array - by Konstantinos - 07.03.2014, 14:54
Re: Getting name of array - by RollingFlow - 07.03.2014, 15:14
Re: Getting name of array - by Konstantinos - 07.03.2014, 15:22
Re: Getting name of array - by RollingFlow - 07.03.2014, 15:24
Re: Getting name of array - by Konstantinos - 07.03.2014, 15:33
Re: Getting name of array - by RollingFlow - 07.03.2014, 15:56

Forum Jump:


Users browsing this thread: 1 Guest(s)