|
BANNED
|

09-28-2011
, 06:16
Re: HideNSeek Market
|
#17
|
i edited this code ;)
Added: Change price of Weapon, health. armor, show bullets in menu;)
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <engine> #include <colorchat> #include <fakemeta>
#define PLUGIN "HideNSeek Market" #define VERSION "1.0.4" #define AUTHOR "BunnYboii & tv!X^^"
new scout, deagle, awp, fiveseven, p90, health, armor
new pScout, pDeagle, pAwp, pFiveseven, pP90, pHealth, pArmor, pHegrenade, pFlashbang, pSmokegreen
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /shop", "mod_menu") register_clcmd("say /hnshop", "mod_menu") register_clcmd("say /hs", "mod_menu") // Weapon price cvar's pScout = register_cvar("hns_scout_price", "7500") pAwp = register_cvar("hns_awp_price", "16000") pDeagle = register_cvar("hns_deagle_price", "9500") pFiveseven = register_cvar("hns_fs_price", "6000") p90 = register_cvar("hns_p90_price", "10000") pHealth = register_cvar("hns_health_price", "3500") pArmor = register_cvar("hns_armor_price", "5300") pHegrenade = register_cvar("hns_hegrenade_price", "2500") pFlashbang = register_cvar("hns_flashbang_price", "1500") pSmokegreen = register_cvar("hns_smokegreen_price", "4500") // Weapon cvar's health = register_cvar("hns_health_give", "50") scout = register_cvar("hns_scout_ammo", "1") deagle = register_cvar("hns_dgl_ammo", "1") awp = register_cvar("hns_awp_ammo", "2") fiveseven = register_cvar("hns_fs_ammo", "2") p90 = register_cvar("hns_p90_ammo", "5") armor = register_cvar("hns_armor_give", "200") register_event("CurWeapon", "Event_CurWeapon", "be","1=1") }
public mod_menu(id) { new menu = menu_create("\w[ -\r hide'N'seek buy menu\w - ]", "menu_handler") menu_additem(menu, "\wHE Grenade [\r %d $\w]", "1", get_pcvar_num(pHegrenade) ) menu_additem(menu, "\wFlashbang [\r%d $\w]", "2", get_pcvar_num(pFlashbang) ) menu_additem(menu, "\wFrost Nade [\r%d $\w]", "3", get_pcvar_num(pSmokegreen) ) menu_additem(menu, "\wScout [\r %d bullets\w] [\r%d $\w]", "4", get_pcvar_num(scout),get_pcvar_num(pScout) ) menu_additem(menu, "\wDeagle [\r %d bullets\w] [\r%d $\w]", "5", get_pcvar_num(deagle), get_pcvar_num(pDeagle) ) menu_additem(menu, "\wAWP [\r %d bullets\w] [\r%d $\w]", "6", get_pcvar_num(awp), get_pcvar_num(pAwp) ) menu_additem(menu, "\wFiveseven [\r %d bullets\w] [\r%d $\w]", "7", get_pcvar_num(fiveseven), get_pcvar_num(pFiveseven) ) menu_additem(menu, "\wHealth [\r %d\w HP\w ] [\r %d $\w ]", "8", get_pcvar_num(health), get_pcvar_num(pHealth) ) menu_additem(menu, "\wArmor [\r %d\w AR\w ] [\r %d $\w ]", "9", get_pcvar_num(armor), get_pcvar_num(pArmor) ) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) } public menu_handler(id, menu, item) { if( item == MENU_EXIT ) { menu_destroy(menu) return PLUGIN_HANDLED } new data[6], szName[64] new access, callback menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback) new key = str_to_num(data) new money = cs_get_user_money(id) if(is_user_alive(id)) { switch(key) { case 1: { if( money >= get_pcvar_num(pHegrenade) ) { new setmoney = money - get_pcvar_num(pHegrenade) cs_set_user_money(id, clamp(setmoney, 0, 16000)) give_item(id, "weapon_hegrenade") ColorChat(id, TEAM_COLOR, "^x03[HNS EXTRA]^x01 You bought a^x03 HE Grenade.") } else { ColorChat(id, TEAM_COLOR, "^x04[HNS EXTRA]^x01 You have insufficient funds!") } } case 2: { if( money >= get_pcvar_num(pFlashbang) ) { new setmoney = money - get_pcvar_num(pFlashbang) cs_set_user_money(id, clamp(setmoney, 0, 16000)) give_item(id, "weapon_flashbang") ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You bought a Flashbang.") } else { ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You have insufficient funds!") } } case 3: { if( money >= get_pcvar_num(pFiveseven) ) { new setmoney = money - get_pcvar_num(pFlashbang) cs_set_user_money(id, clamp(setmoney, 0, 16000)) give_item(id, "weapon_smokegrenade") ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You bought a Frostnade!") } else { ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You have insufficient funds!") } } case 4: { if( money >= get_pcvar_num(pScout) ) { new setmoney = money - get_pcvar_num(pScout) cs_set_user_money(id, clamp(setmoney, 0, 16000)) give_item(id, "weapon_scout") new weapon_id = find_ent_by_owner(-1, "weapon_scout", id) cs_set_weapon_ammo(weapon_id, get_cvar_num(scout){ ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You bought Scout.") } else { ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You have insufficient funds!") } } case 5: { if( money >= get_pcvar_num(pDeagle) ) { new setmoney = money - get_pcvar_num(pDeagle) cs_set_user_money(id, clamp(setmoney, 0, 16000)) give_item(id, "weapon_deagle") new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id) cs_set_weapon_ammo(weapon_id, get_cvar_num(deagle){ ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You bought a Deagle.") } else { ColorChat(id, TEAM_COLOR, "^x04[HNS EXTRA]^x01 You hve insufficient funds!") } } case 6: { if( money >= get_pcvar_num(pAwp) { new setmoney = money - get_pcvar_num(pAwp) cs_set_user_money(id, clamp(setmoney, 0, 16000)) give_item(id, "weapon_awp") new weapon_id = find_ent_by_owner(-1, "weapon_awp", id) cs_set_weapon_ammo(weapon_id, get_cvar_num(awp)){ ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You bought an AWP.") } else { ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You have insufficient funds!") } } case 7: { if( money >= get_pcvar_num(pFiveseven) { new setmoney = money - get_pcvar_num(pFiveseven) cs_set_user_money(id, clamp(setmoney, 0, 16000)) give_item(id, "weapon_fiveseven") new weapon_id = find_ent_by_owner(-1, "weapon_fiveseven", id) cs_set_weapon_ammo(weapon_id, get_cvar_num(fiveseven){ ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You bought a FiveSeven.") } else { ColorChat(id, TEAM_COLOR, "^x04[HideNSeek Market]^x01 You have insufficient funds!") } } case 8: { if( money >= get_pcvar_num(pHealth ) { new setmoney = money - get_pcvar_num(pHealth) cs_set_user_money(id, clamp(setmoney, 0, 16000 )) cs_set_user_health(id, get_pcvar_num(health ) { ColorChat(id, TEAM_COLOR, "^x04[HNS EXTRA]^x01 You bought a Health.") } else { ColorChat(id, TEAM_COLOR, "^x04[HNS EXTRA]^x01 You have insufficient funds!") } } case 9: { if( money >= get_pcvar_num(pArmor) { new setmoney = money - get_pcvar_num(pArmor) cs_set_user_money(id, clamp(setmoney, 0, 1600)) cs_set_user_armor(id, get_pcvar_num(armor){ ColorChat(id, TEAM_COLOR, "^x04[HNS EXTRA]^x01 You bought a Armor.") } else { ColorChat(id, TEAM_COLOR, "^x04[HNS EXTRA]^x01 You have insufficient funds!.") } } } } return PLUGIN_HANDLED }
good? =)
Last edited by nkz1337; 09-28-2011 at 06:18.
|
|