SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/05/2014, 07:39 AM   #1
sagosagi1
Little Clucker
 
Join Date: Apr 2014
Posts: 34
Reputation: 0
Default Pawn: enum type in enum

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?
sagosagi1 is offline   Reply With Quote
Old 19/05/2014, 07:40 AM   #2
CoaPsyFactor
Gangsta
 
Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 867
Reputation: 52
Default Re: Pawn: enum type in enum

remove last comma in

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

};
__________________
Quote:
Originally Posted by ThaiLuan View Post
Code:
C:\Users\Administrator\Downloads\Viet-RP\gamemodes\3mien.pwn(112016) : fatal error 101: cannot write to file: "disk full"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Help me! How to fix error
CoaPsyFactor is offline   Reply With Quote
Old 19/05/2014, 07:45 AM   #3
sagosagi1
Little Clucker
 
Join Date: Apr 2014
Posts: 34
Reputation: 0
Default Re: Pawn: enum type in enum

Quote:
Originally Posted by CoaPsyFactor View Post
remove last comma in
That is not the problem.
sagosagi1 is offline   Reply With Quote
Old 19/05/2014, 07:52 AM   #4
Threshold
High-roller
 
Threshold's Avatar
 
Join Date: Nov 2012
Location: Australia
Posts: 3,126
Reputation: 527
Default Re: Pawn: enum type in enum

??

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
}

__________________


Kar's Cops and Robbers 2020
Threshold is offline   Reply With Quote
Old 19/05/2014, 08:04 AM   #5
AndySedeyn
High-roller
 
AndySedeyn's Avatar
 
Join Date: Feb 2014
Location: Belgium
Posts: 1,207
Reputation: 681
Default Re: Pawn: enum type in enum

Try this.

pawn Code:
enum AnimationsInfo
{
    walk,
    walkHand,
    run,
    biss,
}
new aInfo[AnimationsInfo][AnimationProperties];
AndySedeyn is offline   Reply With Quote
Old 19/05/2014, 08:32 AM   #6
jihadmeneer
Big Clucker
 
Join Date: Mar 2014
Posts: 69
Reputation: 58
Default Re: Pawn: enum type in enum

Oh nvm.
__________________
My work:

[GameMode]Liberty Roleplay
[Tutorial]How to debug
jihadmeneer is offline   Reply With Quote
Old 19/05/2014, 08:34 AM   #7
sagosagi1
Little Clucker
 
Join Date: Apr 2014
Posts: 34
Reputation: 0
Default Re: Pawn: enum type in enum

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.
sagosagi1 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple instances of an enum inside an enum Enforcer501 Scripting Help 4 18/06/2013 02:31 PM
Checking type of ENUM variable Swimor Scripting Help 1 04/06/2013 03:32 PM
Enum tag inside another enum? LarzI Scripting Help 4 19/03/2013 02:10 PM
Enum to check another enum? Lz Scripting Help 4 14/12/2012 06:05 PM


All times are GMT. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.