why r u starting case from 0 while u have started menu with case 1
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#define PLUGIN "New Shop"
#define VERSION "1.0"
#define AUTHOR "Abdou LLah"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /shop", "shopmenu")
register_clcmd("say_team /shop", "shopmenu")
register_clcmd("say shop", "shopmenu")
register_clcmd("say_team shop", "shopmenu")
register_clcmd("shop", "shopmenu")
}
public shopmenu(id) {
new menu = menu_create ("Shop Menu \yBy \rAbdou LLah","newmenu")
menu_additem (menu,"Special Mode \y(Cant Die) \r(5sec) \y7000 $","0", 0)
menu_additem (menu,"Invisiblity \r(5sec) \y7000 $","1",0)
menu_additem (menu,"Speed \r(5sec) \y7000 $","2",0)
menu_additem (menu,"HE Greande \y6000 $","3",0)
menu_additem (menu,"Flashbang \y2000 $","4",0)
menu_additem (menu,"Smooke Grenade \y9000 $","5",0)
menu_additem (menu,"Respawn \y16000 $","6",0)
menu_additem (menu,"AWP \r(1 Bullet) \y14000 $","7",0)
menu_additem (menu,"Deagle \r(1 Bullet) \y12000 $","8",0)
menu_additem (menu,"Extra Health \y8000 $","9",0)
menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL)
menu_display (id , menu, 0)
}
public newmenu(id, menu, item)
{
new money = cs_get_user_money(id)
switch (item)
{
case 0:
{
if(money >= 7000)
{
Reduce(id, 7000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4Special MOD (5sec) ^1with !t7000 $")
}
else
ChatColor ( id, "^4[Shop Menu]^1^1U need !t7000 $ ^1to buy ^4Special MOD")
}
case 1:
{
if(money >= 7000)
{
Reduce(id, 7000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4INVISIBLITY (5sec) ^1with !t7000 $")
}
else
ChatColor ( id, "^4[Shop Menu]^1^1U need !t7000 $ ^1to buy ^4INVISIBLITY")
}
case 2:
{
if(money >= 5000)
{
Reduce(id, 5000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4SPEED (5sec) ^1with !t5000 $")
}
else
ChatColor ( id, "^4[Shop Menu]^1^1U need !t5000 $ ^1to buy ^4SPPED")
}
case 3:
{
if(money >= 6000)
{
Reduce(id, 6000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4HE Grenade ^1with !t6000 $")
give_item (id, "weapon_hegrenade")
}
else
ChatColor ( id, "^4[Shop Menu]^1U need !t6000 $ ^1to buy ^4HE Greande")
}
case 4:
{
if(money >= 2000)
{
Reduce(id, 2000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4Flashbang ^1with !t2000 $")
give_item (id, "weapon_flashbang")
}
else
ChatColor ( id, "^4[Shop Menu]^1U need !t2000 $ ^1to buy ^4Flashbang")
}
case 5:
{
if(money >= 9000)
{
Reduce(id, 9000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4Smooke Grenade ^1with !t9000 $")
give_item (id, "weapon_smokegrenade")
}
else
ChatColor ( id, "^4[Shop Menu]^1U need !t9000 $ ^1to buy ^4Smooke Grenade")
}
case 6:
{
if(money >= 16000)
{
Reduce(id, 16000)
giveitem_respawn(id)
}
else
ChatColor ( id, "^4[Shop Menu]^1U need !t16000 $ ^1to buy ^4RESPAWN")
}
case 7:
{
if(money >= 14000)
{
Reduce(id, 14000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4AWP ^1with !t14000 $")
give_item (id, "weapon_awp")
}
else
ChatColor ( id, "^4[Shop Menu]^1U need !t14000 $ ^1to buy ^4AWP")
}
case 8:
{
if(money >= 12000)
{
Reduce(id, 12000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4Deagle ^1with !t12000 $")
give_item (id, "weapon_deagle")
}
else
ChatColor ( id, "^4[Shop Menu]^1U need !t12000 $ ^1to buy ^4Deagle")
}
case 9:
{
if(money >= 12000)
{
Reduce(id, 12000)
ChatColor ( id, "^4[Shop Menu]^1U bought ^4Extra Health ^1with !t8000 $")
set_user_health(id, get_user_health(id) + 50)
}
else
ChatColor ( id, "^4[Shop Menu]^1U need !t8000 $ ^1to buy ^4Extra Health")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public giveitem_respawn(id)
{
ExecuteHamB(Ham_CS_RoundRespawn, id)
new szName[33]
get_user_name(id, szName, charsmax(szName))
ChatColor ( id, "^4%s ^1Has bought ^3Respawn!", szName)
}
//STOCKS
stock Reduce(id, amount)
cs_set_user_money(id, cs_get_user_money(id) - amount)
stock ChatColor(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4"); // verde
replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
& please use [CODE] [PHP] when u are putting script or code