Raised This Month: $ Target: $400
 0% 

How to Built Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GIGS
BANNED
Join Date: Nov 2009
Old 11-05-2009 , 00:48   How to Built Menu
Reply With Quote #1

Hello Genius,
Can u help me 2 built menu..when clients do /menu than one menu appears in their

MENU OPENED
1.Give 200 armor for $1000
2.Change my Model To Osama
3.Give me Ak-47
4.Change my model to Gurilla
7.Close

Models r pre-cache
And as soon as players select their guns or models..they r changed
GIGS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-05-2009 , 04:15   Re: How to Built Menu
Reply With Quote #2

Search, you have tutos here : http://forums.alliedmods.net/forumdisplay.php?f=83
__________________
Arkshine is offline
GIGS
BANNED
Join Date: Nov 2009
Old 11-05-2009 , 07:24   Re: How to Built Menu
Reply With Quote #3

pleaseeeee can u make for me as i m very bad @scripting.please
GIGS is offline
izzle
Senior Member
Join Date: Aug 2009
Old 11-05-2009 , 08:00   Re: How to Built Menu
Reply With Quote #4

wrong section

edit: try this
PHP Code:
#include <amxmodx> 
#include <cstrike>
#include <fun>

public plugin_init() 

    
register_clcmd"say /menu","menu"); 

public 
buyarmo(id
{
    new 
menu menu_create("Menu:""menu_handler");
    
    
menu_additem(menu"Give 200 armor for $1000""1"0);
    
menu_additem(menu"Change my Model To Osama""2"0);
    
menu_additem(menu"Give me Ak-47""3"0);
    
menu_additem(menu"Change my model to Gurilla""4"0);
    
    
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:
        {
            new 
money cs_get_user_money(id)
            if(
money>=999)
            {
                
cs_set_user_money(idmoney -1000);
                
                if( 
is_user_aliveid ) ) 
                    
cs_set_user_armor(id200CS_ARMOR_VESTHELM
                
                
client_print(idprint_chat"You bought 200 armor for $1000!");
            }
            
        }
        case 
2:
        {
            
cs_set_user_model id"obama" )
            
client_print(idprint_chat"You are now obama!");
        }
        case 
3
        {
            if( 
is_user_aliveid ) ) 
                
give_item(id"weapon_ak47")
            
client_print(idprint_chat"You now have an ak-47!");
        }
        case 
4
        {
            
cs_set_user_model id"guerilla" )
            
client_print(idprint_chat"You are now guerilla!");
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

__________________

Last edited by izzle; 11-05-2009 at 08:14.
izzle is offline
GIGS
BANNED
Join Date: Nov 2009
Old 11-05-2009 , 12:18   Re: How to Built Menu
Reply With Quote #5

yeah it compiles fyn but whr i have to add models
is it cstrike\models\player\osama\osama.mdl
and how to precache
GIGS is offline
GIGS
BANNED
Join Date: Nov 2009
Old 11-05-2009 , 12:22   Re: How to Built Menu
Reply With Quote #6

Quote:
Originally Posted by izzle View Post
wrong section

edit: try this
PHP Code:
#include <amxmodx> 
#include <cstrike>
#include <fun>

public plugin_init() 

    
register_clcmd"say /menu","menu"); 

public 
buyarmo(id
{
    new 
menu menu_create("Menu:""menu_handler");
    
    
menu_additem(menu"Give 200 armor for $1000""1"0);
    
menu_additem(menu"Change my Model To Osama""2"0);
    
menu_additem(menu"Give me Ak-47""3"0);
    
menu_additem(menu"Change my model to Gurilla""4"0);
    
    
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:
        {
            new 
money cs_get_user_money(id)
            if(
money>=999)
            {
                
cs_set_user_money(idmoney -1000);
                
                if( 
is_user_aliveid ) ) 
                    
cs_set_user_armor(id200CS_ARMOR_VESTHELM
                
                
client_print(idprint_chat"You bought 200 armor for $1000!");
            }
            
        }
        case 
2:
        {
            
cs_set_user_model id"obama" )
            
client_print(idprint_chat"You are now obama!");
        }
        case 
3
        {
            if( 
is_user_aliveid ) ) 
                
give_item(id"weapon_ak47")
            
client_print(idprint_chat"You now have an ak-47!");
        }
        case 
4
        {
            
cs_set_user_model id"guerilla" )
            
client_print(idprint_chat"You are now guerilla!");
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

Menu is opening..when i typed /menu nothing appears as menu.can you re-check it!!!
GIGS is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-05-2009 , 12:40   Re: How to Built Menu
Reply With Quote #7

Code:
public buyarmo(id)

Code:
public menu(id)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
GIGS
BANNED
Join Date: Nov 2009
Old 11-05-2009 , 13:54   Re: How to Built Menu
Reply With Quote #8

thanks,,it worked but 1 main thing is left.i 4get to mention it previous.
i want 2 menus to be built i for CT and other for T

when ct players type /menu than menu1 opens
when t players type /menu than menu2 opens
GIGS is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-05-2009 , 14:16   Re: How to Built Menu
Reply With Quote #9

Quote:
Originally Posted by GIGS View Post
when ct players type /menu than menu1 opens
when t players type /menu than menu2 opens
Why don't you ask that before someone does the code... Also you're in scripting help.. You need to go in requests section
__________________
xPaw is offline
GIGS
BANNED
Join Date: Nov 2009
Old 11-05-2009 , 14:44   Re: How to Built Menu
Reply With Quote #10

PHP Code:
#include <amxmodx>  
#include <cstrike> 
#include <fun> 

public plugin_init()  
{  
    
register_clcmd"say /menu","menu");  
}  
public 
buyarmo(id)  

    new 
menu menu_create("Menu:""menu_handler"); 
     
    
menu_additem(menu"Give 200 armor for $1000""1"0); 
    
menu_additem(menu"Change my Model To Osama""2"0); 
    
menu_additem(menu"Give me Ak-47""3"0); 
    
menu_additem(menu"Change my model to Gurilla""4"0); 
     
    
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
        { 
            new 
money cs_get_user_money(id
            if(
money>=999
            { 
                
cs_set_user_money(idmoney -1000); 
                 
                if( 
is_user_aliveid ) )  
                    
cs_set_user_armor(id200CS_ARMOR_VESTHELM)  
                 
                
client_print(idprint_chat"You bought 200 armor for $1000!"); 
            } 
             
        } 
        case 
2
        { 
            
cs_set_user_model id"obama" 
            
client_print(idprint_chat"You are now obama!"); 
        } 
        case 
3:  
        { 
            if( 
is_user_aliveid ) )  
                
give_item(id"weapon_ak47"
            
client_print(idprint_chat"You now have an ak-47!"); 
        } 
        case 
4:  
        { 
            
cs_set_user_model id"guerilla" 
            
client_print(idprint_chat"You are now guerilla!"); 
        } 
    } 
     
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED


Last edited by GIGS; 11-05-2009 at 15:43.
GIGS 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 17:43.


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