Raised This Month: $32 Target: $400
 8% 

Solved warn 213 when i'm using enums


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-23-2021 , 07:56   warn 213 when i'm using enums
Reply With Quote #1

Hi! I'm getting warning 213: tag mismatch if i using enum like below:
PHP Code:
enum eTheBestEnumeration{
    
ENUM_ZERO 0,
    
ENUM_ONE,
    
ENUM_TWO
}
// .......
public somecmd(executor) {
    new 
arg[2]
    
read_argv(1argcharsmax(arg))
    
    new 
iArg clamp(str_to_num(arg), 02)
    if(
iArg == ENUM_ZERO) {} //insert useless code here
    
else if(iArg == ENUM_ONE) {} //insert useless code here
    
else if(iArg == ENUM_TWO) {} //insert useless code here
    // I KNOW HERE MUST BE USED SWITCH INSTEAD OF IFS
    // And it works perfectly with switches
    
}

How can it be fixed?

Last edited by kww; 06-23-2021 at 14:23.
kww is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-23-2021 , 12:47   Re: warn 213 when i'm using enums
Reply With Quote #2

PHP Code:
new eTheBestEnumeration:iArg clamp(str_to_num(arg), ENUM_ZEROENUM_TWO
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-23-2021 at 12:47.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-23-2021 , 14:07   Re: warn 213 when i'm using enums
Reply With Quote #3

Another alternative is to de-tag the enum, but this many not be ideal.
enum eTheBestEnumeration -> enum _:eTheBestEnumeration
__________________

Last edited by HamletEagle; 06-23-2021 at 14:07.
HamletEagle is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-23-2021 , 14:25   Re: warn 213 when i'm using enums
Reply With Quote #4

Thank you @Natsheh and @HamletEagle
kww is offline
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

Forum Jump


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


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