Raised This Month: $51 Target: $400
 12% 

Solved Menu only for ADMIN_LEVEL_H


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pizzadaking
Member
Join Date: Oct 2019
Old 04-02-2020 , 17:21   Menu only for ADMIN_LEVEL_H
Reply With Quote #1

Need this menu to be accessible only by admins with access : ADMIN_LEVEL_H
Thanks.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <csx>

public plugin_init()
{
    
register_plugin("VIP Menu""1.0""Pizza");
    
register_clcmd("say /vm""ShowMenu");
    
}

public 
ShowMenu(id)
{
    if(
cs_get_user_team(id) == !CS_TEAM_CT) {
        
client_print(idprint_chat"^x01 [^x04 BIBITA ^x01] You need to be alive to enter the shop")
        return 
PLUGIN_HANDLED
    
}
    else {
    new 
menu menu_create("[\rBIBITA\y] VIP  Menu:""MohammadHlwani");

    
menu_additem(menu"\r[\yExtra items\r]"""0); // case 0
    
menu_additem(menu"\r[\yModels Menu\r]"""0); // case 1
    
menu_additem(menu"\r[\yHealth Shop\r]"""0); // case 2
    
menu_additem(menu"\r[\yGlow Menu\r]"""0); // case 3

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}
}

public 
MohammadHlwani(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_cmd(id"say /extra");
        case 
1client_cmd(id"say /models");
        case 
2client_cmd(id"say /hpshop");
        case 
3client_cmd(id"say /glowmenu");
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang10241\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by Pizzadaking; 04-04-2020 at 17:59.
Pizzadaking is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-02-2020 , 18:04   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #2

if(~get_user_flags(id) & ADMIN_LEVEL_H)
return PLUGIN_HANDLED
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 04-02-2020 , 18:47   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #3

also
PHP Code:
    if(cs_get_user_team(id) == !CS_TEAM_CT) {
        
client_print(idprint_chat"^x01 [^x04 BIBITA ^x01] You need to be alive to enter the shop")
        return 
PLUGIN_HANDLED
    

that checks if the player is CT not alive or dead
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Pizzadaking
Member
Join Date: Oct 2019
Old 04-02-2020 , 18:49   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #4

Quote:
Originally Posted by Nutu_ View Post
also
PHP Code:
    if(cs_get_user_team(id) == !CS_TEAM_CT) {
        
client_print(idprint_chat"^x01 [^x04 BIBITA ^x01] You need to be alive to enter the shop")
        return 
PLUGIN_HANDLED
    

that checks if the player is CT not alive or dead
Ik, i changed that now i copied a part of the code from another plugin thats why its like that.
Pizzadaking is offline
Pizzadaking
Member
Join Date: Oct 2019
Old 04-02-2020 , 18:51   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
if(~get_user_flags(id) & ADMIN_LEVEL_H)
return PLUGIN_HANDLED
Can u show me where to put it ? im having a hard time trying to find since i also have puted the
PHP Code:
if(cs_get_user_team(id) == !CS_TEAM_CT
Pizzadaking is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 04-02-2020 , 18:59   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #6

post the new code here, what you've copied from another plugin
do you want this menu to be only for ct or t (alive or dead, or both)?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Pizzadaking
Member
Join Date: Oct 2019
Old 04-02-2020 , 19:14   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #7

Quote:
Originally Posted by Nutu_ View Post
post the new code here, what you've copied from another plugin
do you want this menu to be only for ct or t (alive or dead, or both)?
forget about the new code i just want this plugin (menu) to work only for people with ADMIN_LEVEL_H and only for CT team.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <csx>

public plugin_init()
{
    
register_plugin("VIP Menu""1.0""Pizza");
    
register_clcmd("say /vm""ShowMenu");
     
}

public 
ShowMenu(id)
{
    new 
menu menu_create("[\rBIBITA\y] VIP  Menu:""MohammadHlwani");

    
menu_additem(menu"\r[\yExtra items\r]"""0); // case 0
    
menu_additem(menu"\r[\yModels Menu\r]"""0); // case 1
    
menu_additem(menu"\r[\yHealth Shop\r]"""0); // case 2
    
menu_additem(menu"\r[\yGlow Menu\r]"""0); // case 3

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}
}

public 
MohammadHlwani(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_cmd(id"say /extra");
        case 
1client_cmd(id"say /models");
        case 
2client_cmd(id"say /hpshop");
        case 
3client_cmd(id"say /glowmenu");
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang10241\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by Pizzadaking; 04-02-2020 at 19:26.
Pizzadaking is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-03-2020 , 07:23   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #8

Add the flags check in the beginning of the menu function and stop the function if it's false. It's not that difficult to figure out.
__________________

Last edited by OciXCrom; 04-03-2020 at 07:23.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 04-03-2020 , 12:39   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
Add the flags check in the beginning of the menu function and stop the function if it's false. It's not that difficult to figure out.
also the team check if you want this to be for CT only
since this is Scripting Help section and you've already build that entire plugin as it says at Author, i guess you can handle it alone
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Pizzadaking
Member
Join Date: Oct 2019
Old 04-04-2020 , 17:52   Re: Menu only for ADMIN_LEVEL_H
Reply With Quote #10

Quote:
Originally Posted by Nutu_ View Post
also the team check if you want this to be for CT only
since this is Scripting Help section and you've already build that entire plugin as it says at Author, i guess you can handle it alone
LMFAO i didnt do the entire plugin alone , i just got a simple menu and just changed the name and the client commands :V im not capable of making a plugin on my own yet thats why im searching for help here
Pizzadaking 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 11:51.


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