AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Press N get menu (https://forums.alliedmods.net/showthread.php?t=228667)

asdfdsdf 10-24-2013 16:24

Press N get menu
 
Hello i saw somewhere on a server when i pressed n (nightvision) a menu pops up with i would also like to have that in my plugin but im noob in coding if anyone can help me if its possible ofcourse grtz heres the code

PHP Code:

#include <amxmodx>


new g_szTitle[] = "JailBreak Menu";
 
public 
plugin_init()
{

             
register_plugin("JbMenu""1.1""asdfdsdf");
             
register_clcmd("say /jbmenu""ShowMenu"_"");
        
         
    
       
}
public 
ShowMenu(id)
{
       
         new 
iNum
         
         
new iMinutes
         
         
new CurrentMap[33]
         
        new 
szMenuTitle[150]
         
        
iMinutes get_timeleft( ) / 60
         
// gets the amount of players on server and saves it into iNum
        
iNum get_playersnum( )
         
         
get_mapname(CurrentMapcharsmax(CurrentMap));
         
        
formatex(szMenuTitlecharsmax(szMenuTitle), "\r\y%s^n\rCurrent Map:\w%s^n\w%d \yPlayers Online\r| \w%d \yMinutes left\r| \yYou have \w%i$\yJbCash",g_szTitleCurrentMapiNumiMinutes);
        new 
menu menu_create(szMenuTitle"Jb_Menu");
         
         
        
menu_additem(menu"VIP Menu"""0); // case 0
        
menu_additem(menu"JbShop"""0); // case 1
        
menu_additem(menu"Achievements"""0); // case 2
        
menu_additem(menu"Playtime"""0); // case 3
        
menu_additem(menu"CashTop"""0); // case 4
        
menu_additem(menu"Rules"""0); // case 5
        
menu_additem(menu"Change Team"""0); // case 6
        
 
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
        
menu_display(idmenu0);
 
        return 
PLUGIN_HANDLED;
}
public 
Jb_Menu(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"say /menu")
                        
client_print(idprint_chat"You have selected the VIP Menu");
                }
                case 
1:
                {
                        
client_cmd(id"say /jbshop")
                        
client_print(idprint_chat"You have selected The JailBreakShop");
                }
                case 
2:
                {
                        
client_cmd(id"say /ac")
                        
client_print(idprint_chat"You have selected The Achievements Menu");
                }
                case 
3:
                {
                        
client_cmd(id"say /playtime")
                        
client_print(idprint_chat"You have selected Playtime Menu");
                }
                case 
4:
                {
                        
client_cmd(id"say /cashtop")
                        
client_print(idprint_chat"You have selected Cashtop");
                }
                case 
5:
                {
                        
client_cmd(id"say /rules")
                        
client_print(idprint_chat"You have selected Rules");
                }
           case 
6:
           {
           
show_menu_team(id)
           }
        }
 
        
menu_destroy(menu);
 
        return 
PLUGIN_HANDLED;



alan_el_more 10-24-2013 16:59

Re: Press N get menu
 
PHP Code:

register_clcmd "nightvision" "ShowMenu"


asdfdsdf 10-25-2013 07:05

Re: Press N get menu
 
it doesnt work i tried it already also +nightvision

alan_el_more 10-25-2013 08:06

Re: Press N get menu
 
I've tested and it works
Post amx_plugins results

asdfdsdf 10-25-2013 13:02

Re: Press N get menu
 
Damn cool man it works ty very much it wasnt working on one of my testserver dunno why but on my other server it works fine thx mate

tonykaram1993 10-25-2013 13:24

Re: Press N get menu
 
Quote:

Originally Posted by alan_el_more (Post 2052691)
I've tested and it works
Post amx_plugins results

And the code you used.

wTf. 10-26-2013 06:09

Re: Press N get menu
 
well, press m button?

Blizzard_87 10-26-2013 06:33

Re: Press N get menu
 
Quote:

Originally Posted by wTf. (Post 2053072)
well, press m button?

Code:
 register_clcmd( "chooseteam" , "function" );


All times are GMT -4. The time now is 23:15.

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