Raised This Month: $ Target: $400
 0% 

enum in variable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbennY
New Member
Join Date: Jan 2014
Old 07-12-2014 , 10:51   enum in variable
Reply With Quote #1

What is this? What does this creates? What it is for?

PHP Code:
enum CsTeams 
{
    
CS_TEAM_UNASSIGNED 0,
    
CS_TEAM_T 1,
    
CS_TEAM_CT 2,
    
CS_TEAM_SPECTATOR 3
};

new 
CsTeams:iWinner
Thanks!

Last edited by xbennY; 07-12-2014 at 10:51.
xbennY is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-12-2014 , 13:16   Re: enum in variable
Reply With Quote #2

Quote:
Originally Posted by xbennY View Post
What is this? What does this creates? What it is for?

PHP Code:
enum CsTeams 
{
    
CS_TEAM_UNASSIGNED 0,
    
CS_TEAM_T 1,
    
CS_TEAM_CT 2,
    
CS_TEAM_SPECTATOR 3
};

new 
CsTeams:iWinner
Thanks!
Search for enum tutorials. You have one by exolent and one called "structs in pawn" or sth like this.
HamletEagle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-12-2014 , 15:21   Re: enum in variable
Reply With Quote #3

It simply creates enumerated variables with a tag (CsTeams).
__________________
fysiks is offline
Mario AR.
Senior Member
Join Date: May 2011
Location: Lima, Perú
Old 07-12-2014 , 15:28   Re: enum in variable
Reply With Quote #4

Then CS_TEAM_UNASSIGNED (and the others) are tagged as CsTeams, and if you want to store them in a variable then you should create it with the tag.
PHP Code:
new CsTeams:something CS_TEAM_UNASSIGNED 
Mario AR. is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 21:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode