AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me tag mistach (https://forums.alliedmods.net/showthread.php?t=242457)

skatzfz 06-19-2014 22:58

Help me tag mistach
 
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?

fysiks 06-19-2014 23:04

Re: Help me tag mistach
 
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 )

skatzfz 06-19-2014 23:29

Re: Help me tag mistach
 
I want to check if he don't have the flag, can you help me to do it?

fysiks 06-19-2014 23:39

Re: Help me tag mistach
 
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



skatzfz 06-19-2014 23:57

Re: Help me tag mistach
 
Thanks!


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

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