Raised This Month: $ Target: $400
 0% 

Press N get menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 10-24-2013 , 16:24   Press N get menu
Reply With Quote #1

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;

asdfdsdf is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-24-2013 , 16:59   Re: Press N get menu
Reply With Quote #2

PHP Code:
register_clcmd "nightvision" "ShowMenu"
__________________
alan_el_more is offline
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 10-25-2013 , 07:05   Re: Press N get menu
Reply With Quote #3

it doesnt work i tried it already also +nightvision
asdfdsdf is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-25-2013 , 08:06   Re: Press N get menu
Reply With Quote #4

I've tested and it works
Post amx_plugins results
__________________
alan_el_more is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 10-25-2013 , 13:24   Re: Press N get menu
Reply With Quote #5

Quote:
Originally Posted by alan_el_more View Post
I've tested and it works
Post amx_plugins results
And the code you used.
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]
tonykaram1993 is offline
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 10-25-2013 , 13:02   Re: Press N get menu
Reply With Quote #6

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
asdfdsdf is offline
wTf.
Senior Member
Join Date: Aug 2011
Location: This important?
Old 10-26-2013 , 06:09   Re: Press N get menu
Reply With Quote #7

well, press m button?
wTf. is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 10-26-2013 , 06:33   Re: Press N get menu
Reply With Quote #8

Quote:
Originally Posted by wTf. View Post
well, press m button?
Code:
 register_clcmd( "chooseteam" , "function" );
__________________
Blizzard_87 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 23:15.


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