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

New AMXX Menu System


Post New Thread Reply   
 
Thread Tools Display Modes
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 01-22-2010 , 08:50   Re: New AMXX Menu System
Reply With Quote #171

Hello,
I want, that this menu will be able to open only for admins with defined flag (ban) when they type /openmenu and only one time in a round. If admin has opened the menu and used something from it he will have to wait next round to use it again.

PHP Code:
#include < amxmodx >

#define PLUGIN    "Admins Menu"
#define AUTHOR    "spiN-"
#define VERSION    "0.1"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd"/openmenu","AwesomeMenu");


public 
AwesomeMenu(id)
{
    new 
menu menu_create("\rAdmin Meniu:""menu_handler");
    
    
menu_additem(menu"\wI'm Selection #1""1"0);
    
menu_additem(menu"\wI'm Selection #2""2"0);
    
menu_additem(menu"\wI'm Secret Selection #3""3"ADMIN_ADMIN);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);


public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
client_print(idprint_chat"Hooray! You selected the Awesome 1st Selection");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
2:
        {
            
client_print(idprint_chat"OH NO! You selected the Awesome 2nd Selection! BEWARE!");
        }
        case 
3:
        {
            
client_print(idprint_chat"You have selected the Awesome Admin Selection! Hail Teh Bail!");
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
spiN- is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 01-22-2010 , 10:51   Re: New AMXX Menu System
Reply With Quote #172

Try it also in the scripting section, would be better!
KadiR is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-03-2010 , 04:59   Re: New AMXX Menu System
Reply With Quote #173

Code:
public StartVote(id)
{
    //If there is already a vote, don't start another
    if( gVoting )
    {
        client_print(id, print_chat, "There is already a vote going.");
        //We return PLUGIN_HANDLED so the person does not get Unknown Command in console
        return PLUGIN_HANDLED;
    }
    
    //Store the menu in the global
    gVoteMenu = menu_create("\rLook at this Vote Menu!:", "menu_handler");
    
    //Add some vote options
    menu_additem(gVoteMenu, "Vote Option 1", "0", 0);
    menu_additem(gVoteMenu, "Vote Option 2", "1", 0);
    
    //We will need to create some variables so we can loop through all the players
    new players[32], pnum, tempid;
    
    //Fill players with available players
    get_players(players, pnum);
    
    //Start looping through all players to show the vote to
    for( new i; i<pnum; i++ )
    {
        //Save a tempid so we do not re-index
        tempid = players[i];
        
        //Show the vote to this player
        menu_display(tempid, menu, 0);
        
        //Increase how many players are voting
        gVoting++;
    }
    
    //End the vote in 10 seconds
    set_task(10.0, "EndVote");
    
    return PLUGIN_HANDLED;
}
---->

Code:
menu_display(tempid, gVoteMenu, 0);
please change it emp
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 02-12-2010 , 15:23   Re: New AMXX Menu System
Reply With Quote #174

yo
not sure if its possible but can i remove "Back" and "More"?
if i have 9 items, it shouldnt need a second page but it puts it on anyway =[

essentially, what i want to do is have 3 menus each with 1-9 items
i will register_clcmd("say /menu", "cmdMenu", -1); which will increase giMenu[id], then show_menu(id, giMenu[id]);
therefore i will not need "More" and "back"
__________________
minimiller is offline
Send a message via MSN to minimiller
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 02-12-2010 , 16:52   Re: New AMXX Menu System
Reply With Quote #175

Quote:
Originally Posted by minimiller View Post
yo
not sure if its possible but can i remove "Back" and "More"?
if i have 9 items, it shouldnt need a second page but it puts it on anyway =[

essentially, what i want to do is have 3 menus each with 1-9 items
i will register_clcmd("say /menu", "cmdMenu", -1); which will increase giMenu[id], then show_menu(id, giMenu[id]);
therefore i will not need "More" and "back"
Setting MPROP_PERPAGE to zero sets paginating off.
SnoW is offline
Send a message via MSN to SnoW
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 02-12-2010 , 17:14   Re: New AMXX Menu System
Reply With Quote #176

Quote:
Originally Posted by SnoW View Post
Setting MPROP_PERPAGE to zero sets paginating off.
thx <3
+karma
...oh wait

EDIT:
On further testing, it seems setting it to 0 gets rid of the pages completely so things like menu_pages(giMenu); doesnt return proper values =[
Ill just leave the next/back options till i can figure out another way of doing it
__________________

Last edited by minimiller; 02-12-2010 at 17:30.
minimiller is offline
Send a message via MSN to minimiller
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-12-2010 , 17:55   Re: New AMXX Menu System
Reply With Quote #177

Quote:
Originally Posted by minimiller View Post
thx <3
+karma
...oh wait

EDIT:
On further testing, it seems setting it to 0 gets rid of the pages completely so things like menu_pages(giMenu); doesnt return proper values =[
Ill just leave the next/back options till i can figure out another way of doing it
Why would you need the function menu_pages() if you are making menus with no pages?
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-12-2010 , 18:06   Re: New AMXX Menu System
Reply With Quote #178

Just use old-style menus and you can customize it however you want.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 02-12-2010 , 18:39   Re: New AMXX Menu System
Reply With Quote #179

Quote:
Originally Posted by fysiks View Post
Why would you need the function menu_pages() if you are making menus with no pages?
i am using pages, i just dont want the next/back parts

Quote:
Originally Posted by Exolent[jNr] View Post
Just use old-style menus and you can customize it however you want.
i did used to use old menus but i thought new menus were easier for what i was trying to do

obviously i was wrong =[
Ctrl + z x 1,000,000 for me


thx guys
__________________
minimiller is offline
Send a message via MSN to minimiller
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-12-2010 , 18:50   Re: New AMXX Menu System
Reply With Quote #180

Quote:
Originally Posted by minimiller View Post
essentially, what i want to do is have 3 menus each with 1-9 items
i will register_clcmd("say /menu", "cmdMenu", -1); which will increase giMenu[id], then show_menu(id, giMenu[id]);
therefore i will not need "More" and "back"
According to this you are doing your "pages" manually. You can still do it with new menus but I guess it depends on how you want the "pages" to work.
__________________
fysiks 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 22:55.


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