SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 15/02/2012, 11:32 AM   #11
KingHual
Banned
 
Join Date: Jun 2010
Location: Bulgaria
Posts: 2,289
Reputation: 1389
Default Re: Enumerators (enums). What they actually are?

Both of your tutorials are great. I didn't really know some of the things, so I think every wannabe scripter should take a look at this before saying "jaja Im pro im the best" ...
KingHual is offline   Reply With Quote
Old 15/02/2012, 01:08 PM   #12
Max_Coldheart
Banned
 
Join Date: Dec 2011
Location: Finland
Posts: 682
Reputation: 88
Default Re: Enumerators (enums). What they actually are?

Wow, didn't know all of these things about enumerators. Thanks for the tutorial, finally I understand those :P
Max_Coldheart is offline   Reply With Quote
Old 15/02/2012, 01:33 PM   #13
Zarky
Big Clucker
 
Join Date: Jan 2012
Posts: 61
Reputation: 4
Default Re: Enumerators (enums). What they actually are?

Nice Tutorial.
Zarky is offline   Reply With Quote
Old 15/02/2012, 07:01 PM   #14
kizla
Big Clucker
 
kizla's Avatar
 
Join Date: Dec 2009
Posts: 173
Reputation: 50
Default Re: Enumerators (enums). What they actually are?

Nice tutorial...

And we can use enums for example:

pawn Code:
enum Info
{
    Some,
    Else,
    More
}
new Data[MAX_PLAYERS][Info];

And we usually use it like (example):

pawn Code:
Data[playerid][Some] = 2;
Data[playerid][Else] = 1456416;

but we can use it:

pawn Code:
Data[playerid][Info:0] = 2; //Is the same like Data[playerid][Some]
Data[playerid][Info:1] = 1456416

p.s sorry if you already post it :S
__________________
Tutorials
Abstract Machine eXecutor / emits
kizla is offline   Reply With Quote
Old 16/02/2012, 04:33 AM   #15
-ExG-VirusKiller
Little Clucker
 
Join Date: Jan 2012
Posts: 43
Reputation: 6
Default Re: Enumerators (enums). What they actually are?

Wow is all I can say.
Learnt some new things after reading this.
__________________
Ericson Gaming Is Here.Providing the best quality SA:MP and Team Fortress 2 Servers hosted on a low latency VPS.Developers and admins needed.Click here to visit the website and here to visit the forum.
-ExG-VirusKiller is offline   Reply With Quote
Old 19/02/2012, 12:17 AM   #16
Nonameman
Huge Clucker
 
Nonameman's Avatar
 
Join Date: Jun 2009
Location: Hungary
Posts: 303
Reputation: 18
Default Re: Enumerators (enums). What they actually are?

Thanks a lot, you learnt me many things I have not known before.

Last edited by Nonameman; 19/05/2012 at 09:36 PM.
Nonameman is offline   Reply With Quote
Old 17/07/2012, 11:53 AM   #17
Minion
Little Clucker
 
Join Date: Jun 2011
Location: Parts Unknown
Posts: 30
Reputation: 0
Default Re: Enumerators (enums). What they actually are?

Really Userful Tutorial for Beginner Scripters. Thanks for this piece of Information! +REP!
Minion is offline   Reply With Quote
Old 06/09/2012, 06:52 AM   #18
Sniper Kitty
Big Clucker
 
Sniper Kitty's Avatar
 
Join Date: Jul 2012
Location: http://tinyurl.com/LocationSONG
Posts: 172
Reputation: 25
Default Re: Enumerators (enums). What they actually are?

Is it possible to

static enum ?
__________________
Contact Me:
****** & MSN
SniperKitty94@gmail.com
Skype
Steam
VKontakte

I know Pawn, C/C++, HTML, CSS, PHP, MySQL, Javascript, jQuery, and AJAX.
I won't script for you, I will only help you with little questions you have.

Want more realistic graphics on GTA San Andreas? Click here.
Sniper Kitty is offline   Reply With Quote
Old 06/09/2012, 06:57 AM   #19
Slice
High-roller
 
Join Date: Mar 2008
Posts: 1,831
Reputation: 1607
Default Re: Enumerators (enums). What they actually are?

Quote:
Originally Posted by Sniper Kitty View Post
Is it possible to

static enum ?
pawn Code:
enum {
    VALUE_IS_0,
    VALUE_IS_1,
    VALUE_IS_2
}

main() {
    printf("%d", VALUE_IS_1); // prints 1
}
Slice is offline   Reply With Quote
Old 11/01/2013, 08:29 PM   #20
FalconCRO
Little Clucker
 
Join Date: Feb 2011
Posts: 15
Reputation: 0
Default Re: Enumerators (enums). What they actually are?

So how would you add some data in one of the enums in the beginning? For example, like you would do with an array:

Code:
new example[3] = {1,2,3};
How would you do that if you're using enumeration:

Code:
enum EXAMPLE
{
       EX_1,
       EX_2[3]
}

new myarray[EXAMPLE];
Let's say I want to put 3 static values in EX_2, how to do that?
FalconCRO 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
Enums zxc1 Scripting Help 1 02/09/2011 02:31 PM
Component IDs from file aren't loading into the enums, but save from the enums. Jack_Leslie Help Archive 7 19/08/2011 02:00 PM
Help using enums [L3th4l] Help Archive 4 27/02/2011 05:10 AM
Enums xir Help Archive 2 02/01/2011 05:28 PM


All times are GMT. The time now is 09:26 PM.


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