// Автор плагина: Leo_[BH] (http://vk.com/id64427766)
// Создание плагинов на заказ: https://vk.com/cs_rain
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new const pistols[6] = {CSW_GLOCK18, CSW_USP, CSW_P228, CSW_DEAGLE, CSW_FIVESEVEN, CSW_ELITE}
new const primary[18] = {CSW_SCOUT, CSW_XM1014, CSW_MAC10, CSW_AUG, CSW_UMP45, CSW_SG550, CSW_GALIL, CSW_FAMAS, CSW_AWP,
CSW_MP5NAVY, CSW_M249, CSW_M3, CSW_M4A1, CSW_TMP, CSW_G3SG1, CSW_SG552, CSW_AK47, CSW_P90}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new cvar_flag, cvar_round_primary, cvar_round_awp, cvar_grenadepack_limit, cvar_opentime_menu, cvar_auto_open, cvar_chat_show, cvar_custom_type
new Float:time_open_to_menu
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new const pistols_names[7][] = { "", "GLOCK18", "USP", "P228", "DEAGLE", "FIVESEVEN", "ELITE" }
new const pistols_entnames[7][] = { "", "weapon_glock18", "weapon_usp", "weapon_p228", "weapon_deagle", "weapon_fiveseven", "weapon_elite" }
new const bpammo_pistol[7] = { -1, 120, 100, 52, 35, 100, 100 }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new const armor_names[][] = { "Без брони", "Бронежилет", "Бронежилет + Шлем" }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new const nade_names[][] = { "Без гранат", "Все гранаты", "Световые", "Боевая", "Дымовая", "Боевая + Световые" }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
register_plugin("VIP Menu [CS RAIN]", PLUGIN_VERSION, "Leo_[BH]")
register_cvar("cs_rain_vipmenu", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
register_dictionary("vip.txt")
cvar_flag = register_cvar("vipmenu_access", "t")
cvar_round_primary = register_cvar("vipmenu_round_primary", "2")
cvar_round_awp = register_cvar("vipmenu_round_awp", "3")
cvar_grenadepack_limit = register_cvar("vipmenu_grenade_limit", "4")
cvar_opentime_menu = register_cvar("vipmenu_open_time", "30")
cvar_auto_open = register_cvar("vipmenu_auto_open", "1")
cvar_chat_show = register_cvar("vipmenu_chat_show", "1")
cvar_custom_type = register_cvar("vipmenu_custom_type", "3")
register_clcmd("vipmenu", "vipmenu")
register_clcmd("say vipmenu", "vipmenu")
register_clcmd("say /vipmenu", "vipmenu")
register_clcmd("say_team vipmenu", "vipmenu")
register_clcmd("say_team /vipmenu", "vipmenu")
g_msg_SayText = get_user_msgid("SayText")
register_event("TextMsg", "event_game_restart", "a", "2=#Game_will_restart_in")
register_event("TextMsg", "event_game_restart", "a", "2=#Game_Commencing")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
// RegisterHookChain(RG_CBasePlayer_Spawn, "fw_PlayerSpawn_Post", 1)
server_cmd("exec addons/amxmodx/configs/vip/vip.cfg")
public event_game_restart()
public event_round_start()
arrayset(i_round_grenades, get_pcvar_num(cvar_grenadepack_limit), 33)
time_open_to_menu = get_gametime() + get_pcvar_float(cvar_opentime_menu)
public client_connect(id)
i_armor[id] = 2 // броня + шлем
i_nades[id] = 1 // все гранаты
public fw_PlayerSpawn_Post(id)
if(!is_user_alive(id)) return;
if(!has_access_vipmenu(id)) return;
if(get_pcvar_num(cvar_auto_open)) if(round >= get_pcvar_num(cvar_round_primary)) open_vipmenu(id)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
chat_color(id, "%L %L", id, "VIP_CHAT_PREFIX", id, "VIP_CHAT_MAP_BLOCKED")
if(!has_access_vipmenu(id))
chat_color(id, "%L %L", id, "VIP_CHAT_PREFIX", id, "VIP_CHAT_NOT_ACCESS")
static text_vip_menu[9][64]
formatex(text_vip_menu[0], 63, "%L", id, "VIP_MENU_0")
new r_prim = get_pcvar_num(cvar_round_primary)
new r_awp = get_pcvar_num(cvar_round_awp)
formatex(text_vip_menu[1], 63, "\d%L \r[\d%d %s\r]", id, "VIP_MENU_1", r_awp, "раунд")
else if(!is_user_alive(id))
formatex(text_vip_menu[1], 63, "\d%L", id, "VIP_MENU_1")
else if(get_gametime() > time_open_to_menu)
formatex(text_vip_menu[1], 63, "\d%L", id, "VIP_MENU_1")
formatex(text_vip_menu[1], 63, "\w%L", id, "VIP_MENU_1")
formatex(text_vip_menu[2], 63, "\d%L \r[\d%d %s\r]", id, "VIP_MENU_2", r_prim, "раунд")
formatex(text_vip_menu[3], 63, "\d%L \r[\d%d %s\r]", id, "VIP_MENU_3", r_prim, "раунд")
formatex(text_vip_menu[4], 63, "\d%L \r[\d%d %s\r]^n", id, "VIP_MENU_4", r_prim, "раунд")
else if(!is_user_alive(id))
formatex(text_vip_menu[2], 63, "\d%L", id, "VIP_MENU_2")
formatex(text_vip_menu[3], 63, "\d%L", id, "VIP_MENU_3")
formatex(text_vip_menu[4], 63, "\d%L^n", id, "VIP_MENU_4")
else if(get_gametime() > time_open_to_menu)
formatex(text_vip_menu[2], 63, "\d%L", id, "VIP_MENU_2")
formatex(text_vip_menu[3], 63, "\d%L", id, "VIP_MENU_3")
formatex(text_vip_menu[4], 63, "\d%L^n", id, "VIP_MENU_4")
formatex(text_vip_menu[2], 63, "\w%L", id, "VIP_MENU_2")
formatex(text_vip_menu[3], 63, "\w%L", id, "VIP_MENU_3")
formatex(text_vip_menu[4], 63, "\w%L^n", id, "VIP_MENU_4")
new custom_type = get_pcvar_num(cvar_custom_type)
if(custom_type >= 1) formatex(text_vip_menu[5], 63, "%L", id, "VIP_MENU_5", pistols_names[i_pistol[id]])
if(custom_type >= 2) formatex(text_vip_menu[6], 63, "%L", id, "VIP_MENU_6", armor_names[i_armor[id]])
if(custom_type >= 3) formatex(text_vip_menu[7], 63, "%L", id, "VIP_MENU_7", nade_names[i_nades[id]])
formatex(text_vip_menu[8], 63, "%L", id, "VIP_MENU_EXIT")
new menu = menu_create(text_vip_menu[0], "hand_vipmenu")
for (new n = 1; n <= 4+custom_type; n++)
formatex(Number, charsmax(Number), "%i", n)
menu_additem(menu, text_vip_menu[n], Number, 0)
menu_setprop(menu, MPROP_EXITNAME, text_vip_menu[8])
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
public hand_vipmenu(id, menu, item)
new data[6], iName[64], access, callback
menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
if(!is_user_alive(id)) return PLUGIN_HANDLED
if(round < get_pcvar_num(cvar_round_awp))
if(get_gametime() > time_open_to_menu)
client_print(id, print_center, "%L", id, "VIP_MSG_TIME", get_pcvar_num(cvar_opentime_menu))
give_primary_weapon(id, 1)
if(!is_user_alive(id)) return PLUGIN_HANDLED
if(round < get_pcvar_num(cvar_round_primary))
if(get_gametime() > time_open_to_menu)
client_print(id, print_center, "%L", id, "VIP_MSG_TIME", get_pcvar_num(cvar_opentime_menu))
give_primary_weapon(id, 2)
if(!is_user_alive(id)) return PLUGIN_HANDLED
if(round < get_pcvar_num(cvar_round_primary))
if(get_gametime() > time_open_to_menu)
client_print(id, print_center, "%L", id, "VIP_MSG_TIME", get_pcvar_num(cvar_opentime_menu))
give_primary_weapon(id, 3)
if(!is_user_alive(id)) return PLUGIN_HANDLED
if(round < get_pcvar_num(cvar_round_primary))
if(get_gametime() > time_open_to_menu)
client_print(id, print_center, "%L", id, "VIP_MSG_TIME", get_pcvar_num(cvar_opentime_menu))
give_primary_weapon(id, 4)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public open_pistol_menu(id)
new menu = menu_create("\rВыбор пистолета\y:\w", "hand_pistol_menu")
for (new n = 1; n <= 6; n++)
formatex(Number, charsmax(Number), "%i", n)
menu_additem(menu, pistols_names[n], Number, 0)
menu_setprop(menu, MPROP_EXITNAME, "\rОтмена")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
public hand_pistol_menu(id, menu, item)
new data[6], iName[64], access, callback
menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
if(is_user_alive(id)) if(get_gametime() <= time_open_to_menu) give_my_pistol(id)
public open_armor_menu(id)
new menu = menu_create("\rВыбор брони\y:\w", "hand_armor_menu")
for (new n = 1; n <= 3; n++)
formatex(Number, charsmax(Number), "%i", n)
menu_additem(menu, armor_names[n-1], Number, 0)
menu_setprop(menu, MPROP_EXITNAME, "\rОтмена")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
public hand_armor_menu(id, menu, item)
new data[6], iName[64], access, callback
menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
if(is_user_alive(id)) give_my_armor(id)
public open_nade_menu(id)
new menu = menu_create("\rВыбор гранат\y:\w", "hand_grenade_menu")
for (new n = 1; n <= 6; n++)
formatex(Number, charsmax(Number), "%i", n)
menu_additem(menu, nade_names[n-1], Number, 0)
menu_setprop(menu, MPROP_EXITNAME, "\rОтмена")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
public hand_grenade_menu(id, menu, item)
new data[6], iName[64], access, callback
menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
// if(is_user_alive(id)) give_my_grenades(id)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public give_primary_weapon(id, num)
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 30)
if(!get_pcvar_num(cvar_chat_show)) return;
get_user_name(id, name, 31)
chat_color(0, "%L !g%s !tвзял !gAWP !tчерез !gвипменю", id, "VIP_CHAT_PREFIX", name)
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 90)
if(!get_pcvar_num(cvar_chat_show)) return;
get_user_name(id, name, 31)
chat_color(0, "%L !g%s !tвзял !gAK47 !tчерез !gвипменю", id, "VIP_CHAT_PREFIX", name)
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 90)
if(!get_pcvar_num(cvar_chat_show)) return;
get_user_name(id, name, 31)
chat_color(0, "%L !g%s !tвзял !gM4A1 !tчерез !gвипменю", id, "VIP_CHAT_PREFIX", name)
give_item(id, "weapon_famas")
cs_set_user_bpammo(id, CSW_FAMAS, 90)
if(!get_pcvar_num(cvar_chat_show)) return;
get_user_name(id, name, 31)
chat_color(0, "%L !g%s !tвзял !gFAMAS !tчерез !gвипменю", id, "VIP_CHAT_PREFIX", name)
public give_my_pistol(id)
give_item(id, pistols_entnames[i_pistol[id]])
cs_set_user_bpammo(id, pistols[i_pistol[id]-1], bpammo_pistol[i_pistol[id]])
case 1: cs_set_user_armor(id, 100, CsArmorType:1)
case 2: cs_set_user_armor(id, 100, CsArmorType:2)
public give_my_grenades(id)
if(i_round_grenades[id] <= 0)
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_smokegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_hegrenade")
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public remove_primary(id)
for(new i = 0; i < 18; i++)
fm_strip_user_gun(id, primary[i])
public remove_secondary(id)
for(new i = 0; i < 6; i++)
fm_strip_user_gun(id, pistols[i])
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new got_line, line_num, len
new cfgpath[256], mapname[64], txt[256]
format(cfgpath, 256, "addons/amxmodx/configs/vip/maps_block.ini")
if (file_exists(cfgpath))
got_line = read_file(cfgpath, line_num, txt, 255, len)
if (containi(mapname, txt) != -1)
got_line = read_file(cfgpath, line_num, txt, 255, len)
stock bool:has_access_vipmenu(id)
get_flags(get_user_flags(id), u_flags, 31)
get_pcvar_string(cvar_flag, g_szFlagMenu, 31)
return (containi(u_flags,g_szFlagMenu) != -1) ? true : false
stock chat_color(const id, const input[], any:...)
new count = 1, players[32];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4"); // Green Color
replace_all(msg, 190, "!y", "^1"); // Default Color
replace_all(msg, 190, "!t", "^3"); // Team Color
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, g_msg_SayText, _, players[i]);
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Автор плагина: Leo_[BH]
// Мои плагины: http://vk.com/cs_rain
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Я предоставляю услуги в сфере Amx Mod X
// Написание плагинов на заказ: https://goo.gl/forms/7DwrBdaTnc0pJRqy2
// Создание сборки сервера под ключ: https://goo.gl/forms/GIyvSAw1IJ48szDn2
// Магазин плагинов: https://vk.com/cs_rain
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =