AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   enum in variable (https://forums.alliedmods.net/showthread.php?t=243986)

xbennY 07-12-2014 10:51

enum in variable
 
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!

HamletEagle 07-12-2014 13:16

Re: enum in variable
 
Quote:

Originally Posted by xbennY (Post 2166418)
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.

fysiks 07-12-2014 15:21

Re: enum in variable
 
It simply creates enumerated variables with a tag (CsTeams).

Mario AR. 07-12-2014 15:28

Re: enum in variable
 
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 



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

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