SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/06/2013, 11:53 PM   #1
Enforcer501
Little Clucker
 
Join Date: May 2013
Posts: 24
Reputation: 2
Default Multiple instances of an enum inside an enum

Alright, experimenting a bit but not really sure where to start. I'm wanting to create 5 instances of an enum inside of another enum for the sake of being organized.

Per-example, this is what I'm wanting to do. Now I know this naturally should return an error but bear in mind, this was only written as an example to help you understand the idea.
Code:
enum IDs_Enum // The enum I'd like to duplicate
{
	MyID,
	YourID,
	OtherGuysID
}
enum Base_Enum
{
	IDs_Enum[5], // Duplicating the enum 5 times per each Base_Enum instance
	OtherData,
	MoreData
}
new B_Enum[15][Base_Enum]

-------------------------------
error 021: symbol already defined: "IDs_Enum"
So whats the souce for this recipe guys?

Last edited by Enforcer501; 18/06/2013 at 02:48 AM.
Enforcer501 is offline   Reply With Quote
Old 18/06/2013, 12:03 AM   #2
JustBored
High-roller
 
JustBored's Avatar
 
Join Date: Jan 2013
Location: Buenos Aires - Argentina
Posts: 1,150
Reputation: 134
Default Respuesta: Multiple instances of an enum inside an enum

I think that you can't do what you want to do. I mean i think that it's imposible.
__________________
"Compiler - A program designed to tell you how wrong you are. It's a great way to induce stress and frustration."

JustBored is offline   Reply With Quote
Old 18/06/2013, 12:18 AM   #3
Enforcer501
Little Clucker
 
Join Date: May 2013
Posts: 24
Reputation: 2
Default Re: Multiple instances of an enum inside an enum

Well, that's what I've been told but it doesn't hurt to poke around a bit. Who knows, someone might have something clever up their sleeve.

Last edited by Enforcer501; 18/06/2013 at 02:45 AM.
Enforcer501 is offline   Reply With Quote
Old 18/06/2013, 02:04 PM   #4
Enforcer501
Little Clucker
 
Join Date: May 2013
Posts: 24
Reputation: 2
Default Re: Multiple instances of an enum inside an enum

Page 5, throwing this back into circulation.
Enforcer501 is offline   Reply With Quote
Old 18/06/2013, 02:31 PM   #5
ReVo_
Gangsta
 
ReVo_'s Avatar
 
Join Date: Oct 2009
Posts: 535
Reputation: 73
Default Re: Multiple instances of an enum inside an enum

You want something like this:
Code:
enum IDs_Enum // The enum I'd like to duplicate
{
	MyID,
	YourID,
	OtherGuysID
}
enum Base_Enum
{
	we[IDs_Enum][5], // Duplicating the enum 5 times per each Base_Enum instance
	OtherData,
	MoreData
}
new B_Enum[15][Base_Enum];
but you cant,
B_Enum[0][we][MyID][0] = 5;
will be a 4-D array and you can have at max 3d arrays.

Code:
enum Base_Enum
{
	we[IDs_Enum], // Duplicating the enum 5 times per each Base_Enum instance
	OtherData,
	MoreData
}
is valid.
ReVo_ 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
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
enum PlayerData - Can be used globally in multiple scripts ? denNorske Scripting Help 13 29/08/2012 05:17 PM
I want to run multiple instances helpmyass General 1 26/03/2010 10:23 PM
[SOLVED] Integer array inside an enum -zriptarusk Help Archive 11 20/03/2009 12:34 AM


All times are GMT. The time now is 06:17 AM.


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