Raised This Month: $ Target: $400
 0% 

How to "switch strings" ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-02-2010 , 11:49   Re: How to "switch strings" ?
Reply With Quote #3

PHP Code:
#include <amxmodx>

const abcd ADMIN_IMMUNITY|ADMIN_RESERVATION|ADMIN_KICK|ADMIN_BAN
const abcdef abcd|ADMIN_SLAY|ADMIN_MAP

public test(id)
{
    switch( 
get_user_flags(id) )
    {
        case 
abcd:
        {
            
//..
        
}
        case 
abcdef:
        {
            
//...
        
}
    }

case abcdef won't match if user have another flag like flag "g" for example, so this is a really bad idea to use this.

Use rather has_flags or has_all_flags stocks from amxmisc + if / else statements.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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 08:40.


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