Raised This Month: $ Target: $400
 0% 

[ SOLVED] case


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
daniel46
Senior Member
Join Date: Dec 2011
Old 05-06-2013 , 06:15   [ SOLVED] case
Reply With Quote #1

i dont know what is the problem here

i got problem in the case

Code:
switch( GetUserItem( client ) )
	{
		case Laser: Players[ client ] [ Laser ] = true;
		
		case TimerFreeze: Players[ client ] [ TimerF ] = true;
		
		case SuperPunch: Players[ client ] [ LeeSinPunch ] = true;
		
		case Poisened: Players[ client ] [ Poisen ] = true;
	}

and here is the enum and new

Code:
enum _:ItemsInfo {
	Laser,
	TimerFreeze,
	SuperPunch,
	Poisened
};

new TheItem[ 33 ][ ItemsInfo ];
and the stock

Code:
stock GetUserItem( index )
{
	for( new i = 0 ; i < ItemsInfo ; i ++ )
	{
		if( TheItem[ index ][ i ] )
		{
			return i;
		}
	}
	return -1
}
and i didnt have any problem in the first 3 options but when i added the poisen its make in the case this lien Error

Error: Duplicate "case" label (value 3)
daniel46 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-06-2013 , 07:20   Re: [ help ] case
Reply With Quote #2

PHP Code:
enum _:ItemsInfo {
    
Laser,
    
TimerFreeze,
    
SuperPunch,
    
Poisened
}; 
test >>

PHP Code:
enum _:ItemsInfo {
    
Laser 0,
    
TimerFreeze,
    
SuperPunch,
    
Poisened
}; 
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
daniel46
Senior Member
Join Date: Dec 2011
Old 05-06-2013 , 07:58   Re: [ help ] case
Reply With Quote #3

save problem
daniel46 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-06-2013 , 08:11   Re: [ help ] case
Reply With Quote #4

Quote:
Originally Posted by daniel46 View Post
save problem
SAVE or SOLVED ?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
daniel46
Senior Member
Join Date: Dec 2011
Old 05-06-2013 , 08:23   Re: [ help ] case
Reply With Quote #5

o sorry i ment same*

but yes i solved my problem i have few enums and i had 2 lasers in 2 diffrent enums
daniel46 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 10:45.


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