Code:
// Menu - Basics
#define M3MULT 3 // damage multiplier for M3 # admin only.
#include <superheromod>
new const itemcost[6] = { 4000, 4000, 4500, 6000, 6000, 0 }
new bool:extradmg[SH_MAXSLOTS+1];
public plugin_init()
{
register_plugin("WeaponMenu", "1.0", "RB");
register_clcmd("say /buy", "cmd_menu");
register_clcmd("say_team /buy", "cmd_menu");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (victim == attacker || !is_user_connected(attacker)) // non-player damage or self damage
return HAM_IGNORED;
if ( extradmg[attacker] ) SetHamParamFloat(4, damage * M3MULT); //basic dmg multiplier
return HAM_IGNORED;
}
/*======================================================================
DAMAGE MULT OPTIONS
======================================================================*/
public client_disconnect(id)
extradmg[id] = false;
// if the damage mult should dissapear upon the player's death then uncomment this function
public sh_client_death(victim, attacker, headshot, const wpnDescription[])
extradmg[victim] = false;
/* if the damage mult should only last 1 round then uncomment this function
public sh_round_new()
arrayset(extradmg, false, SH_MAXSLOTS+1);
*/
/*======================================================================
DAMAGE MULT OPTIONS
======================================================================*/
public cmd_menu(id)
{
if ( is_user_alive(id) )
{
new menu = menu_create("Choose Your Weapon Set", "menu_handler");
menu_additem(menu, "/yBuy M4A1 + HE", "0", 0);
menu_additem(menu, "/yBuy AK47 + HE", "1", 0);
menu_additem(menu, "/yBuy AWP + Kevlar", "2", 0);
menu_additem(menu, "/yBuy M249 + Deagle/Flash", "3", 0);
menu_additem(menu, "/yBuy CSW_G3SG1", "4", 0);
new buffer[15]; //allows us to format the color based on admin or not
formatex(buffer, charsmax(buffer), "%sBuy Super M3", (get_user_flags(id) & ADMIN_ADMIN) ? "/y" : "/w");
menu_additem(menu, buffer, "5")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
} else client_print(id, print_chat, "[AMXX] You Have To Be Alive To Use The Menu.");
}
public menu_handler(id, menu, item)
{
if ( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[2], acces, callback, key;
menu_item_getinfo(menu, item, acces, data, 1, _, _, callback);
key = str_to_num(data);
if ( 0 < key < 6 )
{
new usermoney; usermoney = cs_get_user_money(id);
new cost; cost = itemcost[key];
if ( usermoney >= cost )
{
cs_set_user_money(id, usermoney - cost, 1);
if ( key == 6 ) client_print(id, print_chat, "[AMXX] Bought Super M3");
else client_print(id, print_chat, "[AMXX] Bought Weapon Set %i", key+1);
switch(key)
{
case 0: // M4A1 + HE
{
sh_give_weapon(id, CSW_M4A1, true);
sh_give_weapon(id, CSW_HEGRENADE);
}
case 1: // AK47 + HE
{
sh_give_weapon(id, CSW_AK47, true);
sh_give_weapon(id, CSW_HEGRENADE);
}
case 2: // AWP + Kevlar
{
sh_give_weapon(id, CSW_AWP, true);
set_user_armor(id, 100);
}
case 3: // M249 + Deagle/Flash
{
sh_give_weapon(id, CSW_M249, true);
sh_give_weapon(id, CSW_DEAGLE);
sh_give_weapon(id, CSW_FLASHBANG);
}
case 4: sh_give_weapon(id, CSW_G3SG1, true); // G3SG1
case 5: // The Super Shotgun(ADMIN)
{
if ( !(get_user_flags(id) & ADMIN_ADMIN) )
{
menu_destroy(menu);
cmd_menu(id);
return PLUGIN_HANDLED;
}
sh_give_weapon(id, CSW_M3, true);
extradmg[id] = true;
}
}
} else client_print(id, print_chat, "[AMXX] You Don't Have Enough Money(You Cheap Bastard)");
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
Edited: Accidently said that you get smoke but you get a flash so changed to flash!!
uncomment the function to lose dmg mult on death......
made a notification for players about the damage mult options....
when did i say i made a static one???? this one i dynamic lol.....