Автор: neygomon. Помощь по коду: s1lent
* Чат-тег сообщений от випки [Не игрока в чате, а от плагина]
* Звук и соощение при подключении игрока
* WeaponMenu for VIP(vipmenu, /vipmenu) - оружия: ak47, m4a1, awp, пулемет.
Так же чат команды: /ak47, /m4a1, /awp, /b51.
* VIP статус в TAB (нормальным способом, а не через ж... как в предыдущей версии)
* При спавне VIP игрока выдает дигл(отключаемо), гранаты(отключаемо), броню.
Используемые модули: cstrike, fakemeta, hamsandwich, colorchat
new bool:iUseWeapon[33], bool:bDefuse, bool:g_iBlockBonus;
new const PRIMARY_WEAPONS_BITSUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
new const SECONDARY_WEAPONS_BITSUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
register_plugin("VIPka", "1.3.3", "neygomon");
register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w");
register_event("Damage","eventDamage","b","2!0","3=0","4!0");
register_event("DeathMsg","eventDeathMsg","a","1>0");
register_event("HLTV","eRoundStart","a","1=0","2=0");
if(!engfunc(EngFunc_FindEntityByString,FM_NULLENT,"classname","func_vip_safetyzone"))
register_message(get_user_msgid("ScoreAttrib"),"MessageScoreAttrib");
if(engfunc(EngFunc_FindEntityByString,FM_NULLENT,"classname","func_bomb_target"))
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1);
register_clcmd("say /vipmenu", "CmdMenu");
register_clcmd("vipmenu", "CmdMenu");
register_clcmd("say", "hook_say");
register_clcmd("say_team", "hook_say");
register_menucmd(register_menuid("Vip Menu"), MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "handler");
new iMap_Name[32], iMap_Prefix[][] = { "awp_", "aim_", "35hp", "fy_" };
get_mapname(iMap_Name, charsmax(iMap_Name))
for(new i; i < sizeof iMap_Prefix; i++)
if(containi(iMap_Name, iMap_Prefix[i]) != -1)
public client_putinserver(id)
if(!is_user_vip(id)) return;
static name[32]; get_user_name(id, name, charsmax(name));
client_print_color(0, 0, "%s На сервер зашёл ^3VIP мажор^1%s", CHATTAG, name);
arrayset(iUseWeapon, false, 33);
static attID; attID = get_user_attacker(id);
if(is_user_connected(attID) && iUserVip[attID])
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1);
show_hudmessage(attID, "%i^n", read_data(2));
static killerID; killerID = read_data(1);
killer_HP = get_user_health(killerID);
addHP = ((read_data(3) == 1)) ? ADDHP_HS : ADDHP;
fm_set_user_health(killerID, ((killer_HP += addHP) > MAXHP)? MAXHP : killer_HP);
set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1);
show_hudmessage(killerID, "Добавлено +%d HP", addHP);
if(g_iBlockBonus || !is_user_alive(id)) return 0;
if(is_user_vip(id)) iUserVip[id] = true;
else return iUserVip[id] = false;
fm_give_item(id, "weapon_hegrenade");
fm_give_item(id, "weapon_flashbang");
fm_give_item(id, "weapon_smokegrenade");
cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
give_item_ex(id,"weapon_deagle",35,1)
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
if(bDefuse && cs_get_user_team(id) == CS_TEAM_CT) cs_set_user_defuse(id, 1);
static szMsg[128]; read_args(szMsg, 127); remove_quotes(szMsg);
if(szMsg[0] != '/') return 0;
static const szChoosedWP[][] = { "/ak47", "/m4a1", "/awp", "/b51" };
for(new a; a < sizeof szChoosedWP; a++)
if(!strcmp(szMsg, szChoosedWP[a]))
if(!is_allow_use(id)) break;
if(a > 1 && g_roundCount < AWPM249RND) return client_print_color(id, 0, "%s Данное оружие доступно только с^3 %d ^4раунда!", CHATTAG, AWPM249RND);
if(!is_allow_use(id)) return 0;
static szMenu[512], iLen, iKey;
iKey = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2;
iLen = formatex(szMenu, 511, "\yVIP \wWeaponMenu^n^n\y1. \wВзять AK47^n\y2. \wВзять M4A1^n");
if(g_roundCount < AWPM249RND)
iLen += formatex(szMenu[iLen], 511 - iLen, "\y3. \dВзять AWP \r[c %d раунда]^n\y4. \dВзять Пулемет \r[c %d раунда]^n^n", AWPM249RND, AWPM249RND);
iKey |= MENU_KEY_3|MENU_KEY_4;
iLen += formatex(szMenu[iLen], 511 - iLen, "\y3. \wВзять AWP^n\y4. \wВзять Пулемет^n^n");
formatex(szMenu[iLen], 511 - iLen, "\y0. \wВыход");
set_pdata_int(id, 205, 0);
return show_menu(id, iKey, szMenu, -1, "Vip Menu");
if(iKey > 3 || iUseWeapon[id]) return 0;
static const szChoosedBP[] = { 90, 90, 30, 250 };
static const szChoosedWP[][] = { "weapon_ak47", "weapon_m4a1", "weapon_awp", "weapon_m249" };
return give_item_ex(id, szChoosedWP[iKey], szChoosedBP[iKey], 1);
stock give_item_ex(id,currWeaponName[],ammoAmount,dropFlag=0)
static weaponsList[32], weaponName[32], weaponsNum, currWeaponID;
currWeaponID = get_weaponid(currWeaponName);
get_user_weapons(id,weaponsList,weaponsNum);
for (new i;i < weaponsNum;i++)
if(((1 << currWeaponID) & PRIMARY_WEAPONS_BITSUM && (1 << weaponsList[i]) & PRIMARY_WEAPONS_BITSUM) | ((1 << currWeaponID) & SECONDARY_WEAPONS_BITSUM && (1 << weaponsList[i]) & SECONDARY_WEAPONS_BITSUM))
get_weaponname(weaponsList[i],weaponName,charsmax(weaponName));
engclient_cmd(id,"drop",weaponName);
fm_give_item(id,currWeaponName);
cs_set_user_bpammo(id,currWeaponID,ammoAmount);
client_print_color(id, 0, "%s ^3Только VIP-игрок ^4может пользоваться этой командой!", CHATTAG);
client_print_color(id, 0, "%s Для использования данной команды вы должны быть ^3живы^4!", CHATTAG);
client_print_color(id, 0, "%s Разминочный раунд. ^3Запрещено ^4пользоваться командой!", CHATTAG);
client_print_color(id, 0, "%s Вы ^3уже брали ^4оружие в этом раунде!", CHATTAG);
if(g_roundCount < VIPROUND)
client_print_color(id, 0, "%s Оружия доступны только с^3 %d ^4раунда!", CHATTAG, VIPROUND);
public MessageScoreAttrib(iMsgId, iDest, iReceiver)
static id; id = get_msg_arg_int(1);
if(is_user_vip(id) && !get_msg_arg_int(2))
set_msg_arg_int(2, ARG_BYTE, 4);