AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon Menu Problem (https://forums.alliedmods.net/showthread.php?t=140566)

FragOwn 10-14-2010 02:08

Weapon Menu Problem
 
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <fun>

#define PLUGIN    "Weapon Menu"
#define AUTHOR    "??"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /weapon","cmdWeaponMenu");
}
public 
cmdWeaponMenu(id)
{
    new 
menu menu_create("\rSelect your Weapon""menu_handler");
    
menu_additem(menu"Golden Ak47""\y1"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:  
        {  
                
client_cmd(id"say /buy_ak")
                
client_print(idprint_chat"You've just bought a Golden AK."
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;


When I press 1, the say /buy_ak didn't showed up. What's the problem? :s

Exolent[jNr] 10-14-2010 03:28

Re: Weapon Menu Problem
 
PHP Code:

    menu_additem(menu"Golden Ak47""\y1"0); 

That won't change the menu color for the numbers, and it is what is causing your problem.
Remove the color from that and it will work.


All times are GMT -4. The time now is 10:21.

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