Enum of enums - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Enum of enums (
/showthread.php?tid=366113)
Enum of enums -
Misiur - 05.08.2012
Hello, it's me again on the wrong side of help.
pawn Код:
#define MAX_FOOD 3
new Food[MAX_FOOD];
enum Pancake {
withMapleSyrup,
isSweet
}
enum Pizza {
doubleCheese,
hasKetchup,
size,
drawingOnBox[64]
}
/* Somewhere in code */
{
Food[0] = (AreFluffy(Unicorns)) ? (Pizza) : (Pancake);
}
This is not valid code - everybody knows unicorns are fluffy. Anyway I get tag mismatch, because the array is tagless and expects integers, not enums. Is there way to somehow group these enums? With something like
pawn Код:
enum FOOD {
Pancake,
Pizza
}
//And then
new FOOD:Food[MAX_FOOD];
Food[0] = Pancake;
Food[0][doubleCheese] = true; //Yay!
or something?
I've already tried with weak tags - no results. Thanks for help