|
Junior Member
Join Date: Dec 2013
Location: VNG, Porto, Portugal
|

12-28-2013
, 17:29
Re: Menu cs 1.6
|
#6
|
I came back with more information and with media developed here is code, just add the missing purchase parachutes, the invisible mode ,super knife and 50HP, as we think it requires linking to external plugins, here I leave the code:
PHP Code:
#include <amxmodx> #include <cstrike>
new const PLUGIN[] = "FreeLancer Shop" new const VERSION[] = "0.1" new const AUTHOR[] = "FallenSylva"
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /shop") }
public shop(id) { if(is_user_alive(id)) { new ShopMenu = menu_create("Loja", "shop") menu_additem(ShopMenu, "Paraquedas 500$", "1", id) menu_additem(ShopMenu, "AK47 1500$", "2", id) menu_additem(ShopMenu, "M4 1500$", "3", id) menu_additem(ShopMenu, "AWP 1800$", "4", id) menu_additem(ShopMenu, "Deagle 500$", "5", id) menu_additem(ShopMenu, "Invisivel 16000$", "6", id) menu_additem(ShopMenu, "Super Faca 12000$", "7", id) menu_additem(ShopMenu, "50HP 3000", "8", id) menu_setprop(ShopMenu, MPROP_EXIT ) menu_display(id, ShopMenu, 0) } return PLUGIN_CONTINUE }
public shop(id, ShopMenu, item) { new money = cs_get_user_money(id) { switch(item) { case 0: { if(money >= 500) { new setmoney = money - 500 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "?") client_print(id, "Pressiona E usar o paraquedas!") } return PLUGIN_CONTINUE } case 1: { if(money >= 1500) { new setmoney = money - 1500 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "weapon_ak47") client_print(id, "Compraste a AK47!") } return PLUGIN_CONTINUE } case 2: { if(money >= 1500) { new setmoney = money - 1500 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "weapon_m4a1") client_print(id, "Compraste uma M4!") } case 3: { if(money >= 1800) { new setmoney = money - 1800 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "weapon_awp") client_print(id, "Compraste uma AWP!") } case 4: { if(money >= 500) { new setmoney = money - 500 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "weapon_deagle") client_print(id, "Compraste uma Deagle!") } case 5: { if(money >= 16000) { new setmoney = money - 16000 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "?") client_print(id, "Fica quieto e invisivel!") } case 6: { if(money >= 12000) { new setmoney = money - 12000 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "?" client_print(id, "Compraste uma super faca!") } case 7: { if(money >= 3000) { new setmoney = money - 3000 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "?") client_print(id, "Compraste 50HP!") } } } } return PLUGIN_CONTINUE }
menu_destroy(menu); return PLUGIN_HANDLED; }
I use this code:
PHP Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <hamsandwich>
new const PLUGIN[] = "grenadeshop" new const VERSION[] = "0.1" new const AUTHOR[] = "quark"
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /shop", "grenadeshop") }
public grenadeshop(id) { if(is_user_alive(id)) { new ShopMenu = menu_create("Grenade Shop", "shop_handler") menu_additem(ShopMenu, "HE 750$", "1", id) menu_additem(ShopMenu, "FB 500$", "2", id) menu_additem(ShopMenu, "SM 500$", "3", id) menu_setprop(ShopMenu, MPROP_EXIT ) menu_display(id, ShopMenu, 0) } return PLUGIN_CONTINUE }
public shop_handler(id, ShopMenu, item) { new money = cs_get_user_money(id) { switch(item) { case 0: { if(money >= 750) { new setmoney = money - 750 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "weapon_hegrenade" client_print(id, "You have earned an HE GRENADE!") } return PLUGIN_CONTINUE } case 1: { if(money >= 500) { new setmoney = money - 500 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "weapon_flashbang" client_print(id, "You have earned an FLASHBANG GRENADE!") } return PLUGIN_CONTINUE } case 2: { if(money >= 500) { new setmoney = money - 500 cs_set_user_money(id, clamp(setmoney, 0, 50000)) give_item(id, "weapon_smokegrenade" client_print(id, "You have earned an SMOKE GRENADE!") } } } } return PLUGIN_CONTINUE }
Attention plugin plugin answers lie in my language PT-PT but if anyone wants to pick up the pass code for English no problem
__________________
I'm happy, are u happy ?
Last edited by fallensylva; 12-28-2013 at 18:55.
|
|