array sizes do not match, or destination array is too small
#5

Quote:
Originally Posted by kAn3
Посмотреть сообщение
Hi, it happens when eg
PHP код:
new var[8]; 
format(var, sizeof var, "012345678"); // Array dimensions do no match 
I know and the code you gave wouldn't give an error, it wouldn't just store all of the text in that array.
Quote:
Originally Posted by GloomY
Посмотреть сообщение
Код:
enum e_Items
{
    iName[20],
    iModel,
    iLootSpawn
}

static stock
	g_Items[][e_Items] = {
	{"Sandwich", 2663, true},
	{"Kebar Roll", 2769, true},
        {"Burger", 2768, true}
};
Try using it like this. If it doesn't work, it might be something wrong with CreateItem function.
This is not really how I would use static and stock and CreateItem is fine it works everywhere else.
Quote:
Originally Posted by whadez
Посмотреть сообщение
Have you tried giving your array an exact size?
Код:
new g_Items[3][e_Items] =
{
	{"Sandwich", 2663, true},
	{"Kebar Roll", 2769, true},
        {"Burger", 2768, true}
}
I doubt that this would be the problem, but check it anyways.
Also change iLootSpawn to bool since you are using it as bool.
Код:
enum e_Items
{
	iName[20],
	iModel,
	bool:iLootSpawn
}
I tried giving it a size, but it didn't help and as far as I know it's not needed as the compiler will pick the size itself and I don't like adding the bool tag to variables and it's not really necessary because there's no difference between a boolean and an integer in PAWN, thank you though.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)