Raised This Month: $ Target: $400
 0% 

Help me tag mistach


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skatzfz
Senior Member
Join Date: Apr 2014
Old 06-19-2014 , 22:58   Help me tag mistach
Reply With Quote #1

warning 19: tag mismatch

line: if (!is_user_admin(id) & ADMIN_RESERVATION)

why this happens? i'm trying to make my own plugins but i'm still a newbie in pawn, can you help me?
skatzfz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2014 , 23:04   Re: Help me tag mistach
Reply With Quote #2

is_user_admin() only tells you if the player is an admin (if they have any flags other than the "z" flag they will be considered an admin by this function; see amxmisc.inc).

If you want to check the flags for a person, you need to use get_user_flags() to get the integer that represents all of the flags that a player has and then use the bit-wise AND to determine if they have a particular flag.

So, to check if they have the reservation flag, you do this:

Code:
if( get_user_flags(i) & ADMIN_RESERVATION )
__________________
fysiks is offline
skatzfz
Senior Member
Join Date: Apr 2014
Old 06-19-2014 , 23:29   Re: Help me tag mistach
Reply With Quote #3

I want to check if he don't have the flag, can you help me to do it?
skatzfz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2014 , 23:39   Re: Help me tag mistach
Reply With Quote #4

You can do this

PHP Code:
if( ~get_user_flags(id) & ADMIN_RESERVATION )
{
    
// User does not have the reservation flag

or this:

PHP Code:
if( !(get_user_flags(id) & ADMIN_RESERVATION) )
{
    
// User does not have the reservation flag

__________________
fysiks is offline
skatzfz
Senior Member
Join Date: Apr 2014
Old 06-19-2014 , 23:57   Re: Help me tag mistach
Reply With Quote #5

Thanks!
skatzfz 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 21:10.


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