Raised This Month: $138 Target: $400
 34% 

Knife Shop Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abdou Bn
Junior Member
Join Date: Sep 2019
Old 09-08-2019 , 15:12   Knife Shop Menu
Reply With Quote #1

Hi Im New I have made this plugin but i need some help in some cases u know
this is the 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 $","1", 0)
menu_additem (menu,"Invisiblity \r(5sec) \y7000 $","2",0)
menu_additem (menu,"Speed \r(5sec) \y7000 $","3",0)
menu_additem (menu,"HE Greande \y6000 $","4",0)
menu_additem (menu,"Flashbang \y2000 $","5",0)
menu_additem (menu,"Smooke Grenade \y9000 $","6",0)
menu_additem (menu,"Respawn \y16000 $","7",0)
menu_additem (menu,"AWP \r(1 Bullet) \y14000 $","8",0)
menu_additem (menu,"Deagle \r(1 Bullet) \y12000 $","9",0)
menu_additem (menu,"Extra Health \y8000 $","10",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();
}
}
}
}
Abdou Bn is offline
thEsp
Veteran Member
Join Date: Aug 2017
Location: Gjilan, Albania
Old 09-08-2019 , 15:21   Re: Knife Shop Menu
Reply With Quote #2

Hmmm
__________________
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-08-2019 , 17:23   Re: Knife Shop Menu
Reply With Quote #3

We'll talk again after you put the code in [code] tags and when you tell us what you actually need.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Some Where On Earth
Old 09-08-2019 , 19:42   Re: Knife Shop Menu
Reply With Quote #4

Put plugin in [PHP] or [Pawn] & what help you need? Please specify & I think appropriate section for this would have been a scripting help, since its not any suggestion/request and you yourself are scripter too.
__________________

Last edited by Alber9091; 09-09-2019 at 21:18.
Alber9091 is offline
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 09-09-2019 , 08:24   Re: Knife Shop Menu
Reply With Quote #5

why r u starting case from 0 while u have started menu with case 1
PHP Code:
menu_additem (menu,"Special Mode \y(Cant Die) \r(5sec) \y7000 $","1"0
>>
PHP Code:
menu_additem (menu,"Special Mode \y(Cant Die) \r(5sec) \y7000 $","0"0
& Same this the whole menu will be look like this:
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(); } } } }

or start case from 1

& please use [CODE] [PHP] when u are putting script or code
__________________
Hosting Servers: Angel Of Games

Facebook
My YouTube
Join My Forum
Ro{Y}aL WarLanD CommuniTy
Angel Of Games - Forum
Currently Working On: ADVANCED VIP + API : 70%
DON KHAN 1 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-09-2019 , 08:40   Re: Knife Shop Menu
Reply With Quote #6

Quote:
Originally Posted by DON KHAN 1 View Post
why r u starting case from 0 while u have started menu with case 1
PHP Code:
menu_additem (menu,"Special Mode \y(Cant Die) \r(5sec) \y7000 $","1"0
>>
PHP Code:
menu_additem (menu,"Special Mode \y(Cant Die) \r(5sec) \y7000 $","0"0
That makes 0 difference as the "info" parameter is not used anywhere in the code. He is switching "item" in the menu handler which ALWAYS starts from 0.

You're yet again trying to give advice, ignoring everyone else's comments, when you have no clue what you're saying.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:22.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode