AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin access (https://forums.alliedmods.net/showthread.php?t=135287)

ekenn123 08-14-2010 15:46

Admin access
 
Hello! I could use a hand.

I need help to add "vip/admin access" to my plugin(not scripted by me entirely) so when people want to bring the menu up they need to have like "be" access or something :) Let's say they type /shop, then only the people who have "be" access gets the menu.

I hope you understood! Thanks :P

naven 08-14-2010 16:31

Re: Admin access
 
PHP Code:

if(get_user_flags(id) == ADMIN_IMMUNITY


ekenn123 08-14-2010 16:32

Re: Admin access
 
Quote:

Originally Posted by N A V E N (Post 1270864)
PHP Code:

if(get_user_flags(id) == ADMIN_IMMUNITY


Where should I put this? more of a tutorial please :)

platzpatrone 08-14-2010 17:14

Re: Admin access
 
in plugin_init() u put something like this:

PHP Code:

register_clcmd("say /shop","openShopMenu",ADMIN_SLAY,"Vip Menu"); 

and in your openShopMenu

PHP Code:

public openShopMenu(id,lvl,cid)
{
    if(!
cmd_access(id,lvl,cid,1))
        return 
PLUGIN_HANDLED;

    
//your code here


is this needed.

every ADMIN with the flag "e" = slay or slap, have access to this menu

ekenn123 08-14-2010 17:17

Re: Admin access
 
Quote:

Originally Posted by platzpatrone (Post 1270887)
in plugin_init() u can put something like this:

PHP Code:

register_clcmd("say /shop","openShopMenu",ADMIN_SLAY,"Vip Menu"); 

every ADMIN with the flag "e" = slay or slap, have access to this menu

thanks :)

platzpatrone 08-14-2010 17:21

Re: Admin access
 
read my post again, i forgot to add the check :)

ekenn123 08-14-2010 17:28

Re: Admin access
 
Quote:

Originally Posted by platzpatrone (Post 1270893)
read my post again, i forgot to add the check :)

thats why it had no function lol, but hm.. I don't want my VIP's able to slay people :( Isn't there anything else thats make em unique only.. like a small function they can do? Just to make them different from the rest :P

My plan was to make a shop for VIP's so they can buy AWP/Deagle in HnS, then I was planning to add so you can buy VIP for XP :P

Vechta 08-14-2010 17:54

Re: Admin access
 
Quote:

Originally Posted by N A V E N (Post 1270864)
PHP Code:

if(get_user_flags(id) == ADMIN_IMMUNITY


Code:

if(get_user_flags(id) & ADMIN_IMMUNITY)

platzpatrone 08-14-2010 18:04

Re: Admin access
 
Quote:

Originally Posted by ekenn123 (Post 1270899)
thats why it had no function lol, but hm.. I don't want my VIP's able to slay people :( Isn't there anything else thats make em unique only.. like a small function they can do? Just to make them different from the rest :P

My plan was to make a shop for VIP's so they can buy AWP/Deagle in HnS, then I was planning to add so you can buy VIP for XP :P

then still get them instead of ADMIN_SLAY the ADMIN_LEVEL_H (flag -> t) or something else

ekenn123 08-14-2010 18:12

Re: Admin access
 
Quote:

Originally Posted by platzpatrone (Post 1270934)
then still get them instead of ADMIN_SLAY the ADMIN_LEVEL_H (flag -> t) or something else

What does T ?


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

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