Raised This Month: $32 Target: $400
 8% 

Menu Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Yeoo
Junior Member
Join Date: Nov 2020
Old 12-07-2020 , 15:42   Menu Plugin
Reply With Quote #1

I need a menu that won't let me open it again after I've chosen something.

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

public plugin_init()
{
    
register_plugin("My Menu""1.0""Uuy");
    
register_clcmd("say /menu""ShowMenu");
    
register_clcmd("say_team /menu""ShowMenu");
    
}

public 
ShowMenu(id)
{
    new 
menu menu_create("\rMenu""MohammadHlwani");

    
menu_additem(menu"\wDeagle""\y16000"0); // case 0
    
menu_additem(menu"\wAK47""\y100000"1);

    
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 
0:
        {
            
client_cmd(id"amx_deagle")
        }
        case 
1:
        {
            
client_cmd(id"amx_ak47")
        }
    }

    
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 }
*/ 
Something like that, but don't let me open it again. I will add separate plugins with the commands I specified because they are modified weapons.
Yeoo is offline
Old 12-07-2020, 15:52
ho83
This message has been deleted by ho83.
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-07-2020 , 16:10   Re: Menu Plugin
Reply With Quote #2

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

new bool:CanOpen[33]

public 
plugin_init()
{
    
register_plugin("My Menu""1.0""Uuy");
    
register_clcmd("say /menu""ShowMenu");
    
register_clcmd("say_team /menu""ShowMenu");
    
}

public 
client_putinserver(id)
{
    
CanOpen[id] = true
}

public 
ShowMenu(id)
{
    if(!
CanOpen[id]) return PLUGIN_HANDLED

    
new menu menu_create("\rMenu""MohammadHlwani");

    
menu_additem(menu"\wDeagle""\y16000"0); // case 0
    
menu_additem(menu"\wAK47""\y100000"1);

    
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 
0:
        {
            
client_cmd(id"amx_deagle")
        }
        case 
1:
        {
            
client_cmd(id"amx_ak47")
        }
    }

    
CanOpen[id] = false
    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 }
*/ 
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
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 05:39.


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