Код
#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|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MEN
U_KEY_8|MENU_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Мертвым меню не доступно!y!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tГерою меню не доступно!y!")
return
}
if(get_warmup())
{
colored_print(id, "!tВо время разминки магазин закрыт!y!")
return
}
static menu[512], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\w Меню сервера^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Поставить пушку \y(\r3000$\y)^n")
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w Поставить раздатчик \y(\r4000$\y)^n")
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w Поставить лазер \y(\r800$\y)^n")
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w Передать деньги^n")
len += formatex(menu[len], charsmax(menu) - len, "\r5.\w Застрял?^n")
len += formatex(menu[len], charsmax(menu) - len, "\r6.\w Меню мин^n")
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w Прокачка персонажа^n")
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Номинировать карту^n")
len += formatex(menu[len], charsmax(menu) - len, "\r9.\w Музыка \r[\y%s\r]^n", g_bMusic[id]?"ВКЛ":"ВЫКЛ")
len += formatex(menu[len], charsmax(menu) - len, "^n\r0.\w Выход")
show_menu(id, KEYSMENU, menu, -1, "Main Server Menu")
}
public shop_main_open(id)
{
if(!is_user_alive(id))
{
colored_print(id, "!tМертвым меню не доступно!y!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tГерою меню не доступно!y!")
return
}
if(get_warmup())
{
colored_print(id, "!tВо время разминки магазин закрыт!y!")
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, "\wПрокачка персонажа^n")
len += formatex(menu[len], charsmax(menu) - len, "\wСкидка:\y %d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Меню оружия^n")
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w Меню предметов^n")
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w Меню здоровья^n")
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w Меню брони^n")
len += formatex(menu[len], charsmax(menu) - len, Gravity==0.5?"\r5.\d Меню гравитации \y(\rMAX\y)^n":"\r[\y5\r]\w Меню гравитации^n")
len += formatex(menu[len], charsmax(menu) - len, RAMT==50.0?"\r6.\d Меню невидимости \y(\rMAX\y)^n":"\r[\y6\r]\w Меню невидимости^n")
len += formatex(menu[len], charsmax(menu) - len, g_fSpeed[id]==420.0?"\r7.\d Меню скорости \y(\rMAX\y)^n":"\r[\y7\r]\w Меню скорости^n")
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Премиум оружие \y[\rVIP\d | \rADM\y]^n^n")
len += formatex(menu[len], charsmax(menu) - len, "^n\r9.\w Назад")
len += formatex(menu[len], charsmax(menu) - len, "^n\r0.\w Выход")
show_menu(id, KEYSMENU, menu, -1, "Shop Menu")
}
public shop_second_open(id)
{
if(!is_user_alive(id))
{
colored_print(id, "!tМертвым меню не доступно!y!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tГерою меню не доступно!y!")
return
}
if(get_warmup())
{
colored_print(id, "!tВо время разминки магазин закрыт!y!")
return
}
static menu[512], len
len = 0
switch(g_menu_type[id])
{
case 0:{
len += formatex(menu[len], charsmax(menu) - len, "\wМеню оружия^n")
len += formatex(menu[len], charsmax(menu) - len, "\wСкидка: \y%d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Minigun \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[1])))
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w VSK-94 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[2])))
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w Bazooka \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[3])))
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w HK416 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[4])))
len += formatex(menu[len], charsmax(menu) - len, "\r5.\w Gold M4A1 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[5])))
len += formatex(menu[len], charsmax(menu) - len, "\r6.\w Gold AK47 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[6])))
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w Gold AWP \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[7])))
}
case 1:{
len += formatex(menu[len], charsmax(menu) - len, "\wМеню предметов^n")
len += formatex(menu[len], charsmax(menu) - len, "\wСкидка: \y%d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, g_bAmmo[id]?"\r1.\d Бесконечные патроны \y(\r%d$\y)^n":"\r1.\w Бесконечные патроны \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[8]))
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w Все гранаты \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[9]))
len += formatex(menu[len], charsmax(menu) - len, g_bMultijump[id]?"\r3.\d Мульти-прыжок \y(\r%d$\y)^n":"\r3.\w Мульти-прыжок \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[10])))
}
case 2:{
len += formatex(menu[len], charsmax(menu) - len, "\wМеню здоровья^n")
len += formatex(menu[len], charsmax(menu) - len, "\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?"\r1.\d Здоровье +450 \y(\r%d$\y)^n":"\r1.\w Здоровье +450 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[11])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r2.\d Здоровье +250 \y(\r%d$\y)^n":"\r2.\w Здоровье +250 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[12])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r3.\d Здоровье +95 \y(\r%d$\y)^n":"\r3.\w Здоровье +95 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[13])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r4.\d Здоровье +65 \y(\r%d$\y)^n":"\r4.\w Здоровье +65 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[14])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r5.\d Здоровье +35 \y(\r%d$\y)^n":"\r5.\w Здоровье +35 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[15])))
len += formatex(menu[len], charsmax(menu) - len, Health>=900.0?"\r6.\d Здоровье +15 \y(\r%d$\y)^n":"\r6.\w Здоровье +15 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[16])))
}
case 3:{
len += formatex(menu[len], charsmax(menu) - len, "\wМеню брони^n")
len += formatex(menu[len], charsmax(menu) - len, "\wСкидка: \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?"\r1.\d Броня +450 \y(\r%d$\y)^n":"\r1.\w Броня +450 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[17])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r2.\d Броня +250 \y(\r%d$\y)^n":"\r2.\w Броня +250 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[18])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r3.\d Броня +95 \y(\r%d$\y)^n":"\r3.\w Броня +95 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[19])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r4.\d Броня +65 \y(\r%d$\y)^n":"\r4.\w Броня +65 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[20])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r5.\d Броня +35 \y(\r%d$\y)^n":"\r5.\w Броня +35 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[21])))
len += formatex(menu[len], charsmax(menu) - len, Armor>=900.0?"\r6.\d Броня +15 \y(\r%d$\y)^n":"\r6.\w Броня +15 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[22])))
}
case 4:{
len += formatex(menu[len], charsmax(menu) - len, "\wМеню гравитации^n")
len += formatex(menu[len], charsmax(menu) - len, "\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)?"\r1.\d Гравитация 400 \y(\r%d$\y)^n":"\r1.\w Гравитация 400 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[23])))
len += formatex(menu[len], charsmax(menu) - len, (Gravity==0.5||Gravity==0.65)? "\r2.\d Гравитация 500 \y(\r%d$\y)^n":"\r2.\w Гравитация 500 \y(\r%d$\y)^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.8)?"\r3.\d Гравитация 600 \y(\r%d$\y)^n":"\r3.\w Гравитация 600 \y(\r%d$\y)^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||Gravity==0.9)?"\r4.\d Гравитация 700 \y(\r%d$\y)^n":"\r4.\w Гравитация 700 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[26])))
}
case 5:{
len += formatex(menu[len], charsmax(menu) - len, "\wМеню невидимости^n")
len += formatex(menu[len], charsmax(menu) - len, "\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)?"\r1.\d Высокая \y(\r%d$\y)^n":"\r1.\w Высокая \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[27])))
len += formatex(menu[len], charsmax(menu) - len, (RAMT==50.0||RAMT==125.0)?"\r2.\d Средняя \y(\r%d$\y)^n":"\r2.\w Средняя \y(\r%d$\y)^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)?"\r3.\d Низкая \y(\r%d$\y)^n":"\r3.\w Низкая \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[29])))
}
case 6:{
len += formatex(menu[len], charsmax(menu) - len, "\wМеню скорости^n")
len += formatex(menu[len], charsmax(menu) - len, "\wСкидка: \y%d%%^n^n", dm_money_get_discount(id))
len += formatex(menu[len], charsmax(menu) - len, g_fSpeed[id]==420.0?"\r1.\d Скорость 420 \y(\r%d$\y)^n":"\r1.\w Скорость 420 \y(\r%d$\y)^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)?"\r2.\d Скорость 380 \y(\r%d$\y)^n":"\r2.\w Скорость 380 \y(\r%d$\y)^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)?"\r3.\d Скорость 340 \y(\r%d$\y)^n":"\r3.\w Скорость 340 \y(\r%d$\y)^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)?"\r4.\d Скорость 300 \y(\r%d$\y)^n":"\r4.\w Скорость 300 \y(\r%d$\y)^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)?"\r5.\d Скорость 260 \y(\r%d$\y)^n":"\r5.\w Скорость 260 \y(\r%d$\y)^n", get_price(id, get_pcvar_num(g_iPrice[34])))
}
case 7:{
len += formatex(menu[len], charsmax(menu) - len, "\wПремиум оружие^n^n")
if(privilege_get(id)){
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w MP7A1 \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[35]))
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w SCAR Basic \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[36]))
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w K1ASE \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[37]))
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w Watergun \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[38]))
len += formatex(menu[len], charsmax(menu) - len, "\r5.\w MG36 Xmas \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[39]))
len += formatex(menu[len], charsmax(menu) - len, "\r6.\w Fn F2000 \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[40]))
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w AK47 Long \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[41]))
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w XM8 Basic \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[42]))
}else{
len += formatex(menu[len], charsmax(menu) - len, "\r1.\d MP7A1 \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[35]))
len += formatex(menu[len], charsmax(menu) - len, "\r2.\d SCAR Basic \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[36]))
len += formatex(menu[len], charsmax(menu) - len, "\r3.\d K1ASE \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[37]))
len += formatex(menu[len], charsmax(menu) - len, "\r4.\d Watergun \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[38]))
len += formatex(menu[len], charsmax(menu) - len, "\r5.\d MG36 Xmas \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[39]))
len += formatex(menu[len], charsmax(menu) - len, "\r6.\d Fn F2000 \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[40]))
len += formatex(menu[len], charsmax(menu) - len, "\r7.\d AK47 Long \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[41]))
len += formatex(menu[len], charsmax(menu) - len, "\r8.\d XM8 Basic \y(\r%d$\y)^n", get_pcvar_num(g_iPrice[42]))
}
}
}
len += formatex(menu[len], charsmax(menu) - len, "^n\r9.\w Назад")
len += formatex(menu[len], charsmax(menu) - len, "^n\r0.\w Выход")
show_menu(id, KEYSMENU, menu, -1, "Shoping Menu")
}
public menu_server(id, key)
{
if(!is_user_alive(id))
{
colored_print(id, "!tМертвым меню не доступно!y!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tГерою меню не доступно!y!")
return
}
if(get_warmup())
{
colored_print(id, "!tВо время разминки магазин закрыт!y!")
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]?"!tНаслаждайтесь музыкой!":"!tМузыка вас больше не побеспокоит.")
}
}
}
public menu_shop(id, key)
{
if(!is_user_alive(id))
{
colored_print(id, "!tМертвым меню не доступно!y!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tГерою меню не доступно!y!")
return
}
if(get_warmup())
{
colored_print(id, "!tВо время разминки магазин закрыт!y!")
return
}
if(key==8){
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, "!tМертвым меню не доступно!y!")
return
}
if(get_user_hero(id))
{
colored_print(id, "!tГерою меню не доступно!y!")
return
}
if(get_warmup())
{
colored_print(id, "!tВо время разминки магазин закрыт!y!")
return
}
if(key==8){
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, "!tНедостаточно денег! !y(нужно: !g%d$!y)", get_price(id, get_pcvar_num(g_iPrice[1+key])))
return
}
switch(key)
{
case 0:
{
m134_give(id)
colored_print(id, "!yВы !gуспешно!y купили !tMinigun!y!")
}
case 1:
{
vsk94_give(id)
colored_print(id, "!yВы !gуспешно!y купили !tVsk-94!y!")
}
case 2:
{
b_give(id)
colored_print(id, "!yВы !gуспешно!y купили !tBazooka!y!")
}
case 3:
{
hk416_give(id)
colored_print(id, "!yВы !gуспешно!y купили !thHk-416!y!")
}
case 4:
{
m4a1g_give(id)
colored_print(id, "!yВы !gуспешно!y купили !tM4A1 Gold!y!")
}
case 5:
{
ak47g_give(id)
colored_print(id, "!yВы !gуспешно!y купили !tAk-47 Gold!y!")
}
case 6:
{
awpg_give(id)
colored_print(id, "!yВы !gуспешно!y купили !tAWP 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_iPrice[8+key])){
colored_print(id, "!tНедостаточно денег! !y(нужно:!g %d$!y)", get_pcvar_num(g_iPrice[8+key]))
return
}
g_bAmmo[id]=true
colored_print(id, "!yВы !gуспешно!y купили !tбесконечные патроны!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_iPrice[8+key])){
colored_print(id, "!tНедостаточно денег! !y(нужно:!g %d$!y)", get_pcvar_num(g_iPrice[8+key]))
return
}
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_smokegrenade")
colored_print(id, "!yВы !gуспешно!y купили !tпак гранат!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, "!tНедостаточно денег! !y(нужно: !g%d$!y)", get_price(id, get_pcvar_num(g_iPrice[8+key])))
return
}
g_bMultijump[id]=true
colored_print(id, "!yВы !gуспешно!y купили !tмульти прыжок!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, "!tНедостаточно денег! !y(нужно:!g %d$!y)", 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, "!yВы !gуспешно!y купили !t450 здоровья!y!")
}
case 1:{
health+=250.0
colored_print(id, "!yВы !gуспешно!y купили !t250 здоровья!y!")
}
case 2:{
health+=95.0
colored_print(id, "!yВы !gуспешно!y купили !t95 здоровья!y!")
}
case 3:{
health+=65.0
colored_print(id, "!yВы !gуспешно!y купили !t65 здоровья!y!")
}
case 4:{
health+=35.0
colored_print(id, "!yВы !gуспешно!y купили !t35 здоровья!y!")
}
case 5:{
health+=15.0
colored_print(id, "!yВы !gуспешно!y купили !t15 здоровья!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, "!tНедостаточно денег! !н(нужно:!g %d$!y)", 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, "!yВы !gуспешно!y купили !t450 брони!y!")
}
case 1:{
armor+=250.0
colored_print(id, "!yВы !gуспешно!y купили !t250 брони!y!")
}
case 2:{
armor+=95.0
colored_print(id, "!yВы !gуспешно!y купили !t95 брони!y!")
}
case 3:{
armor+=65.0
colored_print(id, "!yВы !gуспешно!y купили !t65 брони!y!")
}
case 4:{
armor+=35.0
colored_print(id, "!yВы !gуспешно!y купили !t35 брони!y!")
}
case 5:{
armor+=15.0
colored_print(id, "!yВы !gуспешно!y купили !t15 брони!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, "!tНедостаточно денег! !y(нужно:!g %d$!y)", 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, "!yВы !gуспешно!y купили !t400 гравитации!y!")
}
case 1: {
if(Gravity<=0.65)return
set_pev(id, pev_gravity, 0.65)
colored_print(id, "!yВы !gуспешно!y купили !t500 гравитации!y!")
}
case 2: {
if(Gravity<=0.8)return
set_pev(id, pev_gravity, 0.8)
colored_print(id, "!yВы !gуспешно!y купили !t600 гравитации!y!")
}
case 3: {
if(Gravity<=0.9)return
set_pev(id, pev_gravity, 0.9)
colored_print(id, "!yВы !gуспешно!y купили !t700 гравитации!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, "!tНедостаточно денег! !y(нужно:!g %d$!y)", 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, "!yВы !gуспешно!y купили !tвысокую невидимость!y!")
}
case 1: {
if(RAMT==125.0)return
fm_set_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransAlpha, 125)
colored_print(id, "!yВы !gуспешно!y купили !tсреднюю невидимость!y!")
}
case 2: {
if(RAMT==200.0||RAMT==125.0)return
fm_set_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransAlpha, 200)
colored_print(id, "!yВы !gуспешно!y купили !tнизкую невидимость!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, "!tНедостаточно денег! !y(нужно:!g %d$!y)", 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, "!yВы !gуспешно!y купили !tскорость 420!y!")
}
case 1: {
if(g_fSpeed[id]>=380.0)return
g_fSpeed[id]=380.0
colored_print(id, "!yВы !gуспешно!y купили !tскорость 380!y!")
}
case 2: {
if(g_fSpeed[id]>=340.0)return
g_fSpeed[id]=340.0
colored_print(id, "!yВы !gуспешно!y купили !tскорость 340!y!")
}
case 3: {
if(g_fSpeed[id]>=300.0)return
g_fSpeed[id]=300.0
colored_print(id, "!yВы !gуспешно!y купили !tскорость 300!y!")
}
case 4: {
if(g_fSpeed[id]>=260.0)return
g_fSpeed[id]=260.0
colored_print(id, "!yВы !gуспешно!y купили !tскорость 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, "!tДоступно только !gVIP-клиентам!y!")
return
}
if(dm_get_user_money(id)<get_pcvar_num(g_iPrice[35+key])){
colored_print(id, "!tНедостаточно денег! !y(нужно:!g %d$!y)", 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, "!yВы !gуспешно!y купили !tMp-7 A1!y!")
case 1: scar_give(id), colored_print(id, "!yВы !gуспешно!y купили !tScar!y!")
case 2: k1ase_give(id), colored_print(id, "!yВы !gуспешно!y купили !tK1ase!y!")
case 3: watergun_give(id), colored_print(id, "!yВы !gуспешно!y купили !tWatergun!y!")
case 4: mg36xmas_give(id), colored_print(id, "!yВы !gуспешно!y купили !tMg-36 Xmas!y!")
case 5: f2000_give(id), colored_print(id, "!yВы !gуспешно!y купили !tF-2000!y!")
case 6: aklong_give(id), colored_print(id, "!yВы !gуспешно!y купили !tAk-Long!y!")
case 7: xm8_give(id), colored_print(id, "!yВы !gуспешно!y купили !tXm-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 Float:originF[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)
}