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.
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(PLUGIN, VERSION, AUTHOR)
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(iPlayer, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new&nbs p;access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
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(id, iMenu, iItem)
{
if( iIte, == MENU_EXIT
{
menu_destroy
}
new iData[6], iName[64], iAccess, iCallback;
menu_item_getinfo(iMenu, iItem, iAccess, iData,&nb sp;charsmax(iData), iName, charsmax(iName), iCallback);
switch( str_to_num(iData) )
{
case 1:
{
if(user_has_weapon(id, CSW_AK47) )
{
cs_set_uset_bpammo(id, CSW_AK47, 90);
}
else
{
cs_set_weapon_ammo[ give_item( id, "weapon_ak47"), 30);
}
}
}
}
public M4A1_Menu(id, iMenu, iItem)
{
&nb sp;if( iItem == MENU_EXIT )
{
menu_destroy(iMenu);
}
new iData[6], iName[64], iAccess, iCallback;
menu_item_getinfo(iMenu, iItem, iAccess, iData, charsmax(iData), iName, charsmax(iName), iCallback);
switch( str_to_num(iData) )
{
case 1:
{
if(user_has_weapon(id, CSW_M4A1) )
{
cs_set_uset_bpammo(id, CSW_M4A1, 90);
}
&n bsp; else
{
cs_set_weapon_ammo[ give_item( id, "weapon_m4a1"), 30);
}
}
}
}
public Deagle_Menu(id, iMenu, iItem)
{
if( iIte, == MENU_EXIT
{
&nbs p;menu_destroy
}
new iData[6], iName[64], iAccess, iCallback;
menu_item_getinfo(iMenu, iItem, iAccess, iData, charsmax(iData), iName, charsmax(iName), iCallback);
switch( str_to_num(iData) )
{
  ; case 1:
{
if(user_has_weapon(id, CSW_DEAGLE) )
{
cs_set_uset_bpammo(id, CSW_DEAGLE, 90);
}
else
{
  ; cs_set_weapon_ammo[ give_item( id, "weapon_deagle"), 7);
}
}
}
}
Orignal From: Need help whit Weapon Select
Post a Comment