Raised This Month: $ Target: $400
 0% 

Help with menu .


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Splot
Junior Member
Join Date: Nov 2011
Old 12-21-2011 , 09:05   Help with menu .
Reply With Quote #1

hi everyone,

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    
register_plugin("simplevote""1.0""author")    
    
register_clcmd("say /menu""startmenu")        
}
public 
startmenu(id) {  
    if (
is_user_admin(id)) 
        
set_task(0.1,"themenu"id)
    else 
        
client_print0print_chat"you cant use this command if ur not an admin. ");
}  

public 
themenu(id) { 
    new 
szText555 char ];    
    
    
formatexszTextcharsmaxszText ), "the menu:^n");

    new 
menu menu_createszText"sub_votemenu" );
    
    
formatexszTextcharsmaxszText ), "option #1");
    
menu_additemmenuszText"1");    
    
    
formatexszTextcharsmaxszText ), "option #2");    
    
menu_additemmenuszText"2");
    
    
formatexszTextcharsmaxszText ), "option #3");
    
menu_additemmenuszText"3");
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );    
    
menu_displayidmenu);        
        
    return 
PLUGIN_CONTINUE;
            
}

public 
sub_votemenuidmenuitem ) {            
    if( 
item == MENU_EXIT ) {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ], accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );
    
    new 
menuv str_to_num(data);
    new 
playername[32]
    
get_user_name(idplayername31)    
    
    switch(
menuv) {
        case 
1:client_print0print_chat"%s chose option #1"playername);
        case 
2:client_print0print_chat"%s chose option #2"playername);    
        case 
3:client_print0print_chat"%s chose option #3"playername);
        
    }
    return 
PLUGIN_HANDLED;        

i want to do when the admin type /menu its will open the menu for all players .
how can i do that ?
thx.

Last edited by Splot; 12-21-2011 at 09:08.
Splot is offline
 



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 12:11.


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