Как сделать проверку на выбор ножей после начала раунда

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
1
Реакции
0
Неверный раздел форума
Ошибка
нету
Список плагинов
amxmodx Zp 4.3
Версия SourceMod
хз
ОС
Windows
Версия Metamod
Metamod-r v1.3.0.119, API (5:13)
Metamod-r build: 23:25:06 Mar 10 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/35eada4
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "Knife"
#define VERSION "0.1"
#define AUTHOR "ELF"

new const ZP_PREFIX[] = "Ножи"

#define ID_FBURN (taskid - 100)

const FIRE_DAMAGE = 5 // Урон от огня
const Float:FIRE_REFRESH = 10.0 // Перезарядка горения
const FIRE_DURATION = 5 // Время горения

const Float:TIME_FREEZE = 3.0 // Длительность заморозки
const Float:TIME_WAIT_FREEZE = 15.0 // Длительность преезарядки

new const g_SpriteGlasses[] = "models/glassgibs.mdl"

new g_fire_wait[33], g_freeze_wait[33]
new g_burning_duration[33], g_frozen[33], g_SpriteGlass, g_flameSpr, g_smokeSpr

#define VIP ADMIN_LEVEL_H
#define ADMIN ADMIN_RESERVATION

new key = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

new KNIFE1_V_MODEL[] = "models/kinifes/v_knife_meat.mdl"
new KNIFE1_P_MODEL[] = "models/kinifes/p_knife_meat.mdl"

new KNIFE2_V_MODEL[] = "models/kinifes/v_knife_clasic.mdl"
new KNIFE2_P_MODEL[] = "models/kinifes/p_knife_clasic.mdl"

new KNIFE3_V_MODEL[] = "models/kinifes/v_snap_blade.mdl"
new KNIFE3_P_MODEL[] = "models/kinifes/p_snap_blade.mdl"

new KNIFE4_V_MODEL[] = "models/kinifes/v_hammer_knife.mdl"
new KNIFE4_P_MODEL[] = "models/kinifes/p_hammer_knife.mdl"

new KNIFE5_V_MODEL[] = "models/kinifes/v_knife_axe.mdl"
new KNIFE5_P_MODEL[] = "models/kinifes/p_knife_axe.mdl"

new KNIFE6_V_MODEL[] = "models/kinifes/v_knife_stone.mdl"
new KNIFE6_P_MODEL[] = "models/kinifes/p_knife_stone.mdl"

new KNIFE7_V_MODEL[] = "models/kinifes/v_knife_kosa.mdl"
new KNIFE7_P_MODEL[] = "models/kinifes/p_knife_kosa.mdl"

new KNIFE8_V_MODEL[] = "models/kinifes/v_chainsaw.mdl"
new KNIFE8_P_MODEL[] = "models/kinifes/p_chainsaw.mdl"

new KNIFE9_V_MODEL[] = "models/kinifes/v_topor_by_dor_on.mdl"
new KNIFE9_P_MODEL[] = "models/kinifes/p_topor_by_dor_on.mdl"

new bool:g_has_knife1[33]
new bool:g_has_knife2[33]
new bool:g_has_knife3[33]
new bool:g_has_knife4[33]
new bool:g_has_knife5[33]
new bool:g_has_knife6[33]
new bool:g_has_knife7[33]
new bool:g_has_knife8[33]
new bool:g_has_knife9[33]

new cvar_knock_knife1, cvar_jump_knife1, cvar_speed_knife1, cvar_damage_knife1
new cvar_knock_knife2, cvar_jump_knife2, cvar_speed_knife2, cvar_damage_knife2
new cvar_knock_knife3, cvar_jump_knife3, cvar_speed_knife3, cvar_damage_knife3
new cvar_knock_knife4, cvar_jump_knife4, cvar_speed_knife4, cvar_damage_knife4
new cvar_knock_knife5, cvar_jump_knife5, cvar_speed_knife5, cvar_damage_knife5
new cvar_knock_knife6, cvar_jump_knife6, cvar_speed_knife6, cvar_damage_knife6
new cvar_knock_knife7, cvar_jump_knife7, cvar_speed_knife7, cvar_damage_knife7
new cvar_knock_knife8, cvar_jump_knife8, cvar_speed_knife8, cvar_damage_knife8
new cvar_knock_knife9, cvar_jump_knife9, cvar_speed_knife9, cvar_damage_knife9

new const g_sound_knife[] = { "items/gunpickup2.wav" }

new const g_sound_knife1[][] =
{
"knife/knife_draw_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_stab_fix.wav",
"knife/knife_slash_fix.wav",
"knife/knife_stab_fix.wav"
}

new const g_sound_knife2[][] =
{
"knife/knife_draw_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_stab_fix.wav",
"knife/knife_slash_fix.wav",
"knife/knife_stab_fix.wav"
}

new const g_sound_knife3[][] =
{
"knife/knife_draw_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_stab_fix.wav",
"knife/knife_slash_fix.wav",
"knife/knife_stab_fix.wav"
}

new const g_sound_knife4[][] =
{
"knife/hammer_draw.wav",
"knife/hammer_hit_01.wav",
"knife/hammer_hit_02.wav",
"knife/hammer_hit_wall.wav",
"knife/hammer_miss.wav",
"knife/hammer_stab.wav"
}

new const g_sound_knife5[][] =
{
"knife/hammer_draw.wav",
"knife/hammer_hit_01.wav",
"knife/hammer_hit_02.wav",
"knife/hammer_hit_wall.wav",
"knife/hammer_miss.wav",
"knife/hammer_stab.wav"
}

new const g_sound_knife6[][] =
{
"knife/hammer_draw.wav",
"knife/hammer_hit_01.wav",
"knife/hammer_hit_02.wav",
"knife/hammer_hit_wall.wav",
"knife/hammer_miss.wav",
"knife/hammer_stab.wav"
}

new const g_sound_knife7[][] =
{
"knife/knife_draw_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_hit_fix.wav",
"knife/knife_stab_fix.wav",
"knife/knife_slash_fix.wav",
"knife/knife_stab_fix.wav"
}

new const g_sound_knife8[][] =
{
"knife/warhammer_draw.wav",
"knife/warhammer_hit1.wav",
"knife/warhammer_hit1.wav",
"knife/warhammer_hitwall1.wav",
"knife/warhammer_slash1.wav",
"knife/warhammer_stab.wav"
}

new const g_sound_knife9[][] =
{
"knife/hammer_draw.wav",
"knife/hammer_hit_01.wav",
"knife/hammer_hit_02.wav",
"knife/hammer_hit_wall.wav",
"knife/hammer_miss.wav",
"knife/hammer_stab.wav"
}

public plugin_init()
{
register_plugin(PLUGIN , VERSION , AUTHOR)
register_cvar("zp_addon_knife", VERSION, FCVAR_SERVER)

register_clcmd("knife", "knife_menu")
register_menu("knife", key, "menu_knife")

register_event("CurWeapon","checkWeapon","be","1=1")

register_forward(FM_EmitSound, "CEntity__EmitSound")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")

RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_Spawn, "player", "fw_playerspawn_post", 1)
RegisterHam(Ham_Use, "func_tank", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankmortar", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankrocket", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tanklaser", "fw_UseStationary_Post", 1)

register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")

cvar_jump_knife1 = register_cvar("zp_knife1_jump", "380.0")
cvar_speed_knife1 = register_cvar("zp_knife1_speed", "285.0")
cvar_damage_knife1 = register_cvar("zp_knife1_damage", "8.0")
cvar_knock_knife1 = register_cvar("zp_knife1_knockback", "1.0")

cvar_jump_knife2 = register_cvar("zp_knife2_jump", "380.0")
cvar_speed_knife2 = register_cvar("zp_knife2_speed", "285.0")
cvar_damage_knife2 = register_cvar("zp_knife2_damage", "8.0")
cvar_knock_knife2 = register_cvar("zp_knife2_knockback", "1.0")

cvar_jump_knife3 = register_cvar("zp_knife3_jump", "380.0")
cvar_speed_knife3 = register_cvar("zp_knif3_speed", "285.0")
cvar_damage_knife3 = register_cvar("zp_knife3_damage", "9.0")
cvar_knock_knife3 = register_cvar("zp_knife3_knockback", "1.0")

cvar_jump_knife4 = register_cvar("zp_knife4_jump", "380.0")
cvar_speed_knife4 = register_cvar("zp_knife4_speed", "290.0")
cvar_damage_knife4 = register_cvar("zp_knife4_damage", "10.0")
cvar_knock_knife4 = register_cvar("zp_knife4_knockback", "1.2")

cvar_jump_knife5 = register_cvar("zp_knife5_jump", "380.0")
cvar_speed_knife5 = register_cvar("zp_knife5_speed", "290.0")
cvar_damage_knife5 = register_cvar("zp_knife5_damage", "11.0")
cvar_knock_knife5 = register_cvar("zp_knife5_knockback", "1.4")

cvar_jump_knife6 = register_cvar("zp_knife6_jump", "380.0")
cvar_speed_knife6 = register_cvar("zp_knife6_speed", "295.0")
cvar_damage_knife6 = register_cvar("zp_knife6_damage", "12.0")
cvar_knock_knife6 = register_cvar("zp_knife6_knockback", "1.5")

cvar_jump_knife7 = register_cvar("zp_knife7_jump", "380.0")
cvar_speed_knife7 = register_cvar("zp_knife7_speed", "300.0")
cvar_damage_knife7 = register_cvar("zp_knife7_damage", "13.0")
cvar_knock_knife7 = register_cvar("zp_knife7_knockback", "1.7")

cvar_jump_knife8 = register_cvar("zp_knife8_jump", "380.0")
cvar_speed_knife8 = register_cvar("zp_knife8_speed", "305.0")
cvar_damage_knife8 = register_cvar("zp_knife8_damage", "14.0")
cvar_knock_knife8 = register_cvar("zp_knife8_knockback", "1.8")

cvar_jump_knife9 = register_cvar("zp_knife9_jump", "380.0")
cvar_speed_knife9 = register_cvar("zp_knife9_speed", "310.0")
cvar_damage_knife9 = register_cvar("zp_knife9_damage", "15.0")
cvar_knock_knife9 = register_cvar("zp_knife9_knockback", "1.9")
}

public client_connect(id)
{
g_has_knife1[id] = true
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false
}

public client_disconnect(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false
}

public plugin_precache()
{
precache_model(KNIFE1_V_MODEL)
precache_model(KNIFE1_P_MODEL)
precache_model(KNIFE2_V_MODEL)
precache_model(KNIFE2_P_MODEL)
precache_model(KNIFE3_V_MODEL)
precache_model(KNIFE3_P_MODEL)
precache_model(KNIFE4_V_MODEL)
precache_model(KNIFE4_P_MODEL)
precache_model(KNIFE5_V_MODEL)
precache_model(KNIFE5_P_MODEL)
precache_model(KNIFE6_V_MODEL)
precache_model(KNIFE6_P_MODEL)
precache_model(KNIFE7_V_MODEL)
precache_model(KNIFE7_P_MODEL)
precache_model(KNIFE8_V_MODEL)
precache_model(KNIFE8_P_MODEL)
precache_model(KNIFE9_V_MODEL)
precache_model(KNIFE9_P_MODEL)

precache_sound(g_sound_knife)

for(new i = 0; i < sizeof g_sound_knife1; i++)
precache_sound(g_sound_knife1[i])

for(new i = 0; i < sizeof g_sound_knife2; i++)
precache_sound(g_sound_knife2[i])

for(new i = 0; i < sizeof g_sound_knife3; i++)
precache_sound(g_sound_knife3[i])

for(new i = 0; i < sizeof g_sound_knife4; i++)
precache_sound(g_sound_knife4[i])

for(new i = 0; i < sizeof g_sound_knife5; i++)
precache_sound(g_sound_knife5[i])

for(new i = 0; i < sizeof g_sound_knife6; i++)
precache_sound(g_sound_knife6[i])

for(new i = 0; i < sizeof g_sound_knife7; i++)
precache_sound(g_sound_knife7[i])

for(new i = 0; i < sizeof g_sound_knife8; i++)
precache_sound(g_sound_knife8[i])

for(new i = 0; i < sizeof g_sound_knife9; i++)
precache_sound(g_sound_knife9[i])

g_flameSpr = precache_model("sprites/flame.spr")
g_SpriteGlass = precache_model(g_SpriteGlasses)
g_smokeSpr = precache_model("sprites/black_smoke3.spr")
}

public clcmd_knife(id)
{
if(!is_user_alive(id))
return;

engclient_cmd(id, "weapon_knife")
}

public knife_menu(id)
{
if(!is_user_alive(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы метрвы!", ZP_PREFIX)
return PLUGIN_HANDLED
}

if(zp_get_user_survivor(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы выживший!", ZP_PREFIX)
return PLUGIN_HANDLED
}
else if(zp_get_user_nemesis(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы дьявол!", ZP_PREFIX)
return PLUGIN_HANDLED
}

if(zp_get_user_zombie(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы зомби!", ZP_PREFIX)
return PLUGIN_HANDLED
}

static menu[512], len, userflags
len = 0
userflags = get_user_flags(id)

new player_name[32]

get_user_name(id, player_name, 31)

// Title
len += formatex(menu[len], charsmax(menu) - len, "\yМеню ножей^n")

len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Тесак \yУрон^n")

len += formatex(menu[len], charsmax(menu) - len, "\r2.\w Штык \yСкорость^n")

len += formatex(menu[len], charsmax(menu) - len, "\r3.\w Лезвия \yГравитация^n")

if(userflags & VIP)
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w Хаммер \yСПОСОБНОСТЬ \r[VIP]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r4.\d Хаммер \r[VIP]^n")

if(userflags & VIP)
len += formatex(menu[len], charsmax(menu) - len, "\r5.\w Топор \rПоджог \r[VIP]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r5.\d Топор \r[VIP]^n")

if(userflags & VIP)
len += formatex(menu[len], charsmax(menu) - len, "\r6.\w Кувалда \rПоджог \r[VIP]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r6.\d Кувалда \r[VIP]^n")

if(userflags & ADMIN)
len += formatex(menu[len], charsmax(menu) - len, "\r7.\w Косса \rПоджог \r[ADMIN]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r7.\d Косса \r[ADMIN]^n")

if(userflags & ADMIN)
len += formatex(menu[len], charsmax(menu) - len, "\r8.\w Бензопила \rПоджог \r[ADMIN]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r8.\d Бензопила \r[ADMIN]^n")

if(userflags & ADMIN)
len += formatex(menu[len], charsmax(menu) - len, "\r9.\w Молот \rПоджог \r[ADMIN]^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r9.\d Молот \r[ADMIN]^n")

len += formatex(menu[len], charsmax(menu) - len, "^n\r0 \wВыход")

show_menu(id, key, menu, -1, "knife")
return PLUGIN_HANDLED
}

public menu_knife(id, key)
{
new userflags
userflags = get_user_flags(id)

switch(key)
{
case 0: buy_knife1(id)
case 1: buy_knife2(id)
case 2: buy_knife3(id)
case 3:
{
if(!(userflags & VIP))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать этот Ножи, т.к. Вы Не VIP!", ZP_PREFIX)
knife_menu(id)
return PLUGIN_HANDLED
}

buy_knife4(id)
}
case 4:
{
if(!(userflags & VIP))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать этот Ножи, т.к. Вы Не VIP!", ZP_PREFIX)
knife_menu(id)
return PLUGIN_HANDLED
}

buy_knife5(id)
}
case 5:
{
if(!(userflags & VIP))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать этот Ножи, т.к. Вы Не VIP!", ZP_PREFIX)
knife_menu(id)
return PLUGIN_HANDLED
}

buy_knife6(id)
}
case 6:
{
if(!(userflags & ADMIN))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать этот Ножи, т.к. Вы Не ADMIN!", ZP_PREFIX)
knife_menu(id)
return PLUGIN_HANDLED
}

buy_knife7(id)
}

case 7:
{
if(!(userflags & ADMIN))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать этот Ножи, т.к. Вы Не ADMIN!", ZP_PREFIX)
knife_menu(id)
return PLUGIN_HANDLED
}

buy_knife8(id)
}

case 8:
{
if(!(userflags & ADMIN))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать этот Ножи, т.к. Вы Не ADMIN!", ZP_PREFIX)
knife_menu(id)
return PLUGIN_HANDLED
}

buy_knife9(id)
}
}
return PLUGIN_HANDLED
}

public buy_knife1(id)
{
g_has_knife1[id] = true
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife2(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = true
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife3(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = true
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife4(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = true
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife5(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = true
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife6(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = true
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife7(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = true
g_has_knife8[id] = false
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife8(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = true
g_has_knife9[id] = false

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public buy_knife9(id)
{
g_has_knife1[id] = false
g_has_knife2[id] = false
g_has_knife3[id] = false
g_has_knife4[id] = false
g_has_knife5[id] = false
g_has_knife6[id] = false
g_has_knife7[id] = false
g_has_knife8[id] = false
g_has_knife9[id] = true

message_begin(MSG_ONE, get_user_msgid("WeapPickup"), {0,0,0}, id)
write_byte(29)
message_end()

checkWeapon(id)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_sound_knife, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

public fw_UseStationary_Post(entity, caller, activator, use_type)
{
if (use_type == 0 && is_user_connected(caller))
checkWeapon(caller)
}

public zp_user_infected_post(id)
{
return;
}

public checkWeapon(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
return;

if (g_has_knife1[id] || g_has_knife2[id] || g_has_knife3[id] || g_has_knife4[id] || g_has_knife5[id] || g_has_knife6[id] || g_has_knife7[id] || g_has_knife8[id] || g_has_knife9[id])
{
checkModel(id)
}
return;
}

public checkModel(id)
{
if (zp_get_user_zombie(id))
{
return;
}

if(get_user_weapon(id) != CSW_KNIFE)
return;

if (g_has_knife1[id])
{
set_pev(id, pev_viewmodel2, KNIFE1_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE1_P_MODEL)
}
else if (g_has_knife2[id])
{
set_pev(id, pev_viewmodel2, KNIFE2_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE2_P_MODEL)
}
else if (g_has_knife3[id])
{
set_pev(id, pev_viewmodel2, KNIFE3_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE3_P_MODEL)
}
else if (g_has_knife4[id])
{
set_pev(id, pev_viewmodel2, KNIFE4_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE4_P_MODEL)
}
else if (g_has_knife5[id])
{
set_pev(id, pev_viewmodel2, KNIFE5_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE5_P_MODEL)
}
else if (g_has_knife6[id])
{
set_pev(id, pev_viewmodel2, KNIFE6_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE6_P_MODEL)
}
else if (g_has_knife7[id])
{
set_pev(id, pev_viewmodel2, KNIFE7_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE7_P_MODEL)
}
else if (g_has_knife8[id])
{
set_pev(id, pev_viewmodel2, KNIFE8_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE8_P_MODEL)
}
else if (g_has_knife9[id])
{
set_pev(id, pev_viewmodel2, KNIFE9_V_MODEL)
set_pev(id, pev_weaponmodel2, KNIFE9_P_MODEL)
}
}

public fw_playerspawn_post(id)
{
if(!is_user_alive(id))
return;
}

public CEntity__EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
{
if (!is_user_connected(id))
return HAM_IGNORED

if (zp_get_user_zombie(id))
return HAM_IGNORED

if (sample[8] == 'k' && sample[9] == 'n' && sample[10] == 'i')
{
if (sample[14] == 'd')
{
if(g_has_knife1[id])
emit_sound(id, channel, g_sound_knife1[0], volume, attn, flags, pitch)
if(g_has_knife2[id])
emit_sound(id, channel, g_sound_knife2[0], volume, attn, flags, pitch)
if(g_has_knife3[id])
emit_sound(id, channel, g_sound_knife3[0], volume, attn, flags, pitch)
if(g_has_knife4[id])
emit_sound(id, channel, g_sound_knife4[0], volume, attn, flags, pitch)
if(g_has_knife5[id])
emit_sound(id, channel, g_sound_knife5[0], volume, attn, flags, pitch)
if(g_has_knife6[id])
emit_sound(id, channel, g_sound_knife6[0], volume, attn, flags, pitch)
if(g_has_knife7[id])
emit_sound(id, channel, g_sound_knife7[0], volume, attn, flags, pitch)
if(g_has_knife8[id])
emit_sound(id, channel, g_sound_knife8[0], volume, attn, flags, pitch)
if(g_has_knife9[id])
emit_sound(id, channel, g_sound_knife9[0], volume, attn, flags, pitch)
}
else if (sample[14] == 'h')
{
if (sample[17] == 'w')
{
if(g_has_knife1[id])
emit_sound(id, channel, g_sound_knife1[3], volume, attn, flags, pitch)
if(g_has_knife2[id])
emit_sound(id, channel, g_sound_knife2[3], volume, attn, flags, pitch)
if(g_has_knife3[id])
emit_sound(id, channel, g_sound_knife3[3], volume, attn, flags, pitch)
if(g_has_knife4[id])
emit_sound(id, channel, g_sound_knife4[3], volume, attn, flags, pitch)
if(g_has_knife5[id])
emit_sound(id, channel, g_sound_knife5[3], volume, attn, flags, pitch)
if(g_has_knife6[id])
emit_sound(id, channel, g_sound_knife6[3], volume, attn, flags, pitch)
if(g_has_knife7[id])
emit_sound(id, channel, g_sound_knife7[3], volume, attn, flags, pitch)
if(g_has_knife8[id])
emit_sound(id, channel, g_sound_knife8[3], volume, attn, flags, pitch)
if(g_has_knife9[id])
emit_sound(id, channel, g_sound_knife9[3], volume, attn, flags, pitch)
}
else
{
if(g_has_knife1[id])
emit_sound(id, channel, g_sound_knife1[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife2[id])
emit_sound(id, channel, g_sound_knife2[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife3[id])
emit_sound(id, channel, g_sound_knife3[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife4[id])
emit_sound(id, channel, g_sound_knife4[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife5[id])
emit_sound(id, channel, g_sound_knife5[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife6[id])
emit_sound(id, channel, g_sound_knife6[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife7[id])
emit_sound(id, channel, g_sound_knife7[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife8[id])
emit_sound(id, channel, g_sound_knife8[random_num(1,2)], volume, attn, flags, pitch)
if(g_has_knife9[id])
emit_sound(id, channel, g_sound_knife9[random_num(1,2)], volume, attn, flags, pitch)
}
}
else
{
if (sample[15] == 'l')
{
if(g_has_knife1[id])
emit_sound(id, channel, g_sound_knife1[4], volume, attn, flags, pitch)
if(g_has_knife2[id])
emit_sound(id, channel, g_sound_knife2[4], volume, attn, flags, pitch)
if(g_has_knife3[id])
emit_sound(id, channel, g_sound_knife3[4], volume, attn, flags, pitch)
if(g_has_knife4[id])
emit_sound(id, channel, g_sound_knife4[4], volume, attn, flags, pitch)
if(g_has_knife5[id])
emit_sound(id, channel, g_sound_knife5[4], volume, attn, flags, pitch)
if(g_has_knife6[id])
emit_sound(id, channel, g_sound_knife6[4], volume, attn, flags, pitch)
if(g_has_knife7[id])
emit_sound(id, channel, g_sound_knife7[4], volume, attn, flags, pitch)
if(g_has_knife8[id])
emit_sound(id, channel, g_sound_knife8[4], volume, attn, flags, pitch)
if(g_has_knife9[id])
emit_sound(id, channel, g_sound_knife9[4], volume, attn, flags, pitch)
}
else
{
if(g_has_knife1[id])
emit_sound(id, channel, g_sound_knife1[5], volume, attn, flags, pitch)
if(g_has_knife2[id])
emit_sound(id, channel, g_sound_knife2[5], volume, attn, flags, pitch)
if(g_has_knife3[id])
emit_sound(id, channel, g_sound_knife3[5], volume, attn, flags, pitch)
if(g_has_knife4[id])
emit_sound(id, channel, g_sound_knife4[5], volume, attn, flags, pitch)
if(g_has_knife5[id])
emit_sound(id, channel, g_sound_knife5[5], volume, attn, flags, pitch)
if(g_has_knife6[id])
emit_sound(id, channel, g_sound_knife6[5], volume, attn, flags, pitch)
if(g_has_knife7[id])
emit_sound(id, channel, g_sound_knife7[5], volume, attn, flags, pitch)
if(g_has_knife8[id])
emit_sound(id, channel, g_sound_knife8[5], volume, attn, flags, pitch)
if(g_has_knife9[id])
emit_sound(id, channel, g_sound_knife9[5], volume, attn, flags, pitch)
}
}
return HAM_SUPERCEDE
}
return HAM_IGNORED
}

public fw_PlayerPreThink(id)
{
if(!is_user_alive(id) || zp_get_user_zombie(id))
return FMRES_IGNORED

new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])

if (weapon == CSW_KNIFE && g_has_knife1[id])
{
set_user_maxspeed(id,get_pcvar_float(cvar_speed_knife1))

if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife1)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if(weapon == CSW_KNIFE && g_has_knife2[id])
{
set_user_maxspeed(id,get_pcvar_float(cvar_speed_knife2))

if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife2)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}
}
if(weapon == CSW_KNIFE && g_has_knife3[id])
{
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife3)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}

set_user_maxspeed(id,get_pcvar_float(cvar_speed_knife3))
}
if (weapon == CSW_KNIFE && g_has_knife4[id])
{
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife4)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}

set_user_maxspeed(id, get_pcvar_float(cvar_speed_knife4))
}
if (weapon == CSW_KNIFE && g_has_knife5[id])
{
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife5)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}

set_user_maxspeed(id, get_pcvar_float(cvar_speed_knife5))
}
if (weapon == CSW_KNIFE && g_has_knife6[id])
{
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife6)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}

set_user_maxspeed(id, get_pcvar_float(cvar_speed_knife6))
}
if (weapon == CSW_KNIFE && g_has_knife7[id])
{
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife7)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}

set_user_maxspeed(id, get_pcvar_float(cvar_speed_knife7))
}

if (weapon == CSW_KNIFE && g_has_knife8[id])
{
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife8)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}

set_user_maxspeed(id, get_pcvar_float(cvar_speed_knife8))
}

if (weapon == CSW_KNIFE && g_has_knife9[id])
{
if ((pev(id, pev_button) & IN_JUMP) && !(pev(id, pev_oldbuttons) & IN_JUMP))
{
new flags = pev(id, pev_flags)
new waterlvl = pev(id, pev_waterlevel)

if (!(flags & FL_ONGROUND))
return FMRES_IGNORED

if (flags & FL_WATERJUMP)
return FMRES_IGNORED

if (waterlvl > 1)
return FMRES_IGNORED

new Float:fVelocity[3]
pev(id, pev_velocity, fVelocity)

fVelocity[2] += get_pcvar_num(cvar_jump_knife9)

set_pev(id, pev_velocity, fVelocity)
set_pev(id, pev_gaitsequence, 6)
}

set_user_maxspeed(id, get_pcvar_float(cvar_speed_knife9))
}
return FMRES_IGNORED
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(!is_user_connected(attacker))
return HAM_IGNORED

if(zp_get_user_zombie(attacker))
return HAM_IGNORED

if(g_frozen[victim])
return HAM_SUPERCEDE

if(get_user_weapon(attacker) == CSW_KNIFE)
{

if (g_has_knife1[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife1))

new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife1);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
else if (g_has_knife2[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife2))

new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife2);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
else if (g_has_knife3[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife3))

new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife3);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
else if (g_has_knife4[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife4))

new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife4);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
else if (g_has_knife5[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife5))

if(!task_exists(victim + 100) && !g_fire_wait[attacker])
{
g_burning_duration[victim] += FIRE_DURATION

set_task(0.2, "effects", victim + 100, _, _, "b")
g_fire_wait[attacker] = true
set_task(FIRE_REFRESH, "fire_wait", attacker + 1231263)
}

new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife5);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
else if (g_has_knife6[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife6))

if(!task_exists(victim + 100) && !g_fire_wait[attacker])
{
g_burning_duration[victim] += FIRE_DURATION

set_task(0.2, "effects", victim + 100, _, _, "b")
g_fire_wait[attacker] = true
set_task(FIRE_REFRESH, "fire_wait", attacker + 1231263)
}

new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife6);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
else if (g_has_knife7[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife7))

if(!task_exists(victim + 100) && !g_fire_wait[attacker])
{
g_burning_duration[victim] += FIRE_DURATION

set_task(0.2, "effects", victim + 100, _, _, "b")
g_fire_wait[attacker] = true
set_task(FIRE_REFRESH, "fire_wait", attacker + 1231263)
}

new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife7);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}

else if (g_has_knife8[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife8))

if(!g_freeze_wait[attacker] && !zp_is_nemesis_round())
{
set_pev(victim, pev_flags, pev(victim, pev_flags) | FL_FROZEN)
set_user_rendering(victim, kRenderFxGlowShell, 0, 206, 209, kRenderNormal, 25)
g_frozen[victim] = true
set_task(TIME_FREEZE, "end", victim)
g_freeze_wait[attacker] = true
set_task(TIME_WAIT_FREEZE, "Freeze_Wait", attacker + 1233123)
}
else
{
new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife8);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
}

else if (g_has_knife9[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_knife9))

if(!g_freeze_wait[attacker] && !zp_is_nemesis_round())
{
set_pev(victim, pev_flags, pev(victim, pev_flags) | FL_FROZEN)
set_user_rendering(victim, kRenderFxGlowShell, 0, 206, 209, kRenderNormal, 25)
g_frozen[victim] = true
set_task(TIME_FREEZE, "end", victim)
g_freeze_wait[attacker] = true
set_task(TIME_WAIT_FREEZE, "Freeze_Wait", attacker + 1233123)
}
else
{
new Float:vec[3];
new Float:oldvelo[3];
pev(victim, pev_velocity, oldvelo);
create_velocity_vector(victim , attacker , vec);
vec[0] += oldvelo[0] + get_pcvar_float(cvar_knock_knife9);
vec[1] += oldvelo[1] + 0;
set_pev(victim, pev_velocity, vec);
}
}
more_blood(victim)
}
return HAM_IGNORED
}

public fire_wait(taskid)
{
new attacker = taskid - 1231263

if(is_user_alive(attacker))
{
remove_task(attacker + 1231263)
g_fire_wait[attacker] = false
PrintChatColor(attacker, "!g[%s] !yТвоя способность поджечь !g[Готова]", ZP_PREFIX)
}
else remove_task(attacker + 1231263)
}

public Freeze_Wait(taskid)
{
new attacker = taskid - 1233123

if(is_user_alive(attacker))
{
remove_task(attacker + 1233123)
g_freeze_wait[attacker] = false
PrintChatColor(attacker, "!g[%s] !yТвоя способность заморозить !g[Готова]", ZP_PREFIX)
}
else remove_task(attacker + 1233123)
}

public message_DeathMsg(msg_id, msg_dest, id)
{
static szTruncatedWeapon[33], iattacker, ivictim

get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))

iattacker = get_msg_arg_int(1)
ivictim = get_msg_arg_int(2)

if(!is_user_connected(iattacker) || iattacker == ivictim)
return PLUGIN_CONTINUE

if (!zp_get_user_zombie(iattacker))
{
if(equal(szTruncatedWeapon, "knife1") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife1[iattacker])
set_msg_arg_string(7, "knife1")
}

if(equal(szTruncatedWeapon, "knife2") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife2[iattacker])
set_msg_arg_string(7, "knife2")
}

if(equal(szTruncatedWeapon, "knife3") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife3[iattacker])
set_msg_arg_string(7, "knife3")
}

if(equal(szTruncatedWeapon, "knife4") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife4[iattacker])
set_msg_arg_string(7, "knife4")
}

if(equal(szTruncatedWeapon, "knife5") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife5[iattacker])
set_msg_arg_string(7, "knife5")
}

if(equal(szTruncatedWeapon, "knife6") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife6[iattacker])
set_msg_arg_string(7, "knife6")
}

if(equal(szTruncatedWeapon, "knife7") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife7[iattacker])
set_msg_arg_string(7, "knife7")
}

if(equal(szTruncatedWeapon, "knife8") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife8[iattacker])
set_msg_arg_string(7, "knife8")
}

if(equal(szTruncatedWeapon, "knife9") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife9[iattacker])
set_msg_arg_string(7, "knife9")
}

if(equal(szTruncatedWeapon, "by_elf1") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(!g_has_knife1[iattacker] && !g_has_knife2[iattacker] && !g_has_knife3[iattacker] && !g_has_knife4[iattacker] && !g_has_knife5[iattacker] && !g_has_knife6[iattacker] && !g_has_knife7[iattacker] && !g_has_knife8[iattacker] && !g_has_knife9[iattacker] && !zp_get_user_zombie(iattacker))
set_msg_arg_string(7, "by_elf1")
}
}
if (zp_get_user_zombie(iattacker))
{
if(equal(szTruncatedWeapon, "by_elf2") && get_user_weapon(iattacker) == CSW_KNIFE)
{
if(g_has_knife1[iattacker] || g_has_knife2[iattacker] || g_has_knife3[iattacker] || g_has_knife4[iattacker] || g_has_knife5[iattacker] || g_has_knife6[iattacker] || g_has_knife7[iattacker] || g_has_knife8[iattacker] || g_has_knife9[iattacker])
set_msg_arg_string(7, "by_elf2")
}
}
return PLUGIN_CONTINUE
}

stock create_velocity_vector(victim,attacker,Float:velocity[3])
{
if(!zp_get_user_zombie(victim) || !is_user_alive(attacker))
return 0;

new Float:vicorigin[3];
new Float:attorigin[3];
pev(victim, pev_origin , vicorigin);
pev(attacker, pev_origin , attorigin);

new Float:origin2[3]
origin2[0] = vicorigin[0] - attorigin[0];
origin2[1] = vicorigin[1] - attorigin[1];

new Float:largestnum = 0.0;

if(floatabs(origin2[0])>largestnum) largestnum = floatabs(origin2[0]);
if(floatabs(origin2[1])>largestnum) largestnum = floatabs(origin2[1]);

origin2[0] /= largestnum;
origin2[1] /= largestnum;

if (g_has_knife1[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife1) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife1) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife2[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife2) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife2) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife3[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife3) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife3) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife4[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife4) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife4) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife5[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife5) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife5) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife6[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife6) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife6) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife7[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife7) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife7) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife8[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife8) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife8) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}
else if (g_has_knife9[attacker])
{
velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_knife9) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_knife9) * 10000 ) / floatround(get_distance_f(vicorigin, attorigin));
}

if(velocity[0] <= 20.0 || velocity[1] <= 20.0)
velocity[2] = random_float(200.0 , 275.0);

return 1;
}

stock fm_set_user_maxspeed(index, Float:speed = -1.0)
{
engfunc(EngFunc_SetClientMaxspeed, index, speed);
set_pev(index, pev_maxspeed, speed);

return 1;
}

public effects(taskid)
{
static origin[3], flags;
get_user_origin(ID_FBURN, origin);
flags = pev(ID_FBURN, pev_flags);

if ((flags & FL_INWATER) || g_burning_duration[ID_FBURN] < 1 || !is_user_alive(ID_FBURN))
{
message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
write_byte(TE_SMOKE); // TE id
write_coord(origin[0]); // x
write_coord(origin[1]); // y
write_coord(origin[2]-50); // z
write_short(g_smokeSpr); // sprite
write_byte(random_num(15, 20)); // scale
write_byte(random_num(10, 20)); // framerate
message_end();

remove_task(taskid);
return;
}

static health;
health = pev(ID_FBURN, pev_health);

if (health - FIRE_DAMAGE > 0)
set_user_health(ID_FBURN, health - FIRE_DAMAGE);

message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
write_byte(TE_SPRITE); // TE id
write_coord(origin[0]+random_num(-5, 5));
write_coord(origin[1]+random_num(-5, 5));
write_coord(origin[2]+random_num(-10, 10));
write_short(g_flameSpr);
write_byte(random_num(5, 10));
write_byte(200); // brightnes
message_end();

g_burning_duration[ID_FBURN]--;
}

public end(victim)
{
if(g_frozen[victim])
g_frozen[victim] = false

set_pev(victim, pev_flags, pev(victim, pev_flags) & ~FL_FROZEN)
set_user_rendering(victim, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25)
CreateGlass(victim)

remove_task(victim)
}

more_blood(id)
{
static iOrigin[3]
get_user_origin(id, iOrigin)

message_begin(MSG_PVS, SVC_TEMPENTITY, iOrigin)
write_byte(TE_BLOODSTREAM)
write_coord(iOrigin[0])
write_coord(iOrigin[1])
write_coord(iOrigin[2]+10)
write_coord(random_num(-360, 360))
write_coord(random_num(-360, 360))
write_coord(-10)
write_byte(70)
write_byte(random_num(50, 100))
message_end()

for (new j = 0; j < 4; j++)
{
message_begin(MSG_PVS, SVC_TEMPENTITY, iOrigin)
write_byte(TE_WORLDDECAL)
write_coord(iOrigin[0]+random_num(-100, 100))
write_coord(iOrigin[1]+random_num(-100, 100))
write_coord(iOrigin[2]-36)
write_byte(random_num(190, 197))
message_end()
}
}

stock CreateGlass(id)
{
new szOrigin[3];
get_user_origin(id, szOrigin);

message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_BREAKMODEL);
write_coord( szOrigin[0] );
write_coord( szOrigin[1] );
write_coord( szOrigin[2] + 24 );
write_coord(16);
write_coord(16);
write_coord(16);
write_coord( random_num(-50, 50) );
write_coord( random_num(-50, 50) );
write_coord(25);
write_byte(10);
write_short(g_SpriteGlass);
write_byte(10);
write_byte(25);
write_byte(0x01);
message_end();
}

public sprite(const player, const string_msg[], byte_1, byte_2, byte_3, byte_4, byte_5, byte_6, byte_7, byte_8)
{
message_begin( MSG_ONE, get_user_msgid("WeaponList"), .player = player );
{
write_string(string_msg);
write_byte(byte_1);
write_byte(byte_2);
write_byte(byte_3);
write_byte(byte_4);
write_byte(byte_5);
write_byte(byte_6);
write_byte(byte_7);
write_byte(byte_8);
}
message_end();
}

stock PrintChatColor(const id , const input[], any:...)
{
new count = 1, players[32]
static msg[191]
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, "!team", "^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, get_user_msgid("SayText" ), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
public knife_menu(id)
{
if(!is_user_alive(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы метрвы!", ZP_PREFIX)
return PLUGIN_HANDLED
}

if(zp_get_user_survivor(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы выживший!", ZP_PREFIX)
return PLUGIN_HANDLED
}
else if(zp_get_user_nemesis(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы дьявол!", ZP_PREFIX)
return PLUGIN_HANDLED
}

if(zp_get_user_zombie(id))
{
PrintChatColor(id, "!g[%s] !yВы не можете Выбрать Ножи, т.к. Вы зомби!", ZP_PREFIX)
return PLUGIN_HANDLED
}

Хочу как-то сделать так, чтобы после начала раунда запретить открывать меню
 
Сообщения
201
Реакции
20
Помог
5 раз(а)
Код:
if(g_has_knifeX[id])
{
    PrintChatColor(id, "!g[%s] !yу тебя есть нож X", ZP_PREFIX)
    
    return PLUGIN_HANDLED
}
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу