Pawn: enum type in enum
#1

Because there are no structs and classes in pawn, i want to use enum type in enum, but get error when using the "double" enum massive.

Code:
enum AnimationProperties
{
    aId,
    aLib,
    aName

};

enum AnimationsInfo
{
    AnimationProperties:walk,
    AnimationProperties:walkHand,
    AnimationProperties:run,
    AnimationProperties:biss,

};
new aInfo[AnimationsInfo];

forward SetAnimations();
public SetAnimations()
{
    aInfo[walkHand][aId] = 0; // line 244

}
And the errors that i get are:
Quote:

(line 244): error 001: expected token: ";", but found "["
(line 244): error 029: invalid expression, assumed zero
(line 244): warning 215: expression has no effect
(line 244): error 001: expected token: ";", but found "]"

Is there any way to use somting like struct or class in pawn?
Reply
#2

remove last comma in

Code:
enum AnimationsInfo
{
    AnimationProperties:walk,
    AnimationProperties:walkHand,
    AnimationProperties:run,
    AnimationProperties:biss,

};
Reply
#3

Quote:
Originally Posted by CoaPsyFactor
View Post
remove last comma in
That is not the problem.
Reply
#4

??

pawn Code:
enum AnimationProperties
{
    aId,
    aLib,
    aName

};

enum AnimationsInfo
{
    walk,
    walkHand,
    run,
    biss
};
new aInfo[AnimationsInfo][AnimationProperties];

forward SetAnimations();
public SetAnimations()
{
    aInfo[walkHand][aId] = 0; // line 244
}
Reply
#5

Try this.

pawn Code:
enum AnimationsInfo
{
    walk,
    walkHand,
    run,
    biss,
}
new aInfo[AnimationsInfo][AnimationProperties];
Reply
#6

Oh nvm.
Reply
#7

Quote:
Originally Posted by BenzoAMG
View Post
??

pawn Code:
enum AnimationProperties
{
    aId,
    aLib,
    aName

};

enum AnimationsInfo
{
    walk,
    walkHand,
    run,
    biss
};
new aInfo[AnimationsInfo][AnimationProperties];

forward SetAnimations();
public SetAnimations()
{
    aInfo[walkHand][aId] = 0; // line 244
}
WOW! I do not believe that I asked so stupid question. massive[enumType][enumType] is it)
Guys, please sleep more than 3 hours a day

Thanks all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)