Raised This Month: $ Target: $400
 0% 

Solved [Help] Need to improve Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-23-2018 , 21:09   Re: [Help] Need to improve Menu
Reply With Quote #1

PHP Code:
// Generated with v3x's AMXX Menu Generator

#include <amxmodx>
#include <cstrike>
#include <fun>

new bool:gCanBuy
new gBuyTime
public plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("say /menu""ShowMenu"_"");
    
gBuyTime get_cvar_pointer("mp_buytime")
    
register_event("HLTV","EventNewRnd""a""1=0""2=0")
}

public 
ShowMenu(id)
{
    new 
menu menu_create("SUPER GAMING MENU""MENU");

    
menu_additem(menu"Armor """0); // case 0
    
menu_additem(menu"Hegrenade 1"""0); // case 1
    
menu_additem(menu"Flash 1"""0); // case 2
    
menu_additem(menu"Extra Money +800$"""0); // case 3
    
menu_additem(menu"Extra Ammo  Primary + Secondary"""0); // case 4
    
menu_additem(menu""""0); // case 5

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_setprop(menuMPROP_PERPAGE5);
    
menu_setprop(menuMPROP_NOCOLORS1);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

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

    if(
gBuyTime && gCanBuy)
    {
        new 
command[6], name[64], accesscallback;
    
        
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
        switch(
item)
        {
            case 
0
            {
                
client_print(idprint_chat"You have selected Armor ");
                
cs_set_user_armor(id100CS_ARMOR_VESTHELM)
            }
            case 
1
            {
                
client_print(idprint_chat"You have selected Hegrenade 1");
                
give_item(id"weapon_hegrenade"
            }
            case 
2:
            {
                
client_print(idprint_chat"You have selected Flash 1");
                
give_item(id"weapon_flashbang"
            }
            case 
3:
            {
                
client_print(idprint_chat"You have selected Extra Money +800$");
                
cs_set_user_money(id,(cs_get_user_money(id) + 800))
            }
            case 
4
            {
                
client_print(idprint_chat"You have selected Extra Ammo  Primary + Secondary");
            }
            case 
5:
            {
                
client_print(idprint_chat"You have selected ");
            }
        }
    
        
menu_destroy(menu);
        
gCanBuy false
    
        
return PLUGIN_HANDLED;
    }
    
client_print(idprint_chat"Purchase time is over or you have already purchased in this round.")
    return 
PLUGIN_HANDLED;
}

public 
EventNewRnd()
    
gCanBuy true 
iceeedr is offline
Send a message via Skype™ to iceeedr
anash
Junior Member
Join Date: May 2018
Old 05-23-2018 , 23:04   Re: [Help] Need to improve Menu
Reply With Quote #2

Bro , Thank you very much
anash 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 04:43.


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