SA-MP Forums Archive
Pawn: enum type in enum - 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: Pawn: enum type in enum (/showthread.php?tid=513999)



Pawn: enum type in enum - sagosagi1 - 19.05.2014

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?


Re: Pawn: enum type in enum - CoaPsyFactor - 19.05.2014

remove last comma in

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

};



Re: Pawn: enum type in enum - sagosagi1 - 19.05.2014

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


Re: Pawn: enum type in enum - Threshold - 19.05.2014

??

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
}



Re: Pawn: enum type in enum - AndySedeyn - 19.05.2014

Try this.

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



Re: Pawn: enum type in enum - jihadmeneer - 19.05.2014

Oh nvm.


Re: Pawn: enum type in enum - sagosagi1 - 19.05.2014

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.