#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta_util>
#pragma tabsize 0
#define DEMONAME "Public_CS_GO"
#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define ADVERT_ALL // Показывать всем. Для показа только мервым и спектаторам закомментируйте
#define REPEAT_TIME 20.0 // Время между сообщениями
new adMessages[256][192];
new ad_count, iMessgCount;
new bool:g_bAllowRecord[33];
const XoWeapon = 4;
const XoPlayer = 5;
const m_pPlayer = 41;
const m_flNextPrimaryAttack = 46;
const m_flTimeWeaponIdle = 48;
const m_fInSpecialReload = 55;
const m_flNextAttack = 83;
const m_pActiveItem = 373;
const m_iId = 43;
new const wpns_without_inspect = (1 << CSW_C4) | (1 << CSW_HEGRENADE) | (1 << CSW_FLASHBANG) | (1 << CSW_SMOKEGRENADE);
new const wpns_scoped = (1 << CSW_AUG) | (1 << CSW_AWP) | (1 << CSW_G3SG1) | (1 << CSW_SCOUT) | (1 << CSW_SG550) | (1 << CSW_SG552);
new Float:g_flOrigin[3], Float:g_flAngles[3], g_fwdSetModel
new g_deagle_overide[33];
new inspect_anim[] =
{
0, //null
7, //p228
0, //shield
5, //scout
0, //hegrenade
7, //xm1014
0, //c4
6, //mac10
6, //aug
0, //smoke grenade
16, //elites
6, //fiveseven
6, //ump45
5, //sg550
6, //galil
6, //famas
16, //usp
13, //glock
6, //awp
6, //mp5
5, //m249
7, //m3
15, //m4a1
6, //tmp
6, //g3sg1
0, //flashbang
6, //deagle
6, //sg552
6, //ak47
8, //knife
6 //p90
}
new Float:idle_calltime[] =
{
0.0, //null
6.5, //p228
0.0, //shield
5.3, //scout
0.0, //hegrenade
4.6, //xm1014
0.0, //c4
5.3, //mac10
4.4, //aug
0.0, //smoke grenade
4.6, //elites
6.5, //fiveseven
6.9, //ump45
5.3, //sg550
4.6, //galil
6.4, //famas
6.5, //usp
6.5, //glock
5.0, //awp
7.7, //mp5
6.9, //m249
5.6, //m3
5.1, //m4a1
7.4, //tmp
4.5, //g3sg1
0.0, //flashbang
5.7, //deagle
4.4, //sg552
4.6, //ak47
6.3, //knife
5.4 //p90
}
new weapon_classnames[][] =
{
"weapon_p228",
"weapon_elite",
"weapon_fiveseven",
"weapon_usp",
"weapon_glock18",
"weapon_deagle",
"weapon_ak47",
"weapon_m4a1",
"weapon_awp",
"weapon_mp5navy",
"weapon_ump45",
"weapon_galil",
"weapon_famas",
"weapon_sg552",
"weapon_aug",
"weapon_mac10",
"weapon_tmp",
"weapon_scout",
"weapon_m3",
"weapon_xm1014",
"weapon_g3sg1",
"weapon_sg550",
"weapon_m249",
"weapon_knife",
"weapon_p90"
}
new keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
new KnifeId[33];
new Trie:g_tReplaceInfoMsg;
new KNIFE_V_MODEL1[] = "models/csgo/skins/knife/v_bayonet.mdl"
new KNIFE_V_MODEL2[] = "models/csgo/skins/knife/v_falchion.mdl"
new KNIFE_V_MODEL3[] = "models/csgo/skins/knife/v_gut.mdl"
new KNIFE_V_MODEL4[] = "models/csgo/skins/knife/v_karambit.mdl"
new KNIFE_V_MODEL5[] = "models/csgo/skins/knife/v_m9bayonet.mdl"
new KNIFE_V_MODEL6[] = "models/csgo/skins/knife/v_butterfly.mdl"
new KNIFE_V_MODEL7[] = "models/csgo/skins/knife/v_stiletto.mdl"
new KNIFE_V_MODEL8[] = "models/csgo/skins/knife/v_knives_ct.mdl"
new KNIFE_V_MODEL9[] = "models/csgo/skins/knife/v_knives_t.mdl"
new KNIFE_P_MODEL1[] = "models/csgo/skins/knife/p_bayonet.mdl"
new KNIFE_P_MODEL2[] = "models/csgo/skins/knife/p_falchion.mdl"
new KNIFE_P_MODEL3[] = "models/csgo/skins/knife/p_gut.mdl"
new KNIFE_P_MODEL4[] = "models/csgo/skins/knife/p_karambit.mdl"
new KNIFE_P_MODEL5[] = "models/csgo/skins/knife/p_m9bayonet.mdl"
new KNIFE_P_MODEL6[] = "models/csgo/skins/knife/p_butterfly.mdl"
new KNIFE_P_MODEL7[] = "models/csgo/skins/knife/p_stiletto.mdl"
new KNIFE_P_MODEL8[] = "models/csgo/skins/knife/p_knives_ct.mdl"
new KNIFE_P_MODEL9[] = "models/csgo/skins/knife/p_knives_t.mdl"
new W_BOMB_MODEL[] = "models/csgo/default/w_c4.mdl"
new g_Sounds[][] =
{
// ak47 sounds
"sound/weapons/csgo_mod/ak47/boltpull.wav",
"sound/weapons/csgo_mod/ak47/clipin.wav",
"sound/weapons/csgo_mod/ak47/clipout.wav",
"sound/weapons/csgo_mod/ak47/draw.wav",
// aug sounds
"sound/weapons/csgo_mod/aug/boltpull.wav",
"sound/weapons/csgo_mod/aug/boltrelease.wav",
"sound/weapons/csgo_mod/aug/clipin.wav",
"sound/weapons/csgo_mod/aug/clipout.wav",
"sound/weapons/csgo_mod/aug/cliptap.wav",
"sound/weapons/csgo_mod/aug/draw.wav",
// awp sounds
"sound/weapons/csgo_mod/awp/boltdown.wav",
"sound/weapons/csgo_mod/awp/boltup.wav",
"sound/weapons/csgo_mod/awp/clipin.wav",
"sound/weapons/csgo_mod/awp/clipout.wav",
"sound/weapons/csgo_mod/awp/cliptap.wav",
"sound/weapons/csgo_mod/awp/draw.wav",
// beretta sounds
"sound/weapons/csgo_mod/berettas/slide.wav",
"sound/weapons/csgo_mod/berettas/taunt_tap.wav",
"sound/weapons/csgo_mod/berettas/clipin.wav",
"sound/weapons/csgo_mod/berettas/clipout.wav",
"sound/weapons/csgo_mod/berettas/hammer.wav",
"sound/weapons/csgo_mod/berettas/draw.wav",
// butterfly sounds
"sound/weapons/csgo_mod/butterfly/backstab.wav",
"sound/weapons/csgo_mod/butterfly/deploy_end.wav",
"sound/weapons/csgo_mod/butterfly/deploy_start.wav",
"sound/weapons/csgo_mod/butterfly/inspect_end.wav",
"sound/weapons/csgo_mod/butterfly/inspect_flip1.wav",
"sound/weapons/csgo_mod/butterfly/inspect_flip2.wav",
"sound/weapons/csgo_mod/butterfly/inspect_flip3.wav",
"sound/weapons/csgo_mod/butterfly/inspect_start.wav",
// c4 bomb sounds
"sound/weapons/csgo_mod/c4/disarmfinish.wav",
"sound/weapons/csgo_mod/c4/disarmstart.wav",
"sound/weapons/csgo_mod/c4/draw.wav",
"sound/weapons/csgo_mod/c4/initiate.wav",
"sound/weapons/csgo_mod/c4/plant_quiet.wav",
"sound/weapons/csgo_mod/c4/press1.wav",
"sound/weapons/csgo_mod/c4/press2.wav",
"sound/weapons/csgo_mod/c4/press3.wav",
"sound/weapons/csgo_mod/c4/press4.wav",
"sound/weapons/csgo_mod/c4/press5.wav",
"sound/weapons/csgo_mod/c4/press6.wav",
"sound/weapons/csgo_mod/c4/press7.wav",
// deagle sounds
"sound/weapons/csgo_mod/deagle/slideback.wav",
"sound/weapons/csgo_mod/deagle/slideforward.wav",
"sound/weapons/csgo_mod/deagle/clipin.wav",
"sound/weapons/csgo_mod/deagle/clipout.wav",
"sound/weapons/csgo_mod/deagle/inspect_roll.wav",
"sound/weapons/csgo_mod/deagle/draw.wav",
// falchion sounds
"sound/weapons/csgo_mod/falchion/catch.wav",
"sound/weapons/csgo_mod/falchion/deploy_end.wav",
"sound/weapons/csgo_mod/falchion/deploy_start.wav",
"sound/weapons/csgo_mod/falchion/inspect_end.wav",
"sound/weapons/csgo_mod/falchion/inspect_start.wav",
// famas sounds
"sound/weapons/csgo_mod/famas/boltback.wav",
"sound/weapons/csgo_mod/famas/boltforward.wav",
"sound/weapons/csgo_mod/famas/cliphit.wav",
"sound/weapons/csgo_mod/famas/clipin.wav",
"sound/weapons/csgo_mod/famas/clipout.wav",
"sound/weapons/csgo_mod/famas/draw.wav",
// fiveseven sounds
"sound/weapons/csgo_mod/fiveseven/slideback.wav",
"sound/weapons/csgo_mod/fiveseven/sliderelease.wav",
"sound/weapons/csgo_mod/fiveseven/clipin.wav",
"sound/weapons/csgo_mod/fiveseven/clipout.wav",
"sound/weapons/csgo_mod/fiveseven/draw.wav",
// g3sg1 sounds
"sound/weapons/csgo_mod/g3sg1/slideback.wav",
"sound/weapons/csgo_mod/g3sg1/slideforward.wav",
"sound/weapons/csgo_mod/g3sg1/clipin.wav",
"sound/weapons/csgo_mod/g3sg1/clipout.wav",
"sound/weapons/csgo_mod/g3sg1/draw.wav",
// galil sounds
"sound/weapons/csgo_mod/galil/boltback.wav",
"sound/weapons/csgo_mod/galil/boltrelease.wav",
"sound/weapons/csgo_mod/galil/clipin.wav",
"sound/weapons/csgo_mod/galil/clipout.wav",
"sound/weapons/csgo_mod/galil/draw.wav",
// glock18 sounds
"sound/weapons/csgo_mod/glock18/slideback.wav",
"sound/weapons/csgo_mod/glock18/sliderelease.wav",
"sound/weapons/csgo_mod/glock18/clipin.wav",
"sound/weapons/csgo_mod/glock18/clipout.wav",
"sound/weapons/csgo_mod/glock18/draw.wav",
// grenades sounds
"sound/weapons/csgo_mod/grenades/draw.wav",
"sound/weapons/csgo_mod/grenades/pinpull.wav",
"sound/weapons/csgo_mod/grenades/throw.wav",
// knife sounds
"sound/weapons/csgo_mod/knife/deploy.wav",
// m4a1-s sounds
"sound/weapons/csgo_mod/m4a1s/boltback.wav",
"sound/weapons/csgo_mod/m4a1s/boltforward.wav",
"sound/weapons/csgo_mod/m4a1s/boltpull.wav",
"sound/weapons/csgo_mod/m4a1s/clipin.wav",
"sound/weapons/csgo_mod/m4a1s/clipout.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_deploy.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_1.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_2.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_3.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_4.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_5.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_off_end.wav",
"sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_on_start.wav",
// mac-10 sounds
"sound/weapons/csgo_mod/mac10/boltback.wav",
"sound/weapons/csgo_mod/mac10/boltforward.wav",
"sound/weapons/csgo_mod/mac10/clipin.wav",
"sound/weapons/csgo_mod/mac10/clipout.wav",
"sound/weapons/csgo_mod/mac10/draw.wav",
// mp5sd sounds
"sound/weapons/csgo_mod/mp5/slideback.wav",
"sound/weapons/csgo_mod/mp5/slideforward.wav",
"sound/weapons/csgo_mod/mp5/clipin.wav",
"sound/weapons/csgo_mod/mp5/clipout.wav",
"sound/weapons/csgo_mod/mp5/draw.wav",
// mp9 sounds
"sound/weapons/csgo_mod/mp9/slideback.wav",
"sound/weapons/csgo_mod/mp9/slideforward.wav",
"sound/weapons/csgo_mod/mp9/clipin.wav",
"sound/weapons/csgo_mod/mp9/clipout.wav",
"sound/weapons/csgo_mod/mp9/draw.wav",
// negev sounds
"sound/weapons/csgo_mod/negev/chain.wav",
"sound/weapons/csgo_mod/negev/coverup.wav",
"sound/weapons/csgo_mod/negev/coverdown.wav",
"sound/weapons/csgo_mod/negev/pump.wav",
"sound/weapons/csgo_mod/negev/boxin.wav",
"sound/weapons/csgo_mod/negev/boxout.wav",
"sound/weapons/csgo_mod/negev/draw.wav",
// nova sounds
"sound/weapons/csgo_mod/nova/bolt.wav",
"sound/weapons/csgo_mod/nova/draw.wav",
"sound/weapons/csgo_mod/nova/insert.wav",
// p90 sounds
"sound/weapons/csgo_mod/p90/boltback.wav",
"sound/weapons/csgo_mod/p90/boltrelease.wav",
"sound/weapons/csgo_mod/p90/clipin.wav",
"sound/weapons/csgo_mod/p90/clipout.wav",
"sound/weapons/csgo_mod/p90/tap.wav",
// p250 sounds
"sound/weapons/csgo_mod/p250/slideback.wav",
"sound/weapons/csgo_mod/p250/sliderelease.wav",
"sound/weapons/csgo_mod/p250/clipin.wav",
"sound/weapons/csgo_mod/p250/clipout.wav",
"sound/weapons/csgo_mod/p250/draw.wav",
// scar-20 sounds
"sound/weapons/csgo_mod/scar20/boltback.wav",
"sound/weapons/csgo_mod/scar20/boltforward.wav",
"sound/weapons/csgo_mod/scar20/clipin.wav",
"sound/weapons/csgo_mod/scar20/clipout.wav",
// sg553 sounds
"sound/weapons/csgo_mod/sg553/pull.wav",
"sound/weapons/csgo_mod/sg553/release.wav",
"sound/weapons/csgo_mod/sg553/clipin.wav",
"sound/weapons/csgo_mod/sg553/clipout.wav",
"sound/weapons/csgo_mod/sg553/draw.wav",
// stiletto sounds
"sound/weapons/csgo_mod/stiletto/deploy.wav",
"sound/weapons/csgo_mod/stiletto/flip_1.wav",
"sound/weapons/csgo_mod/stiletto/flip_2.wav",
"sound/weapons/csgo_mod/stiletto/flip_3.wav",
"sound/weapons/csgo_mod/stiletto/flip_4.wav",
// ssg-08 sounds
"sound/weapons/csgo_mod/ssg08/boltback.wav",
"sound/weapons/csgo_mod/ssg08/boltrelease.wav",
"sound/weapons/csgo_mod/ssg08/clipin.wav",
"sound/weapons/csgo_mod/ssg08/clipout.wav",
"sound/weapons/csgo_mod/ssg08/cliptap.wav",
"sound/weapons/csgo_mod/ssg08/draw.wav",
// ump45 sounds
"sound/weapons/csgo_mod/ump45/boltslap.wav",
"sound/weapons/csgo_mod/ump45/boltrelease.wav",
"sound/weapons/csgo_mod/ump45/clipin.wav",
"sound/weapons/csgo_mod/ump45/clipout.wav",
"sound/weapons/csgo_mod/ump45/draw.wav",
// usp sounds
"sound/weapons/csgo_mod/usp/clipin.wav",
"sound/weapons/csgo_mod/usp/clipout.wav",
"sound/weapons/csgo_mod/usp/draw.wav",
"sound/weapons/csgo_mod/usp/draw_slide.wav",
"sound/weapons/csgo_mod/usp/silencer_screw1.wav",
"sound/weapons/csgo_mod/usp/silencer_screw2.wav",
"sound/weapons/csgo_mod/usp/silencer_screw3.wav",
"sound/weapons/csgo_mod/usp/silencer_screw4.wav",
"sound/weapons/csgo_mod/usp/silencer_screw5.wav",
"sound/weapons/csgo_mod/usp/silencer_screw_off_end.wav",
"sound/weapons/csgo_mod/usp/silencer_screw_on_start.wav",
// xm1014 sounds
"sound/weapons/csgo_mod/xm1014/draw.wav",
"sound/weapons/csgo_mod/xm1014/insert.wav",
"sound/weapons/csgo_mod/xm1014/movement1.wav"
}
public plugin_init()
{
register_plugin("[#] CS:GO Main Mode", "1.1 [FIX]", "x FR3NZYMOV x");
// server menu client commands
register_clcmd("say /menu", "ClCmd_ServerMenu");
register_clcmd("say_team /menu", "ClCmd_ServerMenu");
register_clcmd("menu", "ClCmd_ServerMenu");
register_clcmd("/menu", "ClCmd_ServerMenu");
register_clcmd("chooseteam", "ClCmd_ServerMenu");
// reset score client commands
register_clcmd("say /rs", "ClCmd_ResetScore");
register_clcmd("say /resetscore", "ClCmd_ResetScore");
register_clcmd("say_team /rs", "ClCmd_ResetScore");
register_clcmd("say_team /resetscore", "ClCmd_ResetScore");
// price motd client commands
register_clcmd("say /price","ClCmd_PriceMotd");
register_clcmd("say_team /price","ClCmd_PriceMotd");
// demo record client commands
register_clcmd("joinclass", "ClCmd_StartDemo");
register_clcmd("menuselect", "ClCmd_StartDemo");
// hook radio menu's
register_clcmd("radio1", "ClCmd_HookRadio");
register_clcmd("radio2", "ClCmd_HookRadio");
register_clcmd("radio3", "ClCmd_HookRadio");
// hook spray button
register_impulse(201, "Impulse_HookSpray");
// task for adverts in chat
set_task(REPEAT_TIME, "Msg_AdvertChat", .flags="b");
// handles for menus
register_menucmd(register_menuid("Show_KnifeMenu"), keys, "Handle_KnifeMenu");
register_menucmd(register_menuid("Show_ServerMenu"), keys, "Handle_ServerMenu");
register_menucmd(register_menuid("Show_PlayerMenu"), keys, "Handle_PlayerMenu");
register_menucmd(register_menuid("Show_ShopMenu"), keys, "Handle_ShopMenu");
register_menucmd(register_menuid("Show_AdminMenu"), keys, "Handle_AdminMenu");
register_menucmd(register_menuid("Show_EliteMenu"), keys, "Handle_EliteMenu");
register_menucmd(register_menuid("Show_StyleMenu"), keys, "Handle_StyleMenu");
register_menucmd(register_menuid("Show_MafiozeMenu"), keys, "Handle_MafiozeMenu");
register_menucmd(register_menuid("Show_BackroomMenu"), keys, "Handle_BackroomMenu");
register_menucmd(register_menuid("Show_BackroomMenu"), keys, "Handle_BackroomMenu");
register_event("CurWeapon", "give_item1", "be", "1=1");
register_event("CurWeapon", "give_item2", "be", "1=1");
register_event("CurWeapon", "give_item3", "be", "1=1");
register_event("CurWeapon", "give_item4", "be", "1=1");
register_event("CurWeapon", "give_item5", "be", "1=1");
register_event("CurWeapon", "give_item6", "be", "1=1");
register_event("CurWeapon", "give_item7", "be", "1=1");
register_event("CurWeapon", "give_item8", "be", "1=1");
// impulse for inspect weapon (button F)
register_impulse(100, "Inspect_Weapon");
for(new i = 0; i < sizeof weapon_classnames; i++)
RegisterHam(Ham_Weapon_PrimaryAttack, weapon_classnames[i], "Fw_Weapon_PrimaryAttack", 1);
// two anim inspect's for deagle
RegisterHam(Ham_Item_Deploy, "weapon_deagle", "Fw_Deagle_Disable");
RegisterHam(Ham_Weapon_Reload, "weapon_deagle", "Fw_Deagle_Disable");
// not inspect weapons on scope
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_aug", "Fw_Weapon_SecondaryAttack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_awp", "Fw_Weapon_SecondaryAttack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_g3sg1", "Fw_Weapon_SecondaryAttack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_scout", "Fw_Weapon_SecondaryAttack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_sg550", "Fw_Weapon_SecondaryAttack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_sg552", "Fw_Weapon_SecondaryAttack");
// detecting map with bomb
if(fm_find_ent_by_class(FM_NULLENT, "info_bomb_target") || fm_find_ent_by_class(FM_NULLENT, "func_bomb_target"))
{
// event planting/defusing bomb
register_event("BarTime", "Event_PlantBomb", "be", "1=3")
register_event("BarTime", "Event_DefuseBomb", "be", "1=5", "1=10")
// log event planting/defusing bomb
register_logevent("LogEvent_RoundEnd",2,"1=Round_End")
register_logevent("LogEvent_PlantBomb",3,"2=Defused_The_Bomb")
register_logevent("LogEvent_DefuseBomb",3,"2=Planted_The_Bomb")
}
// replace message
register_message(get_user_msgid("TextMsg"), "Msg_MessageText");
g_tReplaceInfoMsg = TrieCreate();
Msg_ReplaceMessage();
}
public plugin_precache()
{
// precache knife v_ models
precache_model(KNIFE_V_MODEL1)
precache_model(KNIFE_V_MODEL2)
precache_model(KNIFE_V_MODEL3)
precache_model(KNIFE_V_MODEL4)
precache_model(KNIFE_V_MODEL5)
precache_model(KNIFE_V_MODEL6)
precache_model(KNIFE_V_MODEL7)
precache_model(KNIFE_V_MODEL8)
precache_model(KNIFE_V_MODEL9)
// precache knife p_ models
precache_model(KNIFE_P_MODEL1)
precache_model(KNIFE_P_MODEL2)
precache_model(KNIFE_P_MODEL3)
precache_model(KNIFE_P_MODEL4)
precache_model(KNIFE_P_MODEL5)
precache_model(KNIFE_P_MODEL6)
precache_model(KNIFE_P_MODEL7)
precache_model(KNIFE_P_MODEL8)
precache_model(KNIFE_P_MODEL9)
// precache c4 model
precache_model(W_BOMB_MODEL)
// precache sounds
for(new i; i < sizeof(g_Sounds); i++)
{
precache_generic(g_Sounds[i]);
}
}
public plugin_cfg()
{
new configsdir[64], filename[64], file;
get_localinfo("amxx_configsdir", configsdir,charsmax(configsdir));
formatex(filename, charsmax(filename), "%s/csgo/csgo_adverts.ini",configsdir);
file = fopen(filename,"r");
if(file)
{
new string[512], message[192];
while((ad_count < 256) && !feof(file))
{
fgets(file, string, charsmax(string));
if((string[0] != ';') && (string[0] != '/') && parse(string, message, charsmax(message)))
{
format_color(message, charsmax(message));
copy(adMessages[ad_count], 192, message);
ad_count++;
}
}
fclose(file);
}
else
log_amx("* Файла ^"%s^" не существует *", filename);
}
public ClCmd_HookRadio(id)
{
client_print(id, print_center, "* Радио сообщения недоступны *")
return PLUGIN_HANDLED;
}
public Impulse_HookSpray(id)
{
client_print(id, print_center, "* Рисование спрея недоступно *")
return PLUGIN_HANDLED;
}
public Msg_AdvertChat()
{
if(!ad_count) return;
#if defined ADVERT_ALL
client_print_color(0, 0, "%s", adMessages[iMessgCount == ad_count ? (iMessgCount = 0) : iMessgCount++]);
#else
static players[32], pcount;
get_players(players, pcount, "bch");
for(new i; i < pcount; i++)
{
client_print_color(players[i], 0, "%s", adMessages[iMessgCount == ad_count ? (iMessgCount = 0) : iMessgCount++]);
}
#endif
}
public client_putinserver(id)
{
// if player connected
KnifeId[id] = 8
}
public ClCmd_StartDemo(id)
{
// start rec demo
if(g_bAllowRecord[id])
{
Msg_StartDemo(id);
g_bAllowRecord[id] = false;
}
}
public Msg_StartDemo(id)
{
// chat message of rec demo
if(!is_user_connected(id))
return;
client_cmd(id, "stop; record ^"%s^"", DEMONAME);
new datee[30];get_time("%d.%m.%Y | %H:%M:%S", datee, charsmax(datee));
SendMsg(id, "* Идет запись демо %s.dem *", DEMONAME);
SendMsg(id, "* Время записи: ^4%s^1 *", datee);
}
public Msg_ReplaceMessage()
{
// replace messages
TrieSetString(g_tReplaceInfoMsg, "#Game_Commencing", "* Игра началась *");
TrieSetString(g_tReplaceInfoMsg, "#Game_will_restart_in", "* Рестарт игры произойдет через %s секунд *");
TrieSetString(g_tReplaceInfoMsg, "#CTs_Win", "* Контр-Террористы победили *");
TrieSetString(g_tReplaceInfoMsg, "#Terrorists_Win", "* Террористы победили *");
TrieSetString(g_tReplaceInfoMsg, "#Round_Draw", "* Раунд закончился вничью *");
TrieSetString(g_tReplaceInfoMsg, "#Target_Bombed", "* Цель уничтожена *");
TrieSetString(g_tReplaceInfoMsg, "#Target_Saved", "* Цель спасена *");
TrieSetString(g_tReplaceInfoMsg, "#Hostages_Not_Rescued", "* Не удалось спасти заложников *");
TrieSetString(g_tReplaceInfoMsg, "#All_Hostages_Rescued", "* Все заложники спасены *");
TrieSetString(g_tReplaceInfoMsg, "#VIP_Escaped", "* VIP-игрок спасен *");
TrieSetString(g_tReplaceInfoMsg, "#VIP_Assassinated", "* VIP-игрок убит *");
TrieSetString(g_tReplaceInfoMsg, "#C4_Arming_Cancelled", "* Бомба может быть установлена только в зоне установки бомбы *");
TrieSetString(g_tReplaceInfoMsg, "#C4_Plant_Must_Be_On_Ground", "* Для установки бобмы Вы должны находиться на земле *");
TrieSetString(g_tReplaceInfoMsg, "#Defusing_Bomb_With_Defuse_Kit", "* Обезвреживание бомбы с набором сапёра *");
TrieSetString(g_tReplaceInfoMsg, "#Defusing_Bomb_Without_Defuse_Kit", "* Обезвреживание бомбы без набора сапёра *");
TrieSetString(g_tReplaceInfoMsg, "#Weapon_Cannot_Be_Dropped", "* Нельзя выбросить данное оружие *");
TrieSetString(g_tReplaceInfoMsg, "#C4_Plant_At_Bomb_Spot", "* Бомба может быть установлена только в зоне установки бомбы *");
TrieSetString(g_tReplaceInfoMsg, "#Cannot_Carry_Anymore", "* Вы не можете взять больше *");
TrieSetString(g_tReplaceInfoMsg, "#Already_Have_Kevlar", "* У вас уже имеется бронежилет *");
TrieSetString(g_tReplaceInfoMsg, "#Already_Have_Kevlar_Helmet", "* У вас уже имеется бронежилет и шлем *");
TrieSetString(g_tReplaceInfoMsg, "#Switch_To_BurstFire", "* Переключен в режим пулеметного огня *");
TrieSetString(g_tReplaceInfoMsg, "#Switch_To_FullAuto", "* Переключен в автоматический режим *");
TrieSetString(g_tReplaceInfoMsg, "#Switch_To_SemiAuto", "* Переключен в полуавтоматический режим *");
TrieSetString(g_tReplaceInfoMsg, "#Already_Own_Weapon", "* У вас уже имеется данное оружие *");
TrieSetString(g_tReplaceInfoMsg, "#Command_Not_Available", "* Данное действие недоступно в Вашем местонахождении *");
TrieSetString(g_tReplaceInfoMsg, "#Got_bomb", "* Вы подобрали бомбу *");
TrieSetString(g_tReplaceInfoMsg, "#Game_bomb_pickup", "* %s подобрал бомбу *");
TrieSetString(g_tReplaceInfoMsg, "#Game_bomb_drop", "* %s выбросил бомбу *");
TrieSetString(g_tReplaceInfoMsg, "#Bomb_Planted", "* Бомба установлена *");
TrieSetString(g_tReplaceInfoMsg, "#Bomb_Defused", "* Бомба обезврежена *");
TrieSetString(g_tReplaceInfoMsg, "#Cant_buy", "* %s секунд уже истекли.^rПокупка арсенала запрещена *");
TrieSetString(g_tReplaceInfoMsg, "#Name_change_at_respawn", "* Ваше имя будет изменено после следующего возрождения *");
TrieSetString(g_tReplaceInfoMsg, "#Auto_Team_Balance_Next_Round", "* Автоматический баланс команды наступит в следующем раунде *");
}
public Msg_MessageText()
{
new szMsg[192], szArg3[32];
get_msg_arg_string(2, szMsg, charsmax(szMsg));
if(TrieGetString(g_tReplaceInfoMsg, szMsg, szMsg, charsmax(szMsg)))
{
if(get_msg_args() > 2)
{
get_msg_arg_string(3, szArg3, charsmax(szArg3));
replace(szMsg, charsmax(szMsg), "%s", szArg3);
}
set_msg_arg_string(2, szMsg);
}
}
public plugin_end()
{
TrieDestroy(g_tReplaceInfoMsg);
}
public ClCmd_PriceMotd(id,level,cid)
{
// price motd
if (!cmd_access(id,level,cid,1))
return PLUGIN_CONTINUE
show_motd(id,"pricelist.txt","Покупка привилегий")
return PLUGIN_CONTINUE
}
public ClCmd_ResetScore(id)
{
// reset score
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)
// chat message of reseting score
client_print(id, print_chat, "* Вы обнулили свой счет! *")
client_cmd(id,"spk buttons/bell1.wav")
}
// unregister fwd (save resourse & CPU)
public LogEvent_RoundEnd()
{
if(g_fwdSetModel)
unregister_forward(FM_SetModel, g_fwdSetModel, 0)
}
// register fwd
public Event_PlantBomb()
g_fwdSetModel = register_forward(FM_SetModel, "fw_SetModel", 0)
// fix bomb angles by voed
public LogEvent_PlantBomb()
{
new id = get_loguser_index()
if(is_user_connected(id)) // fix error logs
{
new Float:flAngles[3], ent
pev(id, pev_v_angle, flAngles)
ent = fm_find_ent_by_model(FM_NULLENT, "grenade", W_BOMB_MODEL)
if(pev_valid(ent))
{
flAngles[0]=0.0
flAngles[1]+=90.0
set_pev(ent, pev_angles, flAngles)
}
}
}
// find bomb save angles/origin
public Event_DefuseBomb()
{
new ent = fm_find_ent_by_model(FM_NULLENT, "grenade", W_BOMB_MODEL)
if(pev_valid(ent))
{
pev(ent, pev_origin, g_flOrigin)
pev(ent, pev_angles, g_flAngles)
}
}
// create bomb
public LogEvent_DefuseBomb()
{
new ent = fm_create_entity("grenade")
if(!pev_valid(ent))
return
set_pev(ent, pev_origin, g_flOrigin)
set_pev(ent, pev_angles, g_flAngles)
dllfunc(DLLFunc_Spawn, ent)
engfunc(EngFunc_SetModel, ent, W_BOMB_MODEL)
set_pev(ent, pev_skin, 1) // * spec model
set_pev(ent, pev_movetype, MOVETYPE_NONE)
set_pev(ent, pev_solid, SOLID_NOT)
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
}
public fw_SetModel(ent, const model[])
{
if(!pev_valid(ent) || !equal(model, "models/w_c4.mdl"))
return FMRES_IGNORED
engfunc(EngFunc_SetModel, ent, W_BOMB_MODEL)
set_pev(ent, pev_skin, 0)
return FMRES_SUPERCEDE
}
public ClCmd_ServerMenu(id) return Show_ServerMenu(id);
Show_ServerMenu(id)
{
// main server menu
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yМеню Сервера^n^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Меню \yигрока^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Магазин \yскинов^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Сменить \yкоманду^n^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Топ-15 \yигроков сервера^n");
if(get_user_flags(id) & ADMIN_RESERVATION)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w Меню \yадминистратора^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d Меню администратора^n^n");
}
format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход");
return show_menu(id, keys, szMenu, -1, "Show_ServerMenu");
}
public Handle_ServerMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
return Show_PlayerMenu(id);
}
case 1:
{
return Show_ShopMenu(id);
}
case 2:
{
if(is_user_alive(id))
{
client_cmd(id, "jointeam");
return PLUGIN_HANDLED;
}
else
{
client_print(id, print_chat, "* Только живые игроки могут менять команду! *");
client_cmd(id, "spk buttons/blip2.wav");
return PLUGIN_HANDLED;
}
}
case 3:
{
client_cmd(id, "say /top15");
return PLUGIN_HANDLED;
}
case 4:
{
if(get_user_flags(id) & ADMIN_RESERVATION)
{
return Show_AdminMenu(id);
}
else
{
client_print(id, print_chat, "* Только Администратор имеет доступ к меню! *");
client_cmd(id, "spk buttons/blip2.wav");
return PLUGIN_HANDLED;
}
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_ServerMenu(id);
}
Show_PlayerMenu(id)
{
// player menu
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yМеню Игрока^n^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Обнулить \yсчёт^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Забанить \yигрока^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Заглушить \yигрока^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Цены на \yпривилегии^n^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_PlayerMenu");
}
public Handle_PlayerMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
client_cmd(id, "say /rs");
return PLUGIN_HANDLED;
}
case 1:
{
client_cmd(id, "say /voteban");
return PLUGIN_HANDLED;
}
case 2:
{
client_cmd(id, "say /mute");
return PLUGIN_HANDLED;
}
case 3:
{
client_cmd(id, "say /price");
return PLUGIN_HANDLED;
}
case 8:
{
return Show_ServerMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_PlayerMenu(id);
}
Show_ShopMenu(id)
{
// block menu on awp_, aim_, fy_, 35hp_ maps
new mapname[32];
get_mapname(mapname, charsmax(mapname));
new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
for(new i; i < sizeof maps; i++)
{
if(containi(mapname, maps[i]) != -1)
{
client_print(id, print_chat, "* Меню не доступно на этой карте! *");
return PLUGIN_HANDLED
}
}
// skins shop menu
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yМагазин Скинов^n^n");
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Элитный \yнабор^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d Элитный набор \R\r[Не куплено]^n");
}
if(get_user_flags(id) & ADMIN_LEVEL_B)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Стильный \yнабор^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d Стильный набор \R\r[Не куплено]^n");
}
if(get_user_flags(id) & ADMIN_LEVEL_C)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Мафиозный \yнабор^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d Мафиозный набор \R\r[Не куплено]^n");
}
if(get_user_flags(id) & ADMIN_LEVEL_D)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Засекреченный \yнабор^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Засекреченный набор \R\r[Не куплено]^n");
}
if(get_user_flags(id) & ADMIN_LEVEL_E)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w Ножевой \yнабор скинов^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d Ножевой набор скинов \R\r[Не куплено]^n^n");
}
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_ShopMenu");
}
public Handle_ShopMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
return Show_EliteMenu(id);
}
else
{
return PLUGIN_HANDLED;
}
}
case 1:
{
if(get_user_flags(id) & ADMIN_LEVEL_C)
{
if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
return Show_StyleMenu(id);
}
else
{
return PLUGIN_HANDLED;
}
}
case 2:
{
if(get_user_flags(id) & ADMIN_LEVEL_C)
{
if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
return Show_MafiozeMenu(id);
}
else
{
return PLUGIN_HANDLED;
}
}
case 3:
{
if(get_user_flags(id) & ADMIN_LEVEL_D)
{
if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
return Show_BackroomMenu(id);
}
else
{
return PLUGIN_HANDLED;
}
}
case 4:
{
if(get_user_flags(id) & ADMIN_LEVEL_E)
{
return Show_KnifeMenu(id);
}
else
{
return PLUGIN_HANDLED;
}
}
case 8:
{
return Show_ServerMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_ShopMenu(id);
}
public Show_EliteMenu(id)
{
// block menu on awp_, aim_, fy_, 35hp_ maps
new mapname[32];
get_mapname(mapname, charsmax(mapname));
new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
for(new i; i < sizeof maps; i++)
{
if(containi(mapname, maps[i]) != -1)
{
client_print(id, print_chat, "* Меню не доступно на этой карте! *");
return PLUGIN_HANDLED
}
}
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yЭлитиный Набор Скинов:\R\rЦена:^n^n");
if(cs_get_user_money(id) >= 4750)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Neo-Noir\R\r4750$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Neo-Noir\R\r4750$^n");
}
if(cs_get_user_money(id) >= 3100)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Chantico Fire\R\r3100$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Chantico Fire\R\r3100$^n");
}
if(cs_get_user_money(id) >= 2500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Fire Serpent\R\r2500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Fire Serpent\R\r2500$^n");
}
if(cs_get_user_money(id) >= 650)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Kumicho Dragon\R\r650$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Kumicho Dragon\R\r650$^n");
}
if(cs_get_user_money(id) >= 500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Orion\R\r500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Orion\R\r500$^n");
}
if(cs_get_user_money(id) >= 400)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Fade\R\r400$^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Fade\R\r400$^n^n");
}
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_EliteMenu");
}
public Handle_EliteMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
client_cmd(id, "awp_noir");
return PLUGIN_HANDLED;
}
case 1:
{
client_cmd(id, "m4a1_fire");
return PLUGIN_HANDLED;
}
case 2:
{
client_cmd(id, "ak47_fireserpent");
return PLUGIN_HANDLED;
}
case 3:
{
client_cmd(id, "deagle_dragon");
return PLUGIN_HANDLED;
}
case 4:
{
client_cmd(id, "usp_orion");
return PLUGIN_HANDLED;
}
case 5:
{
client_cmd(id, "glock_fade");
return PLUGIN_HANDLED;
}
case 8:
{
return Show_ShopMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_EliteMenu(id);
}
public Show_StyleMenu(id)
{
// block menu on awp_, aim_, fy_, 35hp_ maps
new mapname[32];
get_mapname(mapname, charsmax(mapname));
new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
for(new i; i < sizeof maps; i++)
{
if(containi(mapname, maps[i]) != -1)
{
client_print(id, print_chat, "* Меню не доступно на этой карте! *");
return PLUGIN_HANDLED
}
}
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yСтильный Набор Скинов:\R\rЦена:^n^n");
if(cs_get_user_money(id) >= 4750)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Fever Dream\R\r4750$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Fever Dream\R\r4750$^n");
}
if(cs_get_user_money(id) >= 3100)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Nightmare\R\r3100$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Nightmare\R\r3100$^n");
}
if(cs_get_user_money(id) >= 2500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Blood Sport\R\r2500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Blood Sport\R\r2500$^n");
}
if(cs_get_user_money(id) >= 650)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Code Red\R\r650$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Code Red\R\r650$^n");
}
if(cs_get_user_money(id) >= 500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Cortex\R\r500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Cortex\R\r500$^n");
}
if(cs_get_user_money(id) >= 400)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Moonrise\R\r400$^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Moonrise\R\r400$^n^n");
}
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_StyleMenu");
}
public Handle_StyleMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
client_cmd(id, "awp_dream");
return PLUGIN_HANDLED;
}
case 1:
{
client_cmd(id, "m4a1_nightmare");
return PLUGIN_HANDLED;
}
case 2:
{
client_cmd(id, "ak47_blood");
return PLUGIN_HANDLED;
}
case 3:
{
client_cmd(id, "deagle_codered");
return PLUGIN_HANDLED;
}
case 4:
{
client_cmd(id, "usp_cortex");
return PLUGIN_HANDLED;
}
case 5:
{
client_cmd(id, "glock_moon");
return PLUGIN_HANDLED;
}
case 8:
{
return Show_ShopMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_StyleMenu(id);
}
public Show_MafiozeMenu(id)
{
// block menu on awp_, aim_, fy_, 35hp_ maps
new mapname[32];
get_mapname(mapname, charsmax(mapname));
new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
for(new i; i < sizeof maps; i++)
{
if(containi(mapname, maps[i]) != -1)
{
client_print(id, print_chat, "* Меню не доступно на этой карте! *");
return PLUGIN_HANDLED
}
}
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yМафиозный Набор Скинов:\R\rЦена:^n^n");
if(cs_get_user_money(id) >= 4750)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Dragon Lore\R\r4750$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Dragon Lore\R\r4750$^n");
}
if(cs_get_user_money(id) >= 3100)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Hyper Beast\R\r3100$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Hyper Beast\R\r3100$^n");
}
if(cs_get_user_money(id) >= 2500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Neon Revolution\R\r2500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Neon Revolution\R\r2500$^n");
}
if(cs_get_user_money(id) >= 650)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Blaze\R\r650$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Blaze\R\r650$^n");
}
if(cs_get_user_money(id) >= 500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Kill Confirmed\R\r500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Kill Confirmed\R\r500$^n");
}
if(cs_get_user_money(id) >= 400)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Wasteland Rebel\R\r400$^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Wasteland Rebel\R\r400$^n^n");
}
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_MafiozeMenu");
}
public Handle_MafiozeMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
client_cmd(id, "awp_lore");
return PLUGIN_HANDLED;
}
case 1:
{
client_cmd(id, "m4a1_beast");
return PLUGIN_HANDLED;
}
case 2:
{
client_cmd(id, "ak47_neon");
return PLUGIN_HANDLED;
}
case 3:
{
client_cmd(id, "deagle_blaze");
return PLUGIN_HANDLED;
}
case 4:
{
client_cmd(id, "usp_confirmed");
return PLUGIN_HANDLED;
}
case 5:
{
client_cmd(id, "glock_wasteland");
return PLUGIN_HANDLED;
}
case 8:
{
return Show_ShopMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_MafiozeMenu(id);
}
public Show_BackroomMenu(id)
{
// block menu on awp_, aim_, fy_, 35hp_ maps
new mapname[32];
get_mapname(mapname, charsmax(mapname));
new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
for(new i; i < sizeof maps; i++)
{
if(containi(mapname, maps[i]) != -1)
{
client_print(id, print_chat, "* Меню не доступно на этой карте! *");
return PLUGIN_HANDLED
}
}
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yЗасекреченный Набор Скинов:\R\rЦена:^n^n");
if(cs_get_user_money(id) >= 4750)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Medusa\R\r4750$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Medusa\R\r4750$^n");
}
if(cs_get_user_money(id) >= 3100)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Decimator\R\r3100$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Decimator\R\r3100$^n");
}
if(cs_get_user_money(id) >= 2500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Asiimov\R\r2500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Asiimov\R\r2500$^n");
}
if(cs_get_user_money(id) >= 650)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Crimson Web\R\r650$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Crimson Web\R\r650$^n");
}
if(cs_get_user_money(id) >= 500)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Neo-Noir\R\r500$^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Neo-Noir\R\r500$^n");
}
if(cs_get_user_money(id) >= 400)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Water Elemental\R\r400$^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Water Elemental\R\r400$^n^n");
}
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_BackroomMenu");
}
public Handle_BackroomMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
client_cmd(id, "awp_medusa");
return PLUGIN_HANDLED;
}
case 1:
{
client_cmd(id, "m4a1_decimator");
return PLUGIN_HANDLED;
}
case 2:
{
client_cmd(id, "ak47_asiimov");
return PLUGIN_HANDLED;
}
case 3:
{
client_cmd(id, "deagle_crimson");
return PLUGIN_HANDLED;
}
case 4:
{
client_cmd(id, "usp_noir");
return PLUGIN_HANDLED;
}
case 5:
{
client_cmd(id, "glock_water");
return PLUGIN_HANDLED;
}
case 8:
{
return Show_ShopMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_BackroomMenu(id);
}
public Show_AdminMenu(id)
{
// main admin menu
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yМеню Администратора^n^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Заглушить \yигрока^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Кикнуть \yигрока^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Забанить \yигрока^n^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Сменить \yкарту^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w Голосование за смену \yкарты^n");
if(get_user_flags(id) & ADMIN_KICK)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Стукнуть/\wУбить \yигрока^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Стукнуть/Убить \yигрока^n");
}
if(get_user_flags(id) & ADMIN_KICK)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\w Команда \yигрока^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\d Команда \yигрока^n^n");
}
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_AdminMenu");
}
public Handle_AdminMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
client_cmd(id, "amx_gagmenu");
return PLUGIN_HANDLED;
}
case 1:
{
client_cmd(id, "amx_kickmenu");
return PLUGIN_HANDLED;
}
case 2:
{
client_cmd(id, "amx_banmenu");
return PLUGIN_HANDLED;
}
case 3:
{
client_cmd(id, "amx_mapmenu");
return PLUGIN_HANDLED;
}
case 4:
{
client_cmd(id, "amx_votemapmenu");
return PLUGIN_HANDLED;
}
case 5:
{
if(get_user_flags(id) & ADMIN_KICK)
{
client_cmd(id, "amx_slapmenu");
return PLUGIN_HANDLED;
}
else
{
client_print(id, print_chat, "* Только Админ может пользоваться этой командой! *");
client_cmd(id, "spk buttons/blip2.wav");
return PLUGIN_HANDLED;
}
}
case 6:
{
if(get_user_flags(id) & ADMIN_KICK)
{
client_cmd(id, "amx_teammenu");
return PLUGIN_HANDLED;
}
else
{
client_print(id, print_chat, "* Только Админ может пользоваться этой командой! *");
client_cmd(id, "spk buttons/blip2.wav");
return PLUGIN_HANDLED;
}
}
case 8:
{
return Show_ServerMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_AdminMenu(id);
}
Show_KnifeMenu(id)
{
// knife menu
new szMenu[512]
new iLen = 0
iLen = format(szMenu[iLen], 511, "\yНожевой Набор^n^n")
if(KnifeId[id] == 1)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d Bayonet Autotronic \r[+]^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Bayonet Autotronic^n");
}
if(KnifeId[id] == 2)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d Falchion Slaughter \r[+]^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Falchion Slaughter^n");
}
if(KnifeId[id] == 3)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d Gut Case Hardened \r[+]^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Gut Case Hardened^n");
}
if(KnifeId[id] == 4)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Karambit Waves \r[+]^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Karambit Waves^n");
}
if(KnifeId[id] == 5)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d M9 Bayonet Sapphire \r[+]^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w M9 Bayonet Sapphire^n");
}
if(KnifeId[id] == 6)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Butterfly Fade \r[+]^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Butterfly Fade^n");
}
if(KnifeId[id] == 7)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\d Stiletto Crimson Web \r[+]^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\w Stiletto Crimson Web^n^n");
}
if(KnifeId[id] == 8)
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[8]\d Стандарт \r[+]^n^n");
}
else
{
iLen += format(szMenu[iLen], 511 - iLen, "\r[8]\w Стандарт^n^n");
}
iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
return show_menu(id, keys, szMenu, -1, "Show_KnifeMenu");
}
public Handle_KnifeMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
if(KnifeId[id] == 1)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 1
give_item1(id)
client_print(id, print_chat, "* Вы взяли Нож Bayonet Autotronic *");
return PLUGIN_HANDLED;
}
}
case 1:
{
if(KnifeId[id] == 2)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 2
give_item2(id)
client_print(id, print_chat, "* Вы взяли Нож Falchion Slaughter *");
return PLUGIN_HANDLED;
}
}
case 2:
{
if(KnifeId[id] == 3)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 3
give_item3(id)
client_print(id, print_chat, "* Вы взяли Нож Gut Case Hardened *");
return PLUGIN_HANDLED;
}
}
case 3:
{
if(KnifeId[id] == 4)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 4
give_item4(id)
client_print(id, print_chat, "* Вы взяли Нож Karambit Waves *");
return PLUGIN_HANDLED;
}
}
case 4:
{
if(KnifeId[id] == 5)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 5
give_item5(id)
client_print(id, print_chat, "* Вы взяли Нож M9 Bayonet Sapphire *");
return PLUGIN_HANDLED;
}
}
case 5:
{
if(KnifeId[id] == 6)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 6
give_item6(id)
client_print(id, print_chat, "* Вы взяли Нож Butterfly Fade *");
return PLUGIN_HANDLED;
}
}
case 6:
{
if(KnifeId[id] == 7)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 7
give_item7(id)
client_print(id, print_chat, "* Вы взяли Нож Stiletto Crimson Web *");
return PLUGIN_HANDLED;
}
}
case 7:
{
if(KnifeId[id] == 8)
{
client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
return PLUGIN_HANDLED;
}
if(get_user_team(id) == 1)
{
KnifeId[id] = 8
give_item8(id)
client_print(id, print_chat, "* Вы взяли Стандартный Нож*");
return PLUGIN_HANDLED;
}
else
{
KnifeId[id] = 8
give_item8(id)
client_print(id, print_chat, "* Вы взяли Стандартный Нож *");
return PLUGIN_HANDLED;
}
}
case 8:
{
return Show_ShopMenu(id);
}
case 9:
{
return PLUGIN_HANDLED;
}
}
return Show_KnifeMenu(id);
}
public give_item1(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 1)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL1)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL1)
}
}
public give_item2(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 2)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL2)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL2)
}
}
public give_item3(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 3)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL3)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL3)
}
}
public give_item4(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 4)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL4)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL4)
}
}
public give_item5(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 5)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL5)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL5)
}
}
public give_item6(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 6)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL6)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL6)
}
}
public give_item7(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 7)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL7)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL7)
}
}
public give_item8(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return
if(KnifeId[id] == 8)
{
if(get_user_team(id) == 1)
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL9)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL9)
}
else
{
set_pev(id, pev_viewmodel2, KNIFE_V_MODEL8)
set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL8)
}
}
}
public Fw_Weapon_PrimaryAttack(weapon)
{
static id;
id = get_pdata_cbase(weapon, m_pPlayer, XoWeapon);
if(!is_user_alive(id))
return
new wpn_id = get_user_weapon(id);
static model[32];
pev(id, pev_viewmodel2, model, 31);
switch(wpn_id)
{
case CSW_DEAGLE:
g_deagle_overide[id] = 1;
case CSW_AWP, CSW_SCOUT, CSW_M3:
set_pdata_float(weapon, m_flTimeWeaponIdle, 1.5, XoWeapon);
case CSW_KNIFE:
set_pdata_float(weapon, m_flTimeWeaponIdle, 1.0, XoWeapon);
default:
set_pdata_float(weapon, m_flTimeWeaponIdle, 2.0, XoWeapon);
}
}
public Fw_Weapon_SecondaryAttack(weapon)
{
static id;
id = get_pdata_cbase(weapon, m_pPlayer, XoWeapon);
new wpn_id = get_user_weapon(id);
if(wpns_scoped & (1 << wpn_id) && cs_get_user_zoom(id) <= 1)
{
set_pev(id, pev_weaponanim, 0);
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id);
write_byte(0);
write_byte(pev(id, pev_body));
message_end();
}
}
public Fw_Deagle_Disable(weapon)
{
static id;
id = get_pdata_cbase(weapon, m_pPlayer, XoWeapon);
remove_task(id)
}
public Deagle_Overide(id)
g_deagle_overide[id] = 1;
public Inspect_Weapon(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_HANDLED
if(cs_get_user_shield(id))
return PLUGIN_HANDLED
if(cs_get_user_zoom(id) > 1)
return PLUGIN_HANDLED
static weapon; weapon = get_pdata_cbase(id, m_pActiveItem);
if(weapon <= 0 || !pev_valid(weapon))
return PLUGIN_CONTINUE
new wpn_id = get_pdata_int(weapon, m_iId, 4);
if(wpns_without_inspect & (1 << wpn_id))
return PLUGIN_HANDLED
static Float:flNextAttack; flNextAttack = get_pdata_float(id, m_flNextAttack, XoPlayer);
static Float:flNextPrimaryAttack; flNextPrimaryAttack = get_pdata_float(weapon, m_flNextPrimaryAttack, XoWeapon);
if(flNextAttack <= 0 && flNextPrimaryAttack <= 0)
{
static model[32]; pev(id, pev_viewmodel2, model, 31);
new anim = inspect_anim[wpn_id];
new current_anim = pev(get_pdata_cbase(weapon, m_pPlayer, XoWeapon), pev_weaponanim);
switch (wpn_id)
{
case CSW_USP: if(cs_get_weapon_silen(weapon)) anim = 17;
case CSW_M4A1:if(cs_get_weapon_silen(weapon)) anim = 14;
case CSW_DEAGLE: // random inspect (seq 6 / 7)
{
if(wpn_id == CSW_DEAGLE && g_deagle_overide[id] == 1)
{
anim = random_num(6, 7);
new Float:f_temp;
if(anim == 7) f_temp = 8.53;
else f_temp = idle_calltime[CSW_DEAGLE]
play_inspect(id, anim);
remove_task(id);
g_deagle_overide[id] = 0;
set_task(f_temp, "Deagle_Overide", id);
return PLUGIN_CONTINUE
}
}
}
if(wpn_id == CSW_KNIFE && (current_anim == 8))
return PLUGIN_HANDLED
if(!get_pdata_int(weapon, m_fInSpecialReload, 4) && current_anim != anim)
{
play_inspect(id, anim);
set_pdata_float(weapon, m_flTimeWeaponIdle, idle_calltime[wpn_id], XoWeapon);
}
}
return PLUGIN_CONTINUE
}
// gets a player id that triggered certain logevents, by VEN
stock get_loguser_index()
{
static loguser[80], name[32]
read_logargv(0, loguser, charsmax(loguser))
parse_loguser(loguser, name, charsmax(name))
return get_user_index(name)
}
stock format_color(message[], msglen)
{
new string[256], len = charsmax(string);
copy(string, len, message);
replace_all(string, len, "!n", "^1");
replace_all(string, len, "!t", "^3");
replace_all(string, len, "!g", "^4");
formatex(message, msglen, "^1%s", string);
}
play_inspect(id, anim)
{
set_pev(id, pev_weaponanim, anim);
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id);
write_byte(anim);
write_byte(pev(id, pev_body));
message_end();
}
SendMsg(id, const MSG[], any:...)
{
new szMsg[190]; vformat(szMsg, charsmax(szMsg), MSG, 3);
message_begin(MSG_ONE_UNRELIABLE, 76, .player = id);
write_byte(id);
write_string(szMsg);
message_end();
}