Raised This Month: $ Target: $400
 0% 

admin flag a only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OOE
Member
Join Date: Sep 2013
Old 01-05-2014 , 03:35   admin flag a only
Reply With Quote #1

Hi can someone code in this code here (its a part of a huge plugin) that only Admins with admin flag A can open the blockmaker pls

PHP Code:
public CmdMainMenu(id)
{
    
ShowMainMenu(id);
    return 
PLUGIN_HANDLED;

OOE is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-05-2014 , 03:50   Re: admin flag a only
Reply With Quote #2

if(! (get_user_flags(id) & ADMIN_KICK))
return PLUGIN_HANDLED
__________________
Kia is offline
OOE
Member
Join Date: Sep 2013
Old 01-05-2014 , 03:51   Re: admin flag a only
Reply With Quote #3

Can u post the code pls kia
OOE is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-05-2014 , 03:56   Re: admin flag a only
Reply With Quote #4

I just did that.
Just put it at the top of your function.
__________________
Kia is offline
OOE
Member
Join Date: Sep 2013
Old 01-05-2014 , 16:20   Re: admin flag a only
Reply With Quote #5

Well you're wrong This is what I want!
PHP Code:
public CmdMainMenu(id

    if(
access(idADMIN_IMMUNITY) )
    {
         
ShowMainMenu(id); 
         return 
PLUGIN_HANDLED
     }


Last edited by OOE; 01-05-2014 at 16:25.
OOE is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-05-2014 , 16:36   AW: Re: admin flag a only
Reply With Quote #6

Quote:
Originally Posted by OOE View Post
Well you're wrong This is what I want!
PHP Code:
public CmdMainMenu(id

    if(
access(idADMIN_IMMUNITY) )
    {
         
ShowMainMenu(id); 
         return 
PLUGIN_HANDLED
     }

My code is doing the same (I just had other Flag).
__________________
Kia is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2014 , 16:49   Re: admin flag a only
Reply With Quote #7

Quote:
Originally Posted by OOE View Post
Well you're wrong This is what I want!
PHP Code:
public CmdMainMenu(id

    if(
access(idADMIN_IMMUNITY) )
    {
         
ShowMainMenu(id); 
         return 
PLUGIN_HANDLED
     }

Unless you use ADMIN_ADMIN or ADMIN_ALL, your code is exactly the same thing but less efficient. So, if there is a chance that you might change it to one of these two flags then your code is the best way to go.
__________________
fysiks is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2014 , 16:50   Re: admin flag a only
Reply With Quote #8

Quote:
Originally Posted by OOE View Post
Well you're wrong This is what I want!
PHP Code:
public CmdMainMenu(id

    if(
access(idADMIN_IMMUNITY) )
    {
         
ShowMainMenu(id); 
         return 
PLUGIN_HANDLED
     }

Unless you use ADMIN_ADMIN or ADMIN_ALL, your code is exactly the same thing. But, if there is a chance that you might change it to one of these two flags then your code is the best way to go.
__________________

Last edited by fysiks; 01-05-2014 at 16:51.
fysiks is offline
OOE
Member
Join Date: Sep 2013
Old 01-05-2014 , 18:21   Re: admin flag a only
Reply With Quote #9

i just tryed kias code and it doenst worked and this one works, so fysiks can u post the code with the best way pls?
OOE is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2014 , 18:34   Re: admin flag a only
Reply With Quote #10

If you code works, then use it. I never said it was bad. access() is generally used when the flag being used is unknown at compile time.
__________________
fysiks 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 20:28.


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