No specific size in enum
#1

I don't quite know how to explain this, but my furniture system has basically a limit now which is set to 1000 by default.

I don't know what could happen but how would I go about removing the limit?


Код:
enum gFurnitureEnum
{
	furnID,
	furnHouse,
	furnExists,
	furnName[64],
	furnModel,
	furnPlaced,
	furnPrice,
	Float:furnPosition[6],
	furnInterior,
	furnVirtual,
	furnObjectID
};
new FurnitureData[MAX_FURNITURE][gFurnitureEnum];
Isn't it something like

Код:
new FurnitureData[][gFurnitureEnum];
I actually have no clue on how to do this
Reply
#2

Just increase MAX_FURNITURE when you want to increase the 1000 limit.
Reply
#3

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Just increase MAX_FURNITURE when you want to increase the 1000 limit.
No other way?
Reply
#4

Yes you can use it like
PHP код:
new FurnitureData[][gFurnitureEnum]; 
And for usage of it, instead of MAX_FURNITURE you will use sizeof(FurnitureData)
Reply
#5

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
No other way?
Nope. If something is dynamic, you can't use []
Reply
#6

Quick tip never do this in an enum when you don't have to Float:furnPosition[6] the whole purpose of an enum is to eliminate numerical referencing and encompass related data in a variable subset.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)