AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to Built Menu (https://forums.alliedmods.net/showthread.php?t=108408)

GIGS 11-05-2009 00:48

How to Built Menu
 
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

Arkshine 11-05-2009 04:15

Re: How to Built Menu
 
Search, you have tutos here : http://forums.alliedmods.net/forumdisplay.php?f=83

GIGS 11-05-2009 07:24

Re: How to Built Menu
 
pleaseeeee can u make for me as i m very bad @scripting.please:|

izzle 11-05-2009 08:00

Re: How to Built Menu
 
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;



GIGS 11-05-2009 12:18

Re: How to Built Menu
 
yeah it compiles fyn but whr i have to add models
is it cstrike\models\player\osama\osama.mdl
and how to precache

GIGS 11-05-2009 12:22

Re: How to Built Menu
 
Quote:

Originally Posted by izzle (Post 981422)
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!!!

Exolent[jNr] 11-05-2009 12:40

Re: How to Built Menu
 
Code:
public buyarmo(id)
:arrow:
Code:
public menu(id)

GIGS 11-05-2009 13:54

Re: How to Built Menu
 
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

xPaw 11-05-2009 14:16

Re: How to Built Menu
 
Quote:

Originally Posted by GIGS (Post 981692)
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

GIGS 11-05-2009 14:26

Re: How to Built Menu
 
Sorry for that !!! but now can u help me .....please____


All times are GMT -4. The time now is 17:43.

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