Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include dm_chat
#define SND_MENU "buttons/button9.wav"
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|M ENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|ME NU_KEY_9|MENU_KEY_0
new const MAXBPAMMO[] = { -1, 52, -1, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120,
30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, -1, 100 }
new const MAXCLIP[] = { -1, 13, -1, 10, -1, 7, -1, 30, 30, -1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, -1, 7, 30, 30, -1, 50 }
native dm_money_get_discount(id)
native dm_get_user_money(id)
native dm_set_user_money(id, set)
native privilege_get(id)
native get_user_hero(id)
native get_warmup()
native m134_give(id)
native vsk94_give(id)
native b_give(id)
native hk416_give(id)
native m4a1g_give(id)
native ak47g_give(id)
native awpg_give(id)
native aklong_give(id)
native xm8_give(id)
native f2000_give(id)
native mp7a1_give(id)
native scar_give(id)
native k1ase_give(id)
native watergun_give(id)
native mg36xmas_give(id)
native lm_start_placing(id)
native d_start_placing(id)
native sg_start_placing(id)
native donate_show(id)
native check_stuck(id)
native open_mines_menu(id)
native map_list_show(id)
new g_iPrice[44]
new g_menu_type[33]
new Float:g_fSpeed[33]
new bool:g_bMusic[33]
new bool:g_bAmmo[33]
new bool:g_bMultijump[33]
new bool:jumpnum[33]
new bool:dojump[33]
public plugin_precache()
{
precache_sound(SND_MENU)
}
public plugin_cfg()
{
new file[128]; get_localinfo("amxx_configsdir",file,63)
format(file, 127, "%s/test_cvars/shop.cfg", file)
if(file_exists(file)) server_cmd("exec %s", file), server_exec()
}
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "ham_killed_post", 1)
register_clcmd("chooseteam", "clcmd_changeteam")
register_clcmd("jointeam", "clcmd_changeteam")
register_clcmd("radio3", "clcmd_radio_three")
register_menu("Main Server Menu", KEYSMENU, "menu_server")
register_menu("Shop Menu", KEYSMENU, "menu_shop")
register_menu("Shoping Menu", KEYSMENU, "menu_shop2")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
new buffer[32]
for (new i=1; i < 44; i++)
{
formatex(buffer, 31, "shop_price_%d", i)
g_iPrice[i]=register_cvar(buffer,"100")
}
}
public plugin_natives()
{
register_native("give_hero_things", "native_hero_give", 1)
register_native("get_music", "get_music", 1)
}
public ham_killed_post(id)
{
g_fSpeed[id]=0.0
g_bAmmo[id]=false
g_bMultijump[id]=false
}
public client_connect(id)
{
g_fSpeed[id]=0.0
g_bAmmo[id]=false
g_bMultijump[id]=false
g_bMusic[id]=true
}
public clcmd_changeteam(id)
{
static team
team = fm_cs_get_user_team(id)
if (team == 3 || team == 0) return PLUGIN_CONTINUE
menu_main_open(id)
client_cmd(id, "spk ^"%s^"", SND_MENU)
return PLUGIN_HANDLED;
}
public clcmd_radio_three(id)
{
shop_main_open(id)
return PLUGIN_HANDLED
}
stock fm_cs_get_user_team(id)
{
if (pev_valid(id) != 2) return 0
return get_pdata_int(id, 114, 5)
}
public menu_main_open(id)
{
if(!is_user_alive(id))
{
colored_print(id, "!!t Dead menu is not available!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tThis menu not available for Hero!")
return
}
if(get_warmup())
{
colored_print(id, "!tYou can't open show on warmup")
return
}
static menu[512], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Server menu^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r]\w Place gun \r(\y3000$\r)^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r]\w Place dispenser \r(\y4000$\r)^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y3\r]\w Place laser \r(\y800$\r)^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r]\w Transfer money^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r]\w Sturn?^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r]\w Menu of Mines^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y7\r]\w Upgrades^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y8\r]\w Nominate a map^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y9\r]\w Music \r[\y%s\r]^n", g_bMusic[id]?"ON":"OFF")
len += formatex(menu[len], charsmax(menu) - len, "^n\r[\y0\r]\w Exit")
show_menu(id, KEYSMENU, menu, -1, "Main Server Menu")
}
public shop_main_open(id)
{
if(!is_user_alive(id))
{
colored_print(id, "!tThis menu only for alive!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tThis menu not available for Hero!")
return
}
if(get_warmup())
{
colored_print(id, "!tYou can't open show on warmup")
return
}
new Float:Health
pev(id, pev_health, Health)
new Float:Armor
pev(id, pev_armorvalue, Armor)
new Float:Gravity
pev(id, pev_gravity, Gravity)
new Float:RAMT
pev(id, pev_renderamt, RAMT)
static menu[512], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Upgrades^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Price discount:\y %d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r]\w Menu of Weapons^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r]\w Menu of Items^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y3\r]\w Menu of Health^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r]\w Menu of Armor^n")
len += formatex(menu[len], charsmax(menu) - len, Gravity==0.5?"\r[\y5\r]\d Menu of Gravity \y(MAX)^n":"\r[\y5\r]\w Menu of Gravity^n")
len += formatex(menu[len], charsmax(menu) - len, RAMT==50.0?"\r[\y6\r]\d Menu of Invisiblity \y(MAX)^n":"\r[\y6\r]\w Menu of Invisiblity^n")
len += formatex(menu[len], charsmax(menu) - len, g_fSpeed[id]==420.0?"\r[\y7\r]\d Menu of Speed \y(MAX)^n":"\r[\y7\r]\w Menu of Speed^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\y8\r]\w Premium weapons \r[\yVIP\d | \yADM\r]^n^n")
len += formatex(menu[len], charsmax(menu) - len, "^n\r[\y9\r]\w Back")
len += formatex(menu[len], charsmax(menu) - len, "^n\r[\y0\r]\w Exit")
show_menu(id, KEYSMENU, menu, -1, "Shop Menu")
}
public shop_second_open(id)
{
if(!is_user_alive(id))
{
colored_print(id, "!tThis menu only for alive!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tThis menu not available for Hero!")
return
}
if(get_warmup())
{
colored_print(id, "!tYou can't open show on warmup")
return
}
static menu[512], len
len = 0
switch(g_menu_type[id])
{
case 0:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Menu of Weapons^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Price discount: \y%d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r]\w Minigun \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[1])))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r]\w VSK-94 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[2])))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y3\r]\w Bazooka \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[3])))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r]\w HK416 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[4])))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r]\w Golden M4A1 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[5])))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r]\w Golden AK47 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[6])))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y7\r]\w Golden AWP \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[7])))
}
case 1:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Menu of Items^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Price discount: \y%d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, g_bAmmo[id]?"\r[\y1\r]\d Infinite ammo \r(\y%d$\r)^n":"\r[\y1\r]\w Infinite ammo \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[8]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r]\w All grenades \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[9]))
len += formatex(menu[len], charsmax(menu) - len, g_bMultijump[id]?"\r[\y3\r]\d Multi jump \r(\y%d$\r)^n":"\r[\y3\r]\w Multi jump \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[10])))
}
case 2:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Меню здоровья^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Скидка: \y%d%%^n^n", dm_money_get_discount(id))
new Float:Health
pev(id, pev_health, Health)
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r[\y1\r]\d Health +450 \r(\y%d$\r)^n":"\r[\y1\r]\w Health +450 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[11])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r[\y2\r]\d Health +250 \r(\y%d$\r)^n":"\r[\y2\r]\w Health +250 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[12])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r[\y3\r]\d Health +95 \r(\y%d$\r)^n":"\r[\y3\r]\w Health +95 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[13])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r[\y4\r]\d Health +65 \r(\y%d$\r)^n":"\r[\y4\r]\w Health +65 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[14])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r[\y5\r]\d Health +35 \r(\y%d$\r)^n":"\r[\y5\r]\w Health +35 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[15])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r[\y6\r]\d Health +15 \r(\y%d$\r)^n":"\r[\y6\r]\w Health +15 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[16])))
}
case 3:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Menu of Armor^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Price discount: \y%d%%^n^n", dm_money_get_discount(id))
new Float:Armor
pev(id, pev_armorvalue, Armor)
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r[\y1\r]\d Armor +450 \r(\y%d$\r)^n":"\r[\y1\r]\w Armor +450 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[17])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r[\y2\r]\d Armor +250 \r(\y%d$\r)^n":"\r[\y2\r]\w Armor +250 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[18])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r[\y3\r]\d Armor +95 \r(\y%d$\r)^n":"\r[\y3\r]\w Armor +95 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[19])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r[\y4\r]\d Armor +65 \r(\y%d$\r)^n":"\r[\y4\r]\w Armor +65 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[20])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r[\y5\r]\d Armor +35 \r(\y%d$\r)^n":"\r[\y5\r]\w Armor +35 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[21])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r[\y6\r]\d Armor +15 \r(\y%d$\r)^n":"\r[\y6\r]\w Armor +15 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[22])))
}
case 4:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Menu of Gravity^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Скидка: \y%d%%^n^n", dm_money_get_discount(id))
new Float:Gravity
pev(id, pev_gravity, Gravity)
len += formatex(menu[len], charsmax(menu) - len, (Gravity==0.5)?"\r[\y1\r]\d Gravity 400 \r(\y%d$\r)^n":"\r[\y1\r]\w Gravity 400 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[23])))
len += formatex(menu[len], charsmax(menu) - len, (Gravity==0.5||Gravity==0.65)? "\r[\y2\r]\d Gravity 500 \r(\y%d$\r)^n":"\r[\y2\r]\w Gravity 500 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[24])))
len += formatex(menu[len], charsmax(menu) - len, (Gravity==0.5||Gravity==0.65||Gravity==0.?" \r[\y3\r]\d Gravity 600 \r(\y%d$\r)^n":"\r[\y3\r]\w Gravity 600 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[25])))
len += formatex(menu[len], charsmax(menu) - len, (Gravity==0.5||Gravity==0.65||Gravity==0.8||G ravity==0.9)?"\r[\y4\r]\d Gravity 700 \r(\y%d$\r)^n":"\r[\y4\r]\w Gravity 700 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[26])))
}
case 5:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Menu of Invisiblity^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Скидка: \y%d%%^n^n", dm_money_get_discount(id))
new Float:RAMT
pev(id, pev_renderamt, RAMT)
len += formatex(menu[len], charsmax(menu) - len, (RAMT==50.0)?"\r[\y1\r]\d High \r(\y%d$\r)^n":"\r[\y1\r]\w High \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[27])))
len += formatex(menu[len], charsmax(menu) - len, (RAMT==50.0||RAMT==125.0)?"\r[\y2\r]\d Medium \r(\y%d$\r)^n":"\r[\y2\r]\w Medium \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[28])))
len += formatex(menu[len], charsmax(menu) - len, (RAMT==50.0||RAMT==125.0||RAMT==200.0)?"\r[\y3\r]\d Low \r(\y%d$\r)^n":"\r[\y3\r]\w Low \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[29])))
}
case 6:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Menu of Speed^n")
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Price discount: \y%d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, g_fSpeed[id]==420.0?"\r[\y1\r]\d Speed 420 \r(\y%d$\r)^n":"\r[\y1\r]\w Speed 420 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[30])))
len += formatex(menu[len], charsmax(menu) - len, (g_fSpeed[id]==420.0||g_fSpeed[id]==380.0)?"\r[\y2\r]\d Speed 380 \r(\y%d$\r)^n":"\r[\y2\r]\w Speed 380 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[31])))
len += formatex(menu[len], charsmax(menu) - len, (g_fSpeed[id]==420.0||g_fSpeed[id]==380.0||g_fSpeed[id]==340.0)?"\r[\y3\r]\d Speed 340 \r(\y%d$\r)^n":"\r[\y3\r]\w Speed 340 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[32])))
len += formatex(menu[len], charsmax(menu) - len, (g_fSpeed[id]==420.0||g_fSpeed[id]==380.0||g_fSpeed[id]==340.0||g_fSpeed[id]==300.0)?"\r[\y4\r]\d Speed 300 \r(\y%d$\r)^n":"\r[\y4\r]\w Speed 300 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[33])))
len += formatex(menu[len], charsmax(menu) - len, (g_fSpeed[id]==420.0||g_fSpeed[id]==380.0||g_fSpeed[id]==340.0||g_fSpeed[id]==300.0||g_fSpeed[id]==260.0)?"\r[\y5\r]\d Speed 260 \r(\y%d$\r)^n":"\r[\y5\r]\w Speed 260 \r(\y%d$\r)^n", get_price(id, get_pcvar_num(g_iPrice[34])))
}
case 7:{
len += formatex(menu[len], charsmax(menu) - len, "\r[\yDM\r]\w Premium weapons^n^n")
if(privilege_get(id)){
len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r]\w MP7A1 \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[35]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r]\w SCAR Basic \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[36]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y3\r]\w K1ASE \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[37]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r]\w Watergun \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[38]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r]\w MG36 Xmas \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[39]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r]\w Fn F2000 \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[40]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y7\r]\w AK47 Long \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[41]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y8\r]\w XM8 Basic \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[42]))
}else{
len += formatex(menu[len], charsmax(menu) - len, "\r[\y1\r]\d MP7A1 \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[35]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y2\r]\d SCAR Basic \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[36]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y3\r]\d K1ASE \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[37]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y4\r]\d Watergun \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[38]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r]\d MG36 Xmas \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[39]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r]\d Fn F2000 \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[40]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y7\r]\d AK47 Long \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[41]))
len += formatex(menu[len], charsmax(menu) - len, "\r[\y8\r]\d XM8 Basic \r(\y%d$\r)^n", get_pcvar_num(g_iPrice[42]))
}
}
}
len += formatex(menu[len], charsmax(menu) - len, "^n\r[\y9\r]\w Back")
len += formatex(menu[len], charsmax(menu) - len, "^n\r[\y0\r]\w Exit")
show_menu(id, KEYSMENU, menu, -1, "Shoping Menu")
}
public menu_server(id, key)
{
if(!is_user_alive(id))
{
colored_print(id, "!tThis menu only for alive!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tThis menu not available for Hero!")
return
}
if(get_warmup())
{
colored_print(id, "!tYou can't open this menu on warmup!")
return
}
switch(key)
{
case 0: sg_start_placing(id)
case 1: d_start_placing(id)
case 2: lm_start_placing(id)
case 3: donate_show(id)
case 4: check_stuck(id)
case 5: open_mines_menu(id)
case 6: shop_main_open(id)
case 7: map_list_show(id)
case 8: {
g_bMusic[id]=!g_bMusic[id]
client_cmd(id, "mp3 stop; stopsound")
menu_main_open(id)
colored_print(id, g_bMusic[id]?"!tHave fun with music!":"!tYou'll no longer hear music.")
}
}
}
public menu_shop(id, key)
{
if(!is_user_alive(id))
{
colored_print(id, "!tThis menu only for alive!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tThis menu not available for Hero!")
return
}
if(get_warmup())
{
colored_print(id, "!tYou can't open this menu on warmup!")
return
}
if(key=={
menu_main_open(id)
return
}
else if(key==9)return
new Float:Gravity, Float:RAMT
pev(id, pev_gravity, Gravity)
pev(id, pev_renderamt, RAMT)
switch(key){
case 4: if(Gravity==0.5) return
case 5: if(RAMT==50.0) return
case 6: if(g_fSpeed[id]==420.0) return
}
g_menu_type[id]=key
shop_second_open(id)
return
}
public menu_shop2(id, key)
{
if(!is_user_alive(id))
{
colored_print(id, "!tThis menu only for alive!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tThis menu not available for Hero!")
return
}
if(get_warmup())
{
colored_print(id, "!tYou can't open this menu on warmup!")
return
}
if(key=={
shop_main_open(id)
return
}
else if(key==9)return
switch(g_menu_type[id])
{
case 0:
{
if(key>6)return
if(dm_get_user_money(id)<get_price(id, get_pcvar_num(g_iPrice[1+key]))){
colored_print(id, "!tNot enough money! !g(Needs %d)", get_price(id, get_pcvar_num(g_iPrice[1+key])))
return
}
switch(key)
{
case 0:
{
m134_give(id)
colored_print(id, "Good luck and have fun with !gMinigun!y!")
}
case 1:
{
vsk94_give(id)
colored_print(id, "Good luck and have fun with !gVsk-94!y!")
}
case 2:
{
b_give(id)
colored_print(id, "Good luck and have fun with !gBazooka!y!")
}
case 3:
{
hk416_give(id)
colored_print(id, "Good luck and have fun with !ghHk-416!y!")
}
case 4:
{
m4a1g_give(id)
colored_print(id, "Good luck and have fun with !gM4A1 gold!y!")
}
case 5:
{
ak47g_give(id)
colored_print(id, "Good luck and have fun with !gAk-47 Gold!y!")
}
case 6:
{
awpg_give(id)
colored_print(id, "Good luck and have fun with !gAWP Gold!y!")
}
}
dm_set_user_money(id, dm_get_user_money(id)-get_price(id, get_pcvar_num(g_iPrice[1+key])))
}
case 1:
{
if(key>2)return
switch(key)
{
case 0:
{
if(g_bAmmo[id])return
if(dm_get_user_money(id)<get_pcvar_num(g_iPri ce[8+key])){
colored_print(id, "!tNot enough money! !g(Needs %d)", get_pcvar_num(g_iPrice[8+key]))
return
}
g_bAmmo[id]=true
colored_print(id, "Good luck and have fun with !ginfinite ammo!y!")
dm_set_user_money(id, dm_get_user_money(id)-get_pcvar_num(g_iPrice[8+key]))
}
case 1:
{
if(dm_get_user_money(id)<get_pcvar_num(g_iPri ce[8+key])){
colored_print(id, "!tNot enough money! !g(Needs %d)", get_pcvar_num(g_iPrice[8+key]))
return
}
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_smokegrenade")
colored_print(id, "Good luck and have fun with !ggrenade pack!y!")
dm_set_user_money(id, dm_get_user_money(id)-get_pcvar_num(g_iPrice[8+key]))
}
case 2:
{
if(g_bMultijump[id])return
if(dm_get_user_money(id)<get_price(id, get_pcvar_num(g_iPrice[8+key]))){
colored_print(id, "!tNot enough money! !g(Needs %d)", get_price(id, get_pcvar_num(g_iPrice[8+key])))
return
}
g_bMultijump[id]=true
colored_print(id, "Good luck and have fun with !gmulti jump!y!")
dm_set_user_money(id, dm_get_user_money(id)-get_price(id, get_pcvar_num(g_iPrice[8+key])))
}
}
}
case 2:
{
if(key>5)return
new Float:health
pev(id, pev_health, health)
if(health>=900.0)return
if(dm_get_user_money(id)<get_price(id, get_pcvar_num(g_iPrice[11+key]))){
colored_print(id, "!tNot enough money! !g(Needs %d)", get_price(id, get_pcvar_num(g_iPrice[11+key])))
return
}
dm_set_user_money(id, dm_get_user_money(id)-get_price(id, get_pcvar_num(g_iPrice[11+key])))
switch(key)
{
case 0:{
health+=450.0
colored_print(id, "Good luck and have fun with !g450 Health!y!")
}
case 1:{
health+=250.0
colored_print(id, "Good luck and have fun with !g250 Health!y!")
}
case 2:{
health+=95.0
colored_print(id, "Good luck and have fun with !g95 Health!y!")
}
case 3:{
health+=65.0
colored_print(id, "Good luck and have fun with !g65 Health!y!")
}
case 4:{
health+=35.0
colored_print(id, "Good luck and have fun with !g35 Health!y!")
}
case 5:{
health+=15.0
colored_print(id, "Good luck and have fun with !g15 Health!y!")
}
}
if(health>900.0)health=900.0
set_pev(id, pev_health, health)
}
case 3:
{
if(key>5)return
new Float:armor
pev(id, pev_armorvalue, armor)
if(armor>=900.0)return
if(dm_get_user_money(id)<get_price(id, get_pcvar_num(g_iPrice[17+key]))){
colored_print(id, "!tNot enough money! !g(нужно %d)", get_price(id, get_pcvar_num(g_iPrice[17+key])))
return
}
dm_set_user_money(id, dm_get_user_money(id)-get_price(id, get_pcvar_num(g_iPrice[17+key])))
switch(key)
{
case 0:{
armor+=450.0
colored_print(id, "Good luck and have fun with !g450 Armor!y!")
}
case 1:{
armor+=250.0
colored_print(id, "Good luck and have fun with !g250 Armor!y!")
}
case 2:{
armor+=95.0
colored_print(id, "Good luck and have fun with !g95 Armor!y!")
}
case 3:{
armor+=65.0
colored_print(id, "Good luck and have fun with !g65 Armor!y!")
}
case 4:{
armor+=35.0
colored_print(id, "Good luck and have fun with !g35 Armor!y!")
}
case 5:{
armor+=15.0
colored_print(id, "Good luck and have fun with !g15 Armor!y!")
}
}
if(armor>900.0)armor=900.0
set_pev(id, pev_armorvalue, armor)
}
case 4:
{
if(key>3)return
if(dm_get_user_money(id)<get_price(id, get_pcvar_num(g_iPrice[23+key]))){
colored_print(id, "!tNot enough money! !g(нужно %d)", get_price(id, get_pcvar_num(g_iPrice[23+key])))
return
}
new Float:Gravity
pev(id, pev_gravity, Gravity)
switch(key)
{
case 0: {
if(Gravity==0.5)return
set_pev(id, pev_gravity, 0.5)
colored_print(id, "Good luck and have fun with !g400 Gravity!y!")
}
case 1: {
if(Gravity<=0.65)return
set_pev(id, pev_gravity, 0.65)
colored_print(id, "Good luck and have fun with !g500 Gravity!y!")
}
case 2: {
if(Gravity<=0.return
set_pev(id, pev_gravity, 0.
colored_print(id, "Good luck and have fun with !g600 Gravity!y!")
}
case 3: {
if(Gravity<=0.9)return
set_pev(id, pev_gravity, 0.9)
colored_print(id, "Good luck and have fun with !g700 Gravity!y!")
}
}
dm_set_user_money(id, dm_get_user_money(id)-get_price(id, get_pcvar_num(g_iPrice[23+key])))
}
case 5:
{
if(key>2)return
if(dm_get_user_money(id)<get_price(id, get_pcvar_num(g_iPrice[27+key]))){
colored_print(id, "!tNot enough money! !g(нужно %d)", get_price(id, get_pcvar_num(g_iPrice[27+key])))
return
}
new Float:RAMT
pev(id, pev_renderamt, RAMT)
switch(key)
{
case 0: {
if(RAMT==50.0)return
fm_set_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransAlpha, 50)
colored_print(id, "Good luck and have fun with !ghigh invisiblity!y!")
}
case 1: {
if(RAMT==125.0)return
fm_set_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransAlpha, 125)
colored_print(id, "Good luck and have fun with !gmedium invisiblity!y!")
}
case 2: {
if(RAMT==200.0||RAMT==125.0)return
fm_set_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransAlpha, 200)
colored_print(id, "Good luck and have fun with !glow invisiblity!y!")
}
}
dm_set_user_money(id, dm_get_user_money(id)-get_price(id, get_pcvar_num(g_iPrice[27+key])))
}
case 6:
{
if(key>4)return
if(dm_get_user_money(id)<get_price(id, get_pcvar_num(g_iPrice[30+key]))){
colored_print(id, "!tNot enough money! !g(нужно %d)", get_price(id, get_pcvar_num(g_iPrice[30+key])))
return
}
switch(key)
{
case 0: {
if(g_fSpeed[id]==420.0)return
g_fSpeed[id]=420.0
colored_print(id, "Good luck and have fun with !gSpeed 420!y!")
}
case 1: {
if(g_fSpeed[id]>=380.0)return
g_fSpeed[id]=380.0
colored_print(id, "Good luck and have fun with !gSpeed 380!y!")
}
case 2: {
if(g_fSpeed[id]>=340.0)return
g_fSpeed[id]=340.0
colored_print(id, "Good luck and have fun with !gSpeed 340!y!")
}
case 3: {
if(g_fSpeed[id]>=300.0)return
g_fSpeed[id]=300.0
colored_print(id, "Good luck and have fun with !gSpeed 300!y!")
}
case 4: {
if(g_fSpeed[id]>=260.0)return
g_fSpeed[id]=260.0
colored_print(id, "Good luck and have fun with !gSpeed 260!y!")
}
}
set_pev(id, pev_maxspeed, g_fSpeed[id])
dm_set_user_money(id, dm_get_user_money(id)-get_price(id, get_pcvar_num(g_iPrice[30+key])))
}
case 7:
{
if(key>7)return
if(!privilege_get(id)){
colored_print(id, "!tAvailable for !gVIP players")
return
}
if(dm_get_user_money(id)<get_pcvar_num(g_iPri ce[35+key])){
colored_print(id, "!tNot enough money! !g(Needs %d)", get_pcvar_num(g_iPrice[35+key]))
return
}
dm_set_user_money(id, dm_get_user_money(id)-get_pcvar_num(g_iPrice[35+key]))
switch(key)
{
case 0: mp7a1_give(id), colored_print(id, "Good luck and have fun with !gMp-7 A1!y!")
case 1: scar_give(id), colored_print(id, "Good luck and have fun with !gScar!y!")
case 2: k1ase_give(id), colored_print(id, "Good luck and have fun with !gK1ase!y!")
case 3: watergun_give(id), colored_print(id, "Good luck and have fun with !gWatergun!y!")
case 4: mg36xmas_give(id), colored_print(id, "Good luck and have fun with !gMg-36 Xmas!y!")
case 5: f2000_give(id), colored_print(id, "Good luck and have fun with !gF-2000!y!")
case 6: aklong_give(id), colored_print(id, "Good luck and have fun with !gAk-Long!y!")
case 7: xm8_give(id), colored_print(id, "Good luck and have fun with !gXm-8!y!")
}
}
}
return
}
public fw_PlayerPreThink(id) {
if(!is_user_alive(id)) return
if(g_fSpeed[id]>0.0)
set_pev(id, pev_maxspeed, g_fSpeed[id])
if(!g_bMultijump[id]) return
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(!jumpnum[id])
{
dojump[id] = true
jumpnum[id]=true
return
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = false
}
}
public client_PostThink(id)
{
if(!is_user_alive(id)) return
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity )
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity )
dojump[id] = false
}
}
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color[3]
color[0] = float(r)
color[1] = float(g)
color[2] = float(b)
set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, color)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))
}
stock get_price(id, price)
{
if(dm_money_get_discount(id)) price-=(price/100*dm_money_get_discount(id))
return price
}
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
if (!is_user_alive(msg_entity)) return
if (get_msg_arg_int(1) != 1) return
if (!g_bAmmo[msg_entity]) return
static weapon; weapon = get_msg_arg_int(2)
if (MAXBPAMMO[weapon] > 2)
{
static weapon_ent
weapon_ent = fm_cs_get_current_weapon_ent(msg_entity)
if (pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
}
}
public native_hero_give(id)
{
g_fSpeed[id]=420.0
g_bAmmo[id]=true
ak47g_give(id)
set_pev(id, pev_gravity, 1.0)
}
public get_music(id)
{
return g_bMusic[id]
}
stock fm_cs_get_current_weapon_ent(id)
{
if (pev_valid(id) != 2) return -1
return get_pdata_cbase(id, 373, 5)
}
stock fm_give_item(id, const item[])
{
static ent
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
if (!pev_valid(ent)) return;
static FloatriginF[3]
pev(id, pev_origin, originF)
set_pev(ent, pev_origin, originF)
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
dllfunc(DLLFunc_Spawn, ent)
static save
save = pev(ent, pev_solid)
dllfunc(DLLFunc_Touch, ent, id)
if (pev(ent, pev_solid) != save) return;
engfunc(EngFunc_RemoveEntity, ent)
}