Участник
Пользователь
- Сообщения
- 166
- Реакции
- 34
- Помог
- 3 раз(а)
Наверно, как то, так надо сделать. Закоментировать один или несколько из пунктов и поменять номирацию?
Исходный код
Код:
public MenuOptionDay_Handler(id, key)
{
if(!is_user_connected(id))
return;
if(g_iDay != 0)
return;
switch(key)
{
case 0:
{
g_iDay = 1;
g_iDayNum[1] = NumDay1;
}
//case 1:
{
g_iDay = 2;
g_iDayNum[2] = NumDay2;
}
case 2:
{
g_iDay = 3;
g_iDayNum[3] = NumDay3;
Start_RamboDay();
}
case 3:
{
g_iDay = 4;
g_iDayNum[4] = NumDay4;
Start_ZombieDay();
}
case 4:
{
g_iDay = 5;
g_iDayNum[5] = NumDay5;
Start_ChainSawDay();
}
case 5:
{
g_iDay = 6;
g_iDayNum[6] = NumDay6;
Start_SurvivalDay();
}
case 6:
{
g_iDay = 7;
g_iDayNum[7] = NumDay7;
Start_SnowDay();
}
case 7:
{
g_iDay = 8;
g_iDayNum[8] = NumDay8;
Start_InvisDay();
}
}
Dhud_MessageInfo();
}
Код:
/*
-> Режимы для Deathrun: DR Days - Дни Deathrun <-
-> Автор: 6u3oH <-
-> Контакты: vk.com/6u3oH <-
-> Сайт: steep.at.ua <-
-> Группа: vk.com/halt_gamers <-
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <dhudmessage>
#include <hamsandwich>
#define PLUGIN "[DR] Days"
#define VERSION "1.0"
#define AUTHOR "6u3oH"
const TaskIdOne = 53500;
const TaskIdTwo = 53501;
const TaskIdThree = 53502;
const TaskIdFour = 53503;
/* ================== Настройки [начало] ================== */
/* -> Ограничение по раундам -<
-> Через сколько раундов можно использовать день после предыдущего выбора
-> Значение должно быть целым и положительным числом (N > 0) */
const NumDay1 = 1; // День кнопок
const NumDay2 = 1; // Свободный день (const 1)
const NumDay3 = 2; // День рэмбо
const NumDay4 = 3; // День зомби
const NumDay5 = 3; // День пилы
const NumDay6 = 1; // День выживания
const NumDay7 = 2; // Зимний день
const NumDay8 = 4; // День невидимки
/* -> Общее -< */
const HealthT = 150; // Первоначальное здоровье ТЕ
const HealthCT = 105; // Первоначальное здоровье КТ
const TimerOption = 10; // Сколько секунд на выбор дня у ТЕ
const GameMod = 1; // Выдача оружия КТ (0 - только нож, 1 - USP и патроны к нему)
/* -> Режимы -< */
const Rambo_HealthT = 100; // Здоровье ТЕ при выборе режима Рэмбо
const Rambo_HealthCT = 1; // Здоровье КТ при выборе режима Рэмбо
const Rambo_GameMod = 1; // Что получают КТ при выборе режима Рэмбо (0 - невидимость, 1 - щит)
const Zombie_Health_Main = 2000; // Здоровье Главных зомби (первые ТЕ)
const Zombie_HealthT = 100; // Здоровье зараженных зомби (последующие ТЕ)
const Zombie_HealthCT = 100; // Здоровье КТ при выборе режима Зомби
const ChainSaw_HealthT = 255; // Здоровье Пилы (ТЕ)
const ChainSaw_HealthCT = 255; // Здоровье жертв Пилы (КТ)
const ChainSaw_TimeSpawn = 10; // Через сколько секунд Пила будет заспавнен на базу КТ
const ChainSaw_Dmg = 5; // Во сколько раз умножается урон от пилы (15 * 5 || 65 * 5)
const ChainSaw_GameMod = 1; // Что получают КТ при выборе режима Пила (0 - ничего, 1 - P228 и патроны к нему)
const Survival_Time = 120; // Сколько у КТ есть секунд до смерти
const Snow_HealthT = 100; // Здоровье ТЕ при выборе Зимнего режима
const Snow_HealthCT = 100; // Здоровье КТ при выборе Зимнего режима
const Float: Snow_Freeze = 3.0; // На сколько секунд замораживает снежок (внимание, дробное значение - Float: N.0 !!!)
const Float: Snow_Dmg = 50.0; // Сколько урона наносит снежок (внимание, дробное значение - Float: N.0 !!!)
const Invis_HealthT = 180; // Здоровье ТЕ при выборе режима Невидимка
const Invis_HealthCT = 100; // Здоровье КТ при выборе режима Невидимка
/* ================== Настройки [конец] ================== */
new g_iDay, g_iPlayers, g_iMaxPlayers, g_iTimer, g_iNumT, g_iNumCT, g_iTimeSaw, g_iTimeSurvival, g_iMsgScreenFade;
new g_iDayNum[9];
new CsTeams: g_User_Team[33];
new g_sHudInformer[512], g_sMapName[32];
new bool: g_OnlySaw, g_bFreez[33];
new Float: g_fMaxSpeed[33], Float: g_fGravity[33];
new const g_ModelRambo[][] =
{
"models/dr_days/rambo/v_m249.mdl",
"models/dr_days/rambo/p_m249.mdl",
"models/player/walter_rambo/walter_rambo.mdl"
};
new const g_ModelZombie[][] =
{
"models/dr_days/zombie/v_knife_zombie.mdl",
"models/player/rose_zombie/rose_zombie.mdl"
};
new const g_ModelChainsaw[][] =
{
"models/dr_days/chainsaw/v_chainsaw.mdl",
"models/dr_days/chainsaw/p_chainsaw.mdl"
};
new const g_SoundRambo[][] =
{
"dr_days/rambo/rambo_attack.wav",
"dr_days/rambo/rambo_start.wav"
};
new const g_SoundZombie[][] =
{
"dr_days/zombie/zombie_infect.wav",
"dr_days/zombie/zombie_start.wav"
};
new const g_SoundChainsaw[][] =
{
"dr_days/chainsaw/chainsaw_attack.wav",
"dr_days/chainsaw/chaisaw_start.wav",
"dr_days/chainsaw/chaisaw_time.wav"
};
new const g_ModelSnow[][] =
{
"models/dr_days/snow/v_snowball.mdl",
"models/dr_days/snow/p_snowball.mdl",
"models/dr_days/snow/w_snowball.mdl"
};
new const g_SoundSurvival[] = "dr_days/survival/survival_start.wav";
new g_sDaysList[9][] =
{
"Не выбран",
"День кнопок",
"Свободный день",
"День рэмбо",
"День зомби",
"День пилы",
"День выживания",
"Зимний день",
"День невидимки"
};
new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8;
public plugin_precache()
{
for(new i; i < sizeof(g_ModelRambo); i++)
{
precache_model(g_ModelRambo[i]);
}
for(new i; i < sizeof(g_ModelZombie); i++)
{
precache_model(g_ModelZombie[i]);
}
for(new i; i < sizeof(g_ModelChainsaw); i++)
{
precache_model(g_ModelChainsaw[i]);
}
for(new i; i < sizeof(g_SoundZombie); i++)
{
precache_sound(g_SoundZombie[i]);
}
for(new i; i < sizeof(g_SoundChainsaw); i++)
{
precache_sound(g_SoundChainsaw[i]);
}
for(new i; i < sizeof(g_SoundRambo); i++)
{
precache_sound(g_SoundRambo[i]);
}
for(new i; i < sizeof(g_ModelSnow); i++)
{
precache_model(g_ModelSnow[i]);
}
precache_sound(g_SoundSurvival);
}
public client_disconnect(id)
{
g_iPlayers = get_playersnum(0) + 1;
CounterInformer();
}
public client_connect(id)
{
g_iPlayers = get_playersnum(0) + 1;
CounterInformer();
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_EmitSound, "Fwd_EmitSound");
register_forward(FM_SetModel, "Fwd_HookModelSet");
register_event("HLTV", "Event_StartRound", "a", "1=0", "2=0");
register_logevent("Event_EndRound", 2, "1=Round_End");
register_event("TextMsg", "Event_Restart", "a", "2=#Game_will_restart_in", "2=#Game_Commencing");
register_menu("Menu_Days", keys, "MenuOptionDay_Handler");
RegisterHam(Ham_Spawn, "player", "HamHook_SpawnPlayer", .Post = true);
RegisterHam(Ham_Killed, "player", "HamHook_KilledPlayer", .Post = true);
RegisterHam(Ham_CS_Item_GetMaxSpeed, "player", "HamHook_GetMaxSpeed", .Post = true);
RegisterHam(Ham_Use, "func_button", "HamHook_UseButton", .Post = false);
RegisterHam(Ham_Touch, "armoury_entity", "HamHook_TouchWeapon", .Post = false);
RegisterHam(Ham_Touch, "weaponbox", "HamHook_TouchWeapon", .Post = false);
RegisterHam(Ham_Item_Deploy, "weapon_m249", "HamHook_DeployM249", .Post = true);
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_m249", "HamHook_AttackM249", .Post = true);
RegisterHam(Ham_Item_Deploy, "weapon_knife", "HamHook_DeployKnife", .Post = true);
RegisterHam(Ham_TakeDamage, "player", "HamHook_TakeDamage", .Post = false);
RegisterHam(Ham_Item_Deploy, "weapon_flashbang", "HamHook_DeployFlash", .Post = true);
RegisterHam(Ham_Think, "grenade", "HamHook_GrenadeThink", .Post = false);
RegisterHam(Ham_Touch, "grenade", "HamHook_GrenadeTouch", .Post = false);
get_mapname(g_sMapName, charsmax(g_sMapName));
set_task(2.0, "Task_Informer", TaskIdTwo, _, _, "b");
g_iMaxPlayers = get_maxplayers();
g_iMsgScreenFade = get_user_msgid("ScreenFade");
}
public Task_Informer()
{
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_connected(id))
continue;
formatex(g_sHudInformer, charsmax(g_sHudInformer), "День: %s^nИгроков: [%i/%i]^nКарта: %s^nЖивых КТ: %i^nЖивых ТТ: %i",
g_sDaysList[g_iDay], g_iPlayers - 1, g_iMaxPlayers, g_sMapName, g_iNumCT, g_iNumT);
set_hudmessage(255, 255, 255, 0.01, 0.15, 0, 0.1, 2.0, 0.1, 0.1, -1);
show_hudmessage(id, "%s", g_sHudInformer);
}
}
public HamHook_SpawnPlayer(id)
{
if(!is_user_connected(id))
return;
CounterInformer();
strip_user_weapons(id);
cs_reset_user_model(id);
set_pev(id, pev_renderfx, kRenderFxNone);
set_pev(id, pev_renderamt, 1);
set_pev(id, pev_rendermode, kRenderFxGlowShell);
set_pev(id, pev_renderamt, {255.0, 255.0, 255.0});
give_item(id, "weapon_knife");
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
MenuOptionDay(id);
set_user_health(id, HealthT);
}
case 2:
{
switch(GameMod)
{
case 1:
{
give_item(id, "weapon_usp");
cs_set_user_bpammo(id, CSW_USP, 100);
}
}
set_user_health(id, HealthCT);
}
}
}
public HamHook_KilledPlayer()
{
CounterInformer();
}
public HamHook_UseButton(iButton, id)
{
if(!pev_valid(iButton))
return HAM_IGNORED;
if(!is_user_alive(id))
return HAM_IGNORED;
if(g_iDay == 1)
return HAM_IGNORED;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_CT)
return HAM_IGNORED;
if(g_iDay == 0)
{
client_print(id, print_center, "Нельзя нажимать на кнопки, пока день не выбран!");
return HAM_SUPERCEDE;
}else{
client_print(id, print_center, "Нельзя нажимать на кнопки в этот день!");
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public HamHook_TouchWeapon(iWpn, id)
{
if(!pev_valid(iWpn))
return HAM_IGNORED;
if(!is_user_alive(id))
return HAM_IGNORED;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
return HAM_SUPERCEDE;
}
case 2:
{
if(g_iDay != 1)
{
return HAM_SUPERCEDE;
}
}
}
return HAM_IGNORED;
}
public Event_StartRound()
{
g_iPlayers = get_playersnum(0) + 1;
CounterInformer();
g_iTimer = TimerOption;
set_task(1.0, "Function_Timer", TaskIdOne, _, _, "b");
for(new i = 1; i < 9; i++)
{
if(g_iDayNum[i] > 0)
{
g_iDayNum[i]--;
}else{
g_iDayNum[i] = 0;
}
}
}
public Event_EndRound()
{
g_iDay = 0;
g_OnlySaw = false;
remove_task(TaskIdOne);
remove_task(TaskIdThree);
remove_task(TaskIdFour);
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_connected(id))
continue;
g_bFreez[id] = false;
HamExHook_Deploy(id);
}
}
public Event_Restart()
{
for(new i = 1; i < 9; i++)
{
g_iDayNum[i] = 0;
}
g_iDay = 0;
g_OnlySaw = false;
remove_task(TaskIdOne);
remove_task(TaskIdThree);
remove_task(TaskIdFour);
}
public Function_Timer()
{
if(g_iTimer == 0)
{
g_iDay = 2;
remove_task(TaskIdOne);
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_connected(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
client_print(id, print_chat, "Автоматически выбран %s, ввиду вашего бездействия", g_sDaysList[2]);
show_menu(id, 0, "^n", 1);
}
case 2:
{
static sMessage[256];
formatex(sMessage, charsmax(sMessage), "Террорист день не выбрал^nАвтоматически начинается %s", g_sDaysList[2]);
set_dhudmessage(150, 205, 55, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
show_dhudmessage(id, "%s", sMessage);
}
}
}
}
if(g_iDay != 0)
{
remove_task(TaskIdOne);
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_connected(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_T)
{
show_menu(id, 0, "^n", 1);
}
}
}
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_connected(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_T)
{
client_print(id, print_center, "Время на выбор дня: %i", g_iTimer);
}
}
g_iTimer--;
}
public MenuOptionDay(id)
{
if(g_iDay != 0)
return;
static menu[650], iLen;
iLen = 0;
iLen = formatex(menu[iLen], charsmax(menu) - iLen, "\yМеню выбора дня^n^n");
if(g_iDayNum[1] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r1. \w%s^n", g_sDaysList[1]);
keys |= MENU_KEY_1;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r1. \d%s [\y%i\w]^n", g_sDaysList[1], g_iDayNum[1]);
keys &= ~MENU_KEY_1;
}
if(g_iDayNum[2] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r2. \w%s^n", g_sDaysList[2]);
keys |= MENU_KEY_2;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r2. \d%s [\y%i\w]^n", g_sDaysList[2], g_iDayNum[2]);
keys &= ~MENU_KEY_2;
}
if(g_iDayNum[3] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r3. \w%s^n", g_sDaysList[3]);
keys |= MENU_KEY_3;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r3. \d%s [\y%i\w]^n", g_sDaysList[3], g_iDayNum[3]);
keys &= ~MENU_KEY_3;
}
if(g_iDayNum[4] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r4. \w%s^n", g_sDaysList[4]);
keys |= MENU_KEY_4;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r4. \d%s [\y%i\w]^n", g_sDaysList[4], g_iDayNum[4]);
keys &= ~MENU_KEY_4;
}
if(g_iDayNum[5] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r5. \w%s^n", g_sDaysList[5]);
keys |= MENU_KEY_5;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r5. \d%s [\y%i\w]^n", g_sDaysList[5], g_iDayNum[5]);
keys &= ~MENU_KEY_5;
}
if(g_iDayNum[6] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r6. \w%s^n", g_sDaysList[6]);
keys |= MENU_KEY_6;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r6. \d%s [\y%i\w]^n", g_sDaysList[1], g_iDayNum[6]);
keys &= ~MENU_KEY_6;
}
if(g_iDayNum[7] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r7. \w%s^n", g_sDaysList[7]);
keys |= MENU_KEY_7;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r7. \d%s [\y%i\w]^n", g_sDaysList[7], g_iDayNum[7]);
keys &= ~MENU_KEY_7;
}
if(g_iDayNum[8] == 0)
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r8. \w%s^n", g_sDaysList[8]);
keys |= MENU_KEY_8;
}else{
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r8. \d%s [\y%i\w]^n", g_sDaysList[8], g_iDayNum[8]);
keys &= ~MENU_KEY_8;
}
show_menu(id, keys, menu, -1, "Menu_Days");
}
public MenuOptionDay_Handler(id, key)
{
if(!is_user_connected(id))
return;
if(g_iDay != 0)
return;
switch(key)
{
case 0:
{
g_iDay = 1;
g_iDayNum[1] = NumDay1;
}
case 1:
{
g_iDay = 2;
g_iDayNum[2] = NumDay2;
}
case 2:
{
g_iDay = 3;
g_iDayNum[3] = NumDay3;
Start_RamboDay();
}
case 3:
{
g_iDay = 4;
g_iDayNum[4] = NumDay4;
Start_ZombieDay();
}
case 4:
{
g_iDay = 5;
g_iDayNum[5] = NumDay5;
Start_ChainSawDay();
}
case 5:
{
g_iDay = 6;
g_iDayNum[6] = NumDay6;
Start_SurvivalDay();
}
case 6:
{
g_iDay = 7;
g_iDayNum[7] = NumDay7;
Start_SnowDay();
}
case 7:
{
g_iDay = 8;
g_iDayNum[8] = NumDay8;
Start_InvisDay();
}
}
Dhud_MessageInfo();
}
public Dhud_MessageInfo()
{
static sMessage[256];
switch(g_iDay)
{
case 1:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nБерегитесь ловушек!", g_sDaysList[1]);
set_dhudmessage(255, 0, 0, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
case 2:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nБегите спокойно :)", g_sDaysList[2]);
set_dhudmessage(0, 0, 255, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
case 3:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nПрикрывайтесь щитом!", g_sDaysList[3]);
set_dhudmessage(255, 0, 0, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
case 4:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nБерегитесь укусов от зомби!", g_sDaysList[4]);
set_dhudmessage(255, 0, 0, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
case 5:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nБегите со всех ног!", g_sDaysList[5]);
set_dhudmessage(255, 0, 0, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
case 6:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nБегите, на счету каждая секунда!", g_sDaysList[6]);
set_dhudmessage(255, 0, 0, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
case 7:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nОденьтесь потеплей :)", g_sDaysList[7]);
set_dhudmessage(25, 25, 255, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
case 8:
{
formatex(sMessage, charsmax(sMessage), "Террорист выбрал %s^nВглядывайтесь внимательней!", g_sDaysList[8]);
set_dhudmessage(255, 0, 0, -1.0, 0.15, 2, 0.1, 5.0, 0.1, 0.1, false)
}
}
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_connected(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1: client_print(id, print_chat, "Вы выбрали %s", g_sDaysList[g_iDay]);
case 2: show_dhudmessage(id, "%s", sMessage);
}
}
}
public Start_RamboDay()
{
client_cmd(0, "spk dr_days/rambo/rambo_start");
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_alive(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
set_user_health(id, Rambo_HealthT);
cs_set_user_model(id, "walter_rambo");
give_item(id, "weapon_m249");
cs_set_user_bpammo(id, CSW_M249, 2000);
HamExHook_Deploy(id);
}
case 2:
{
set_user_health(id, Rambo_HealthCT);
switch(Rambo_GameMod)
{
case 0:
{
set_pev(id, pev_renderfx, kRenderNormal);
set_pev(id, pev_renderamt, 0);
set_pev(id, pev_rendermode, kRenderFxGlowShell);
set_pev(id, pev_renderamt, {0.0, 0.0, 0.0});
}
case 1:
{
give_item(id, "weapon_shield");
}
}
}
}
}
}
public HamHook_DeployM249(iWeapon)
{
if(g_iDay != 3)
return;
new id = pev(iWeapon, pev_owner)
if(!is_user_alive(id))
return;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_T)
{
set_pev(id, pev_viewmodel2, g_ModelRambo[0]);
set_pev(id, pev_weaponmodel2, g_ModelRambo[1]);
}
}
public HamHook_AttackM249(iWeapon)
{
if(g_iDay != 3)
return;
new id = pev(iWeapon, pev_owner)
if(!is_user_alive(id))
return;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_T)
{
static iAmmo;
iAmmo = get_pdata_int(iWeapon, 51, 4);
if(iAmmo >= 0)
{
ExecuteHam(Ham_Weapon_PlayEmptySound, iWeapon);
emit_sound(id, 0, g_SoundRambo[0], 0.8, 1.0, 0, 100);
}
}
}
public Start_ZombieDay()
{
client_cmd(0, "spk dr_days/zombie/zombie_start");
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_alive(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
cs_set_user_model(id, "rose_zombie");
set_user_health(id, Zombie_Health_Main);
HamExHook_Deploy(id);
}
case 2:
{
give_item(id, "weapon_p90");
cs_set_user_bpammo(id, CSW_P90, 100);
set_user_health(id, Zombie_HealthCT);
}
}
}
}
public HamHook_TakeDamage(iVictim, szWeapon, iAttacker, Float: fDmg, damagebits)
{
if(!is_user_connected(iVictim) || !is_user_alive(iAttacker))
return;
if(szWeapon != iAttacker)
return;
if(get_user_team(iAttacker) == get_user_team(iVictim))
return;
switch(g_iDay)
{
case 4:
{
if(get_user_weapon(iAttacker) != CSW_KNIFE)
return;
g_User_Team[iAttacker] = cs_get_user_team(iAttacker);
if(g_User_Team[iAttacker] == CS_TEAM_CT)
return;
CounterInformer();
if(g_iNumCT > 1)
{
SetHamParamFloat(4, 0.0);
cs_set_user_team(iVictim, CS_TEAM_T, CS_T_ARCTIC);
cs_set_user_model(iVictim, "rose_zombie");
set_user_health(iVictim, Zombie_HealthCT);
emit_sound(iVictim, 0, g_SoundZombie[0], 1.0, 1.0, 0, 100);
strip_user_weapons(iVictim);
give_item(iVictim, "weapon_knife");
}
}
case 5:
{
if(get_user_weapon(iAttacker) != CSW_KNIFE)
return;
g_User_Team[iAttacker] = cs_get_user_team(iAttacker);
if(g_User_Team[iAttacker] == CS_TEAM_CT)
return;
SetHamParamFloat(4, fDmg * float(ChainSaw_Dmg));
}
}
}
public HamHook_DeployKnife(iWeapon)
{
switch(g_iDay)
{
case 4:
{
new id = pev(iWeapon, pev_owner)
if(!is_user_alive(id))
return;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] != CS_TEAM_T)
return;
set_pev(id, pev_viewmodel2, g_ModelZombie[0]);
}
case 5:
{
new id = pev(iWeapon, pev_owner)
if(!is_user_alive(id))
return;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] != CS_TEAM_T)
return;
set_pev(id, pev_viewmodel2, g_ModelChainsaw[0]);
set_pev(id, pev_weaponmodel2, g_ModelChainsaw[1]);
}
}
}
public Start_ChainSawDay()
{
set_task(1.0, "SpawnChainsaw", TaskIdThree, _, _, "b");
g_iTimeSaw = ChainSaw_TimeSpawn;
client_cmd(0, "spk dr_days/chainsaw/chaisaw_time");
}
public SpawnChainsaw()
{
new iEnt;
static Float: fOrigin[3];
if(g_iTimeSaw > 0)
{
g_iTimeSaw--;
set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.1, 1.0, 0.1, 0.1, -1);
show_hudmessage(0, "Время до появления Пилы: %i", g_iTimeSaw);
}else{
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_alive(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
set_user_health(id, ChainSaw_HealthT);
HamExHook_Deploy(id);
while((iEnt = find_ent_by_class(iEnt, "info_player_start")))
{
pev(iEnt, pev_origin, fOrigin);
engfunc(EngFunc_TraceHull, fOrigin, fOrigin, DONT_IGNORE_MONSTERS, HULL_HUMAN, iEnt, 0);
if(get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
continue;
set_pev(id, pev_origin, fOrigin);
break;
}
}
case 2:
{
set_user_health(id, ChainSaw_HealthCT);
switch(ChainSaw_GameMod)
{
case 1:
{
give_item(id, "weapon_p228");
cs_set_user_bpammo(id, CSW_P228, 52);
}
}
}
}
}
client_cmd(0, "spk dr_days/chainsaw/chaisaw_start");
g_OnlySaw = true;
remove_task(TaskIdThree);
}
}
public Start_SurvivalDay()
{
set_task(1.0, "RoundSurvival", TaskIdFour, _, _, "b");
g_iTimeSurvival = Survival_Time;
client_cmd(0, "spk dr_days/survival/survival_start");
}
public RoundSurvival()
{
if(g_iNumT == 0)
{
set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.1, 1.0, 0.1, 0.1, -1);
show_hudmessage(0, "Контер-террористы выжили...");
remove_task(TaskIdFour);
return;
}
if(g_iTimeSurvival > 0)
{
g_iTimeSurvival--;
set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.1, 1.0, 0.1, 0.1, -1);
show_hudmessage(0, "Время до всеобщей смерти: %i^nУбейте террористов, чтобы выжить", g_iTimeSurvival);
}else{
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_alive(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_CT)
{
user_kill(id);
}
}
remove_task(TaskIdFour);
}
}
public Fwd_EmitSound(id, channel, const sound[])
{
if(!is_user_alive(id))
return FMRES_IGNORED
if(g_iDay != 5)
return FMRES_IGNORED
if(!g_OnlySaw)
return FMRES_IGNORED
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] != CS_TEAM_T)
return FMRES_IGNORED
if(equal(sound, "weapons/knife_hit1.wav") || equal(sound, "weapons/knife_hit2.wav")
|| equal(sound, "weapons/knife_hit3.wav") || equal(sound, "weapons/knife_hit4.wav"))
{
emit_sound(id, channel, g_SoundChainsaw[0], 1.0, ATTN_NORM, 0, PITCH_NORM);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED
}
public Start_SnowDay()
{
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_alive(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
set_user_health(id, Snow_HealthT);
give_item(id, "weapon_flashbang");
cs_set_user_bpammo(id, CSW_FLASHBANG, 999);
HamExHook_Deploy(id);
}
case 2:
{
set_user_health(id, Snow_HealthCT);
}
}
}
}
public HamHook_DeployFlash(iWpn)
{
if(g_iDay != 7)
return;
static id;
id = pev(iWpn, pev_owner);
if(!is_user_alive(id))
return;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] != CS_TEAM_T)
return;
set_pev(id, pev_viewmodel2, g_ModelSnow[0]);
set_pev(id, pev_weaponmodel2, g_ModelSnow[1]);
}
public HamHook_GrenadeThink(iEnt)
{
if(!pev_valid(iEnt))
return HAM_IGNORED;
if(g_iDay != 7)
return HAM_IGNORED;
static sPathModel[64];
pev(iEnt, pev_model, sPathModel, charsmax(sPathModel));
if(!equal(sPathModel, g_ModelSnow[2]))
return HAM_IGNORED;
static Float: fVelocity[3];
pev(iEnt, pev_velocity, fVelocity);
for(new i; i <= 2; i++)
{
fVelocity[i] *= 3.0;
}
set_pev(iEnt, pev_velocity, fVelocity);
return HAM_SUPERCEDE;
}
public HamHook_GrenadeTouch(iGrenade, iEnt)
{
if(g_iDay != 7)
return HAM_IGNORED;
if(!pev_valid(iGrenade))
return HAM_IGNORED;
static sPathModel[64];
pev(iGrenade, pev_model, sPathModel, charsmax(sPathModel));
if(!equal(sPathModel, g_ModelSnow[2]))
return HAM_IGNORED;
static sClassName[32];
pev(iEnt, pev_classname, sClassName, charsmax(sClassName));
if(equal(sClassName, "worldspawn"))
{
return HAM_IGNORED;
}
if(equal(sClassName, "player"))
{
if(is_user_alive(iEnt))
{
static iAttacker;
iAttacker = pev(iGrenade, pev_owner);
if(cs_get_user_team(iAttacker) == cs_get_user_team(iEnt))
return HAM_IGNORED;
if(g_bFreez[iEnt])
return HAM_IGNORED;
g_bFreez[iEnt] = true;
pev(iEnt, pev_gravity, g_fGravity[iEnt]);
pev(iEnt, pev_maxspeed, g_fMaxSpeed[iEnt]);
set_pev(iEnt, pev_gravity, 5.0);
set_pev(iEnt, pev_maxspeed, -1.0);
set_pev(iEnt, pev_renderfx, kRenderFxGlowShell);
set_pev(iEnt, pev_rendercolor, {128.0, 255.0, 255.0});
ExecuteHamB(Ham_TakeDamage, iEnt, CSW_FLASHBANG, iAttacker, Snow_Dmg, DMG_FREEZE);
message_begin(MSG_ONE, g_iMsgScreenFade, {0,0,0}, iEnt);
write_short(1<<10);
write_short(1<<30);
write_short(0x0000);
write_byte(0);
write_byte(200);
write_byte(200);
write_byte(150);
message_end();
set_task(Snow_Freeze, "ResetRenderFx", iEnt);
engfunc(EngFunc_RemoveEntity, iGrenade);
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}
public ResetRenderFx(id)
{
if(!is_user_alive(id))
return;
remove_task(id);
g_bFreez[id] = false;
set_pev(id, pev_renderfx, kRenderFxGlowShell);
set_pev(id, pev_rendercolor, {0.0, 0.0, 0.0});
set_pev(id, pev_maxspeed, g_fMaxSpeed[id]);
set_pev(id, pev_gravity, g_fGravity[id]);
}
public HamHook_GetMaxSpeed(id)
{
if(g_iDay != 7)
return
if(!is_user_alive(id))
return;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_CT)
{
if(g_bFreez[id])
{
set_pev(id, pev_gravity, 5.0);
set_pev(id, pev_maxspeed, -1.0);
}
}
}
public Fwd_HookModelSet(iEnt, sModel[])
{
if(g_iDay != 7)
return HAM_IGNORED;
if(!pev_valid(iEnt))
return HAM_IGNORED;
static szClassName[33];
pev(iEnt, pev_classname, szClassName, charsmax(szClassName));
if(!equal(sModel, "models/w_flashbang.mdl"))
return HAM_IGNORED;
static id;
id = pev(iEnt, pev_owner);
if(!is_user_alive(id))
return HAM_IGNORED;
g_User_Team[id] = cs_get_user_team(id);
if(g_User_Team[id] == CS_TEAM_T)
{
entity_set_model(iEnt, g_ModelSnow[2]);
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public Start_InvisDay()
{
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_alive(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
set_user_health(id, Invis_HealthT);
set_pev(id, pev_renderfx, kRenderNormal);
set_pev(id, pev_renderamt, 0);
set_pev(id, pev_rendermode, kRenderFxGlowShell);
set_pev(id, pev_renderamt, {0.0, 0.0, 0.0});
}
case 2:
{
set_user_health(id, Invis_HealthCT);
}
}
}
}
public HamExHook_Deploy(id)
{
static iWeapon;
iWeapon = get_pdata_cbase(id, 373);
if(!pev_valid(iWeapon))
return;
ExecuteHamB(Ham_Item_Deploy, iWeapon);
}
public CounterInformer()
{
g_iNumT = 0, g_iNumCT = 0;
for(new id = 1; id <= g_iPlayers; id++)
{
if(!is_user_alive(id))
continue;
g_User_Team[id] = cs_get_user_team(id);
switch(g_User_Team[id])
{
case 1:
{
g_iNumT++;
}
case 2:
{
g_iNumCT++;
}
}
}
}