Raised This Month: $ Target: $400
 0% 

Removing Flag A


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-01-2009 , 10:58   Re: Removing Flag A
Reply With Quote #1

hlev, that is the same as my code except w\ an if statement; you can also shorten it with set_user_flags( id, iFlags & ~ADMIN_LEVEL_A );

Kadir, it should work. Are you properly testing if the flag exists?

Try this:
PHP Code:
//check if player has level a prior to removing
if ( get_user_flagsid ) & ADMIN_LEVEL_A )
    
client_printid print_chat "player has level a" );
else
    
client_printid print_chat "player does not have level a" );

//remove level a from flags
new iFlags = ( get_user_flagsid ) & ~ADMIN_LEVEL_A );
remove_user_flagsid );
set_user_flagsid iFlags );

//check again if player has level a
if ( get_user_flagsid ) & ADMIN_LEVEL_A )
    
client_printid print_chat "player has level a" );
else
    
client_printid print_chat "player does not have level a" ); 
__________________

Last edited by Bugsy; 11-01-2009 at 11:09.
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2009 , 17:21   Re: Removing Flag A
Reply With Quote #2

Code:
set_user_flags(id, get_user_flags(id) & ~ADMIN_IMMUNITY)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-01-2009 , 17:36   Re: Removing Flag A
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Code:
set_user_flags(id, get_user_flags(id) & ~ADMIN_IMMUNITY)
Will not work Connor, you must remove flags too.

Try it:
PHP Code:
public testid )
{
    
//check if player has level a prior to removing
    
if ( get_user_flagsid ) & ADMIN_LEVEL_A )
        
client_printid print_chat "player has level a" );
    else
        
client_printid print_chat "player does not have level a" );
    
    
set_user_flagsid , ( get_user_flagsid ) & ~ADMIN_LEVEL_A ) );
    
    
//check again if player has level a
    
if ( get_user_flagsid ) & ADMIN_LEVEL_A )
        
client_printid print_chat "player has level a" );
    else
        
client_printid print_chat "player does not have level a" ); 

__________________
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2009 , 17:43   Re: Removing Flag A
Reply With Quote #4

Exact :

Code:
	pPlayer->flags[id] |= flag;

Which idiot wrote :
Code:
	if (id < 0)
		id = 0;
	
	if (id > 31)
		id = 31;
??
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-01-2009 , 18:20   Re: Removing Flag A
Reply With Quote #5


PHP Code:
remove_user_flagsid ADMIN_LEVEL_A ); 
__________________

Last edited by Bugsy; 11-01-2009 at 18:23.
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2009 , 19:14   Re: Removing Flag A
Reply With Quote #6

I still wonder what is the 3rd arg.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 17:48.


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