Need help whit Weapon Select

I need help to fix my plugin it's my first so not so good scripted. its are some errors.

Hope you can help.






PHP Code:







/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Weapon select"
#define VERSION "1.0"
#define AUTHOR "mYmN"

new Menu
new menu;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd "say /gun""CmdShowGun" )
    
register_clcmd "say_team /gun",&n bsp;"CmdShowGun" )
}
public 
CmdShowGun ()
{
    
Menu menu_create("\r Weapon Select By mYmN""MenuHandler");
    
    
menu_additem(menu"\y Ak47""1"0);
    
menu_additem(menu"\w M4A1""2"0);
    
//menu_addblank ( menu, 0);
    
menu_additem( menu"\w Deagle""3"0);
}
public 
MenuHandler(iPlayermenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new&nbs p;
accesscallback;
    
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            
Ak_Men u(id);
        }
        case 
2:
        {
            
M4A1_Menu(id);
        }
        case 
3:
        {
            
Deagle_Menu(id);
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_H ANDLED;
}
public 
Ak_Menu(idiMenuiItem)
{
    if( 
iIte, == MENU_EXIT
    
{
        
menu_destroy
    
}
    
    new 
iData[6], iName[64], iAccessiCallback;
    
menu_item_getinfo(iMenuiItemiAccessiData,&nb sp;charsmax(iData), iNamecharsmax(iName), iCallback);
    switch( 
str_to_num(iData) )
    {
        case 
1:
        {
            if(
user_has_weapon(idCSW_AK47) )
            {
                
cs_set_uset_bpammo(idCSW_AK4790);
            }
            else
            {
                
cs_set_weapon_ammogive_itemid"weapon_ak47"), 30);
            }
        }
    }
}

public 
M4A1_Menu(idiMenuiItem)
{
   &nb sp;if( 
iItem == MENU_EXIT )
    {
        
menu_destroy(iMenu);
    }
    
    new 
iData[6], iName[64], iAccessiCallback;
    
menu_item_getinfo(iMenuiItemiAccessiDatacharsmax(iData), iNamecharsmax(iName), 
iCallback);
    switch( 
str_to_num(iData) )
    {
        case 
1:
        {
            if(
user_has_weapon(idCSW_M4A1) )
            {
                
cs_set_uset_bpammo(idCSW_M4A190);
            }
    &n bsp;       else
            {
                
cs_set_weapon_ammogive_itemid"weapon_m4a1"), 30);
            }
        }
    }
}

public 
Deagle_Menu(idiMenuiItem)
{
    if( 
iIte, == MENU_EXIT
    
{
       &nbs p;
menu_destroy
    
}
    
    new 
iData[6], iName[64], iAccessiCallback;
    
menu_item_getinfo(iMenuiItemiAccessiDatacharsmax(iData), iNamecharsmax(iName), iCallback);
    switch( 
str_to_num(iData) )
    {
   ;      case 
1:
        {
            if(
user_has_weapon(idCSW_DEAGLE) )
            {
                
cs_set_uset_bpammo(idCSW_DEAGLE90);
            }
            else
            {
              ;   
cs_set_weapon_ammogive_itemid"weapon_deagle"), 7);
            }
        }
    }












Orignal From: Need help whit Weapon Select

No comments

Not a single link is allowed to submit in comment :o