После заморозки от ножа, остаётся модель игрока

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
418
Реакции
-7
Предупреждения
8
1680296319349.png



C++:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN  "[ZP] Addon: Knifes"
#define VERSION "NEW"
#define AUTHOR  "Mr.TheFold, redacted by _RedGamer_"

#define VIP ADMIN_LEVEL_H
#define SUPER_VIP ADMIN_LEVEL_F
#define OWNER ADMIN_LEVEL_G
#define CREATOR ADMIN_MENU

// Поджог
#define TASK_FBURN     100
#define ID_FBURN      ( taskid - TASK_FBURN )

#define FIRE_DURATION     6
#define FIRE_DAMAGE       25

// Отравление
#define TASK_POISBURN     100
#define ID_POISBURN      ( taskid - TASK_POISBURN )

#define POISON_DURATION     12
#define POISON_DAMAGE       50

// Максимальное количество игроков
#define MAX_CLIENTS               32

const Float:TIME_FREEZE            =    5.0
const Float:TIME_WAIT_FREEZE        =    10.0

#define m_flNextAttack 83

new KNIFE1_V_MODEL[] = "models/CSO_Knifes/v_strong.mdl"
new KNIFE1_P_MODEL[] = "models/CSO_Knifes/p_strong.mdl"
 
new KNIFE2_V_MODEL[] = "models/CSO_Knifes/v_katana.mdl"
new KNIFE2_P_MODEL[] = "models/CSO_Knifes/p_katana.mdl"
 
new KNIFE3_V_MODEL[] = "models/CSO_Knifes/v_combat.mdl"
new KNIFE3_P_MODEL[] = "models/CSO_Knifes/p_combat.mdl"

new KNIFE4_V_MODEL[] = "models/CSO_Knifes/v_hammer_fire.mdl"
new KNIFE4_P_MODEL[] = "models/CSO_Knifes/p_hammer_fire.mdl"

new KNIFE5_V_MODEL[] = "models/CSO_Knifes/v_hammer_ice.mdl"
new KNIFE5_P_MODEL[] = "models/CSO_Knifes/p_hammer_ice.mdl"

new KNIFE6_V_MODEL[] = "models/CSO_Knifes/v_hammer_poison.mdl"
new KNIFE6_P_MODEL[] = "models/CSO_Knifes/p_hammer_poison.mdl"

new KNIFE7_V_MODEL[] = "models/CSO_Knifes/v_demonsword.mdl"
new KNIFE7_P_MODEL[] = "models/CSO_Knifes/p_demonsword.mdl"

new const g_SpriteGlasses[] = "models/glassgibs.mdl"
 
new bool:g_has_strong[33]
new bool:g_has_katana[33]
new bool:g_has_combat[33]
new bool:g_has_hammer_fire[33]
new bool:g_has_hammer_ice[33]
new bool:g_has_hammer_poison[33]
new bool:g_has_demonsword[33]

new bool:g_fRoundEnd
 
new g_flameSpr, g_smokeSpr, g_burning_duration[ MAX_CLIENTS + 1 ]
new g_freeze_wait[33]
new g_poisonSpr, g_poisoning_duration[ MAX_CLIENTS + 1 ]
new g_antidote_wait[33]
new g_frozen[33], g_SpriteGlass

new g_knife_menu, g_vip_knife_menu, g_supervip_knife_menu, g_owner_knife_menu, g_creator_knife_menu
new cvar_knock_strong, cvar_jump_strong, cvar_speed_strong, cvar_damage_strong
new cvar_knock_katana, cvar_jump_katana, cvar_speed_katana, cvar_damage_katana
new cvar_knock_combat, cvar_jump_combat, cvar_speed_combat, cvar_damage_combat
new cvar_knock_hammer_fire, cvar_jump_hammer_fire, cvar_speed_hammer_fire, cvar_damage_hammer_fire
new cvar_knock_hammer_ice, cvar_jump_hammer_ice, cvar_speed_hammer_ice, cvar_damage_hammer_ice
new cvar_knock_hammer_poison, cvar_jump_hammer_poison, cvar_speed_hammer_poison, cvar_damage_hammer_poison
new cvar_knock_demonsword, cvar_jump_demonsword, cvar_speed_demonsword, cvar_damage_demonsword
 
new const g_sound_knife[] = { "items/gunpickup2.wav" }
 
new const strong_sounds[][] =
{
        "CSO_Knifes/strong_draw.wav",
        "CSO_Knifes/strong_hit_01.wav",
        "CSO_Knifes/strong_hit_02.wav",
        "CSO_Knifes/strong_hit_wall.wav",
        "CSO_Knifes/strong_miss.wav",
        "CSO_Knifes/strong_stab.wav"
}
 
new const katana_sounds[][] =
{
        "CSO_Knifes/katana_draw.wav",
        "CSO_Knifes/katana_hit_01.wav",
        "CSO_Knifes/katana_hit_02.wav",
        "CSO_Knifes/katana_hit_wall.wav",
        "CSO_Knifes/katana_miss.wav",
        "CSO_Knifes/katana_stab.wav"
}
 
new const combat_sounds[][] =
{
        "CSO_Knifes/combat_draw.wav",
        "CSO_Knifes/combat_hit_01.wav",
        "CSO_Knifes/combat_hit_02.wav",
        "CSO_Knifes/combat_hit_wall.wav",
        "CSO_Knifes/combat_miss.wav",
        "CSO_Knifes/combat_stab.wav"
}

new const hammer_fire_sounds[][] =
{
        "Skull/knife_draw_fix.wav",
        "Skull/knife_hit_fix.wav",
        "Skull/knife_hit_02_fix.wav",
        "Skull/knife_wall_fix.wav",
        "Skull/knife_slash_fix.wav",
        "Skull/knife_stab_fix.wav"
}

new const hammer_ice_sounds[][] =
{
        "Skull/knife_draw_fix.wav",
        "Skull/knife_hit_fix.wav",
        "Skull/knife_hit_02_fix.wav",
        "Skull/knife_wall_fix.wav",
        "Skull/knife_slash_fix.wav",
        "Skull/knife_stab_fix.wav"
}

new const hammer_poison_sounds[][] =
{
        "Skull/knife_draw_fix.wav",
        "Skull/knife_hit_fix.wav",
        "Skull/knife_hit_02_fix.wav",
        "Skull/knife_wall_fix.wav",
        "Skull/knife_slash_fix.wav",
        "Skull/knife_stab_fix.wav"
}

new const demonsword_sounds[][] =
{
        "Skull/knife_draw_fix.wav",
        "Skull/knife_hit_fix.wav",
        "Skull/knife_hit_02_fix.wav",
        "Skull/knife_wall_fix.wav",
        "Skull/knife_slash_fix.wav",
        "Skull/knife_stab_fix.wav"
}
 
public plugin_init()
{
        register_plugin(PLUGIN , VERSION , AUTHOR);
        register_cvar("zp_addon_knife", VERSION, FCVAR_SERVER);
      
        g_knife_menu = menu_create("Выбор ножа","menu_handle")
        g_vip_knife_menu = menu_create("Выбор ножа","menu_handle_vip")
        g_supervip_knife_menu = menu_create("Выбор ножа", "menu_handle_supervip")
        g_owner_knife_menu = menu_create("Выбор ножа", "menu_handle_owner")
        g_creator_knife_menu = menu_create("Выбор ножа", "menu_handle_creator")
      
        register_clcmd("/knife","knifemenu",ADMIN_ALL,"knife_menu")
      
        build_menu()
        build_menu_vip()
        build_menu_supervip()
        build_menu_owner()
        build_menu_creator()
      
        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_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");
      
        register_clcmd("zm_knife_katana", "clcmd_knife")
        register_clcmd("zm_knife_combat", "clcmd_knife")
        register_clcmd("zm_knife_strong", "clcmd_knife")
        register_clcmd("zm_knife_hammer_fire", "clcmd_knife")
        register_clcmd("zm_knife_hammer_ice", "clcmd_knife")
        register_clcmd("zm_knife_hammer_poison", "clcmd_knife")
        register_clcmd("zm_knife_demonsword", "clcmd_knife")
      
        cvar_jump_strong = register_cvar("zp_strong_jump", "340.0")
        cvar_speed_strong = register_cvar("zp_strong_speed", "245.0")
        cvar_damage_strong = register_cvar("zp_strong_damage", "5.2")
        cvar_knock_strong = register_cvar("zp_strong_knockback", "3.2")
      
        cvar_jump_katana = register_cvar("zp_katana_jump", "380.0")
        cvar_speed_katana = register_cvar("zp_katana_speed", "245.0")
        cvar_damage_katana = register_cvar("zp_katana_damage", "3.2")
        cvar_knock_katana = register_cvar("zp_katana_knockback", "2.4")
      
        cvar_jump_combat = register_cvar("zp_combat_jump", "350.0")
        cvar_speed_combat = register_cvar("zp_combat_speed", "280.0")
        cvar_damage_combat = register_cvar("zp_combat_damage", "3.2")
        cvar_knock_combat = register_cvar("zp_combat_knockback", "2.6")

        cvar_jump_hammer_fire = register_cvar("zp_hammer_fire_jump", "360.0")
        cvar_speed_hammer_fire = register_cvar("zp_hammer_fire_speed", "280.0")
        cvar_damage_hammer_fire = register_cvar("zp_hammer_fire_damage", "10.0")
        cvar_knock_hammer_fire = register_cvar("zp_hammer_fire_knockback", "5.0")

        cvar_jump_hammer_ice = register_cvar("zp_hammer_ice_jump", "380.0")
        cvar_speed_hammer_ice = register_cvar("zp_hammer_ice_speed", "280.0")
        cvar_damage_hammer_ice = register_cvar("zp_hammer_ice_damage", "12.5")
        cvar_knock_hammer_ice = register_cvar("zp_hammer_ice_knockback", "5.0")

        cvar_jump_hammer_poison = register_cvar("zp_hammer_poison_jump", "400.0")
        cvar_speed_hammer_poison = register_cvar("zp_hammer_poison_speed", "280.0")
        cvar_damage_hammer_poison = register_cvar("zp_hammer_poison_damage", "15")
        cvar_knock_hammer_poison = register_cvar("zp_hammer_poison_knockback", "5.0")

        cvar_jump_demonsword = register_cvar("zp_demonsword_jump", "420.0")
        cvar_speed_demonsword = register_cvar("zp_demonsword_speed", "280.0")
        cvar_damage_demonsword = register_cvar("zp_demonsword_damage", "17.5")
        cvar_knock_demonsword = register_cvar("zp_demonsword_knockback", "5.0")
}
 
public client_connect(id)
{
        g_has_strong[id] = true
        g_has_katana[id] = false
        g_has_combat[id] = false
        g_has_hammer_fire[id] = false
        g_has_hammer_ice[id] = false
        g_has_hammer_poison[id] = false
        g_has_demonsword[id] = false
}
 
public client_disconnect(id)
{
        g_has_strong[id] = false
        g_has_katana[id] = false
        g_has_combat[id] = false
        g_has_hammer_fire[id] = false
        g_has_hammer_ice[id] = false
        g_has_hammer_poison[id] = false
        g_has_demonsword[id] = false
}
 
public plugin_precache()
{
        // Flame Sprites
        g_flameSpr = precache_model( "sprites/flame.spr" );
        g_smokeSpr = precache_model( "sprites/black_smoke3.spr" );

        // Poison Sprites
        g_poisonSpr = precache_model( "sprites/flame_poison.spr" );
        g_smokeSpr = precache_model( "sprites/black_smoke3.spr" );

        // Freeze Glass
        g_SpriteGlass = precache_model(g_SpriteGlasses);

        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_generic("sprites/zm_knife_katana.txt")
        precache_generic("sprites/zm_knife_combat.txt")
        precache_generic("sprites/zm_knife_strong.txt")
        precache_generic("sprites/zm_knife_hammer_fire.txt")
        precache_generic("sprites/zm_knife_hammer_ice.txt")
        precache_generic("sprites/zm_knife_hammer_poison.txt")
        precache_generic("sprites/zm_knife_demonsword.txt")
      
        precache_generic("sprites/CSO_Knifes/640hud7.spr")
        precache_generic("sprites/CSO_Knifes/640hud53.spr")
        precache_generic("sprites/CSO_Knifes/640hud38.spr")
        precache_generic("sprites/CSO_Knifes/640hud40.spr")
        precache_generic("sprites/CSO_Knifes/640hud57.spr")
      
        precache_sound(g_sound_knife)
      
        for(new i = 0; i < sizeof strong_sounds; i++)
        precache_sound(strong_sounds[i])
      
        for(new i = 0; i < sizeof katana_sounds; i++)
        precache_sound(katana_sounds[i])
      
        for(new i = 0; i < sizeof combat_sounds; i++)
        precache_sound(combat_sounds[i])
      
        for(new i = 0; i < sizeof hammer_fire_sounds; i++)
        precache_sound(hammer_fire_sounds[i])

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

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

        for(new i = 0; i < sizeof demonsword_sounds; i++)
        precache_sound(demonsword_sounds[i])
}
 
public clcmd_knife(id)
{
        if(!is_user_alive(id))
        return PLUGIN_HANDLED;
      
        engclient_cmd(id, "weapon_knife")
        return PLUGIN_HANDLED;
}
 
build_menu()
{
        menu_additem(g_knife_menu, "\y[Katana] \r[Прыжок]", "2")
        menu_additem(g_knife_menu, "\y[Combat] \r[Скорость]", "3")
        menu_additem(g_knife_menu, "\y[Strong] \r[Урон]", "1")
        menu_additem(g_knife_menu, "\y[Hammer Fire] \r[VIP]", "4")
        menu_additem(g_knife_menu, "\y[Hammer Ice] \r[SUPER VIP]", "5")
        menu_additem(g_knife_menu, "\y[Hammer Poison] \r[OWNER]", "6")
        menu_additem(g_knife_menu, "\y[Demon Sword] \r[CREATOR]", "7")
        menu_setprop(g_knife_menu, MPROP_PERPAGE, 0)
}
 
build_menu_vip()
{
        menu_additem(g_vip_knife_menu, "\y[Katana] \r[Прыжок]", "2")
        menu_additem(g_vip_knife_menu, "\y[Combat] \r[Скорость]", "3")
        menu_additem(g_vip_knife_menu, "\y[Strong] \r[Урон]", "1")
        menu_additem(g_vip_knife_menu, "\y[Hammer Fire] \r[VIP]", "4")
        menu_additem(g_vip_knife_menu, "\y[Hammer Ice] \r[SUPER VIP]", "5")
        menu_additem(g_vip_knife_menu, "\y[Hammer Poison] \r[OWNER]", "6")
        menu_additem(g_vip_knife_menu, "\y[Demon Sword] \r[CREATOR]", "7")
        menu_setprop(g_vip_knife_menu, MPROP_PERPAGE, 0)
}

build_menu_supervip()
{
        menu_additem(g_supervip_knife_menu, "\y[Katana] \r[Прыжок]", "2")
        menu_additem(g_supervip_knife_menu, "\y[Combat] \r[Скорость]", "3")
        menu_additem(g_supervip_knife_menu, "\y[Strong] \r[Урон]", "1")
        menu_additem(g_supervip_knife_menu, "\y[Hammer Fire] \r[VIP]", "4")
        menu_additem(g_supervip_knife_menu, "\y[Hammer Ice] \r[SUPER VIP]", "5")
        menu_additem(g_supervip_knife_menu, "\y[Hammer Poison] \r[OWNER]", "6")
        menu_additem(g_supervip_knife_menu, "\y[Demon Sword] \r[CREATOR]", "7")
        menu_setprop(g_supervip_knife_menu, MPROP_PERPAGE, 0)
}

build_menu_owner()
{
        menu_additem(g_owner_knife_menu, "\y[Katana] \r[Прыжок]", "2")
        menu_additem(g_owner_knife_menu, "\y[Combat] \r[Скорость]", "3")
        menu_additem(g_owner_knife_menu, "\y[Strong] \r[Урон]", "1")
        menu_additem(g_owner_knife_menu, "\y[Hammer Fire] \r[VIP]", "4")
        menu_additem(g_owner_knife_menu, "\y[Hammer Ice] \r[SUPER VIP]", "5")
        menu_additem(g_owner_knife_menu, "\y[Hammer Poison] \r[OWNER]", "6")
        menu_additem(g_owner_knife_menu, "\y[Demon Sword] \r[CREATOR]", "7")
        menu_setprop(g_owner_knife_menu, MPROP_PERPAGE, 0)
}

build_menu_creator()
{
        menu_additem(g_creator_knife_menu, "\y[Katana] \r[Прыжок]", "2")
        menu_additem(g_creator_knife_menu, "\y[Combat] \r[Скорость]", "3")
        menu_additem(g_creator_knife_menu, "\y[Strong] \r[Урон]", "1")
        menu_additem(g_creator_knife_menu, "\y[Hammer Fire] \r[VIP]", "4")
        menu_additem(g_creator_knife_menu, "\y[Hammer Ice] \r[SUPER VIP]", "5")
        menu_additem(g_creator_knife_menu, "\y[Hammer Poison] \r[OWNER]", "6")
        menu_additem(g_creator_knife_menu, "\y[Demon Sword] \r[CREATOR]", "7")
        menu_setprop(g_creator_knife_menu, MPROP_PERPAGE, 0)
}
 
public knifemenu(id)
{
        menu_display(id, !(get_user_flags(id) & VIP) ? g_knife_menu : g_vip_knife_menu, 0)
        menu_display(id, !(get_user_flags(id) & SUPER_VIP) ? g_knife_menu : g_supervip_knife_menu, 0)
        menu_display(id, !(get_user_flags(id) & OWNER) ? g_knife_menu : g_owner_knife_menu, 0)
        menu_display(id, !(get_user_flags(id) & CREATOR) ? g_knife_menu : g_creator_knife_menu, 0)
        return PLUGIN_HANDLED;
}
 
public menu_handle_vip(id, menu, item)
{
        if(item < 0)
        return PLUGIN_CONTINUE
      
        new cmd[2];
        new access, callback;
        menu_item_getinfo(menu, item, access, cmd,2,_,_, callback);
        new choice = str_to_num(cmd)
      
        switch (choice)
        {
                case 1: buy_knife1(id)
                case 2: buy_knife2(id)
                case 3: buy_knife3(id)
                case 4: buy_knife4(id)
                case 5: buy_knife5(id)
                case 6: buy_knife6(id)
                case 7: buy_knife7(id)
        }
        return PLUGIN_HANDLED;
}

public menu_handle_supervip(id, menu, item)
{
        if(item < 0)
        return PLUGIN_CONTINUE
      
        new cmd[2];
        new access, callback;
        menu_item_getinfo(menu, item, access, cmd,2,_,_, callback);
        new choice = str_to_num(cmd)
      
        switch (choice)
        {
                case 1: buy_knife1(id)
                case 2: buy_knife2(id)
                case 3: buy_knife3(id)
                case 4: buy_knife4(id)
                case 5: buy_knife5(id)
                case 6: buy_knife6(id)
                case 7: buy_knife7(id)
        }
        return PLUGIN_HANDLED;
}

public menu_handle_owner(id, menu, item)
{
        if(item < 0)
        return PLUGIN_CONTINUE
      
        new cmd[2];
        new access, callback;
        menu_item_getinfo(menu, item, access, cmd,2,_,_, callback);
        new choice = str_to_num(cmd)
      
        switch (choice)
        {
                case 1: buy_knife1(id)
                case 2: buy_knife2(id)
                case 3: buy_knife3(id)
                case 4: buy_knife4(id)
                case 5: buy_knife5(id)
                case 6: buy_knife6(id)
                case 7: buy_knife7(id)
        }
        return PLUGIN_HANDLED;
}

public menu_handle_creator(id, menu, item)
{
        if(item < 0)
        return PLUGIN_CONTINUE
      
        new cmd[2];
        new access, callback;
        menu_item_getinfo(menu, item, access, cmd,2,_,_, callback);
        new choice = str_to_num(cmd)
      
        switch (choice)
        {
                case 1: buy_knife1(id)
                case 2: buy_knife2(id)
                case 3: buy_knife3(id)
                case 4: buy_knife4(id)
                case 5: buy_knife5(id)
                case 6: buy_knife6(id)
                case 7: buy_knife7(id)
        }
        return PLUGIN_HANDLED;
}
 
public menu_handle(id, menu, item)
{
        if(item < 0)
        return PLUGIN_CONTINUE
      
        new cmd[2];
        new access, callback;
        menu_item_getinfo(menu, item, access, cmd,2,_,_, callback);
        new choice = str_to_num(cmd)
      
        switch (choice)
        {
                case 1: buy_knife1(id)
                case 2: buy_knife2(id)
                case 3: buy_knife3(id)
                case 4: buy_knife4(id)
                case 5: buy_knife5(id)
                case 6: buy_knife6(id)
                case 7: buy_knife7(id)
        }
        return PLUGIN_HANDLED;
}
 
public buy_knife1(id)
{
        g_has_strong[id] = true
        g_has_katana[id] = false
        g_has_combat[id] = false
        g_has_hammer_fire[id] = false
        g_has_hammer_ice[id] = false
        g_has_hammer_poison[id] = false
        g_has_demonsword[id] = false
      
        set_sprite(id)
      
        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)
        return PLUGIN_HANDLED;
}
 
public buy_knife2(id)
{
        g_has_strong[id] = false
        g_has_katana[id] = true
        g_has_combat[id] = false
        g_has_hammer_fire[id] = false
        g_has_hammer_ice[id] = false
        g_has_hammer_poison[id] = false
        g_has_demonsword[id] = false
      
        set_sprite(id)
      
        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)
        return PLUGIN_HANDLED;
}
 
public buy_knife3(id)
{
        g_has_strong[id] = false
        g_has_katana[id] = false
        g_has_combat[id] = true
        g_has_hammer_fire[id] = false
        g_has_hammer_ice[id] = false
        g_has_hammer_poison[id] = false
        g_has_demonsword[id] = false
      
        set_sprite(id)
      
        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)
        return PLUGIN_HANDLED;
}
 
public buy_knife4(id)
{
        if (get_user_flags(id) & VIP)
        {
                g_has_strong[id] = false
                g_has_katana[id] = false
                g_has_combat[id] = false
                g_has_hammer_fire[id] = true
                g_has_hammer_ice[id] = false
                g_has_hammer_poison[id] = false
                g_has_demonsword[id] = false
              
                set_sprite(id)
              
                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)
        }
        else
        {
                knifemenu(id)
                ChatColor(id, "!g[Knife] !yНож !teamHammer Fire !yдоступен только для !gВипа!")
        }
        return PLUGIN_HANDLED;
}

public buy_knife5(id)
{
        if (get_user_flags(id) & SUPER_VIP)
        {
                g_has_strong[id] = false
                g_has_katana[id] = false
                g_has_combat[id] = false
                g_has_hammer_fire[id] = false
                g_has_hammer_ice[id] = true
                g_has_hammer_poison[id] = false
                g_has_demonsword[id] = false
              
                set_sprite(id)
              
                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)
        }
        else
        {
                knifemenu(id)
                ChatColor(id, "!g[Knife] !yНож !teamHammer Ice !yдоступен только для !gСупер Випа!")
        }
        return PLUGIN_HANDLED;
}

public buy_knife6(id)
{
        if (get_user_flags(id) & OWNER)
        {
                g_has_strong[id] = false
                g_has_katana[id] = false
                g_has_combat[id] = false
                g_has_hammer_fire[id] = false
                g_has_hammer_ice[id] = false
                g_has_hammer_poison[id] = true
                g_has_demonsword[id] = false
              
                set_sprite(id)
              
                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)
        }
        else
        {
                knifemenu(id)
                ChatColor(id, "!g[Knife] !yНож !teamHammer Poison !yдоступен только для !gВладельца!")
        }
        return PLUGIN_HANDLED;
}

public buy_knife7(id)
{
        if (get_user_flags(id) & CREATOR)
        {
                g_has_strong[id] = false
                g_has_katana[id] = false
                g_has_combat[id] = false
                g_has_hammer_fire[id] = false
                g_has_hammer_ice[id] = false
                g_has_hammer_poison[id] = false
                g_has_demonsword[id] = true
              
                set_sprite(id)
              
                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)
        }
        else
        {
                knifemenu(id)
                ChatColor(id, "!g[Knife] !yНож !teamDemon Sword !yдоступен только для !gСоздателя!")
        }
        return PLUGIN_HANDLED;
}
 
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)
{
        set_sprite(id)
}
 
public checkWeapon(id)
{
        if(get_user_weapon(id) != CSW_KNIFE)
        return;
      
        if (g_has_strong[id] || g_has_katana[id] || g_has_combat[id] || g_has_hammer_fire[id] || g_has_hammer_ice[id] || g_has_hammer_poison[id] || g_has_demonsword[id])
        {
                checkModel(id)
        }
        return;
}
 
public checkModel(id)
{
        if (zp_get_user_zombie(id))
        {
                set_sprite(id)
                return;
        }
      
        if(get_user_weapon(id) != CSW_KNIFE)
        return;
      
        if (g_has_strong[id])
        {
                set_pev(id, pev_viewmodel2, KNIFE1_V_MODEL)
                set_pev(id, pev_weaponmodel2, KNIFE1_P_MODEL)
        }
        else if (g_has_katana[id])
        {
                set_pev(id, pev_viewmodel2, KNIFE2_V_MODEL)
                set_pev(id, pev_weaponmodel2, KNIFE2_P_MODEL)
        }
        else if (g_has_combat[id])
        {
                set_pev(id, pev_viewmodel2, KNIFE3_V_MODEL)
                set_pev(id, pev_weaponmodel2, KNIFE3_P_MODEL)
        }
        else if (g_has_hammer_fire[id])
        {
                set_pev(id, pev_viewmodel2, KNIFE4_V_MODEL)
                set_pev(id, pev_weaponmodel2, KNIFE4_P_MODEL)
        }
        else if (g_has_hammer_ice[id])
        {
                set_pev(id, pev_viewmodel2, KNIFE5_V_MODEL)
                set_pev(id, pev_weaponmodel2, KNIFE5_P_MODEL)
        }
        else if (g_has_hammer_poison[id])
        {
                set_pev(id, pev_viewmodel2, KNIFE6_V_MODEL)
                set_pev(id, pev_weaponmodel2, KNIFE6_P_MODEL)
        }
        else if (g_has_demonsword[id])
        {
                set_pev(id, pev_viewmodel2, KNIFE7_V_MODEL)
                set_pev(id, pev_weaponmodel2, KNIFE7_P_MODEL)
        }
        set_sprite(id)
}
 
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_strong[id])
                        emit_sound(id, channel, strong_sounds[0], volume, attn, flags, pitch)
                        if(g_has_katana[id])
                        emit_sound(id, channel, katana_sounds[0], volume, attn, flags, pitch)
                        if(g_has_combat[id])
                        emit_sound(id, channel, combat_sounds[0], volume, attn, flags, pitch)
                        if(g_has_hammer_fire[id])
                        emit_sound(id, channel, hammer_fire_sounds[0], volume, attn, flags, pitch)
                        if(g_has_hammer_ice[id])
                        emit_sound(id, channel, hammer_ice_sounds[0], volume, attn, flags, pitch)
                        if(g_has_hammer_poison[id])
                        emit_sound(id, channel, hammer_poison_sounds[0], volume, attn, flags, pitch)
                        if(g_has_demonsword[id])
                        emit_sound(id, channel, demonsword_sounds[0], volume, attn, flags, pitch)
                }
                else if (sample[14] == 'h')
                {
                        if (sample[17] == 'w')
                        {
                                if(g_has_strong[id])
                                emit_sound(id, channel, strong_sounds[3], volume, attn, flags, pitch)
                                if(g_has_katana[id])
                                emit_sound(id, channel, katana_sounds[3], volume, attn, flags, pitch)
                                if(g_has_combat[id])
                                emit_sound(id, channel, combat_sounds[3], volume, attn, flags, pitch)
                                if(g_has_hammer_fire[id])
                                emit_sound(id, channel, hammer_fire_sounds[3], volume, attn, flags, pitch)
                                if(g_has_hammer_ice[id])
                                emit_sound(id, channel, hammer_ice_sounds[3], volume, attn, flags, pitch)
                                if(g_has_hammer_poison[id])
                                emit_sound(id, channel, hammer_poison_sounds[3], volume, attn, flags, pitch)
                                if(g_has_demonsword[id])
                                emit_sound(id, channel, demonsword_sounds[3], volume, attn, flags, pitch)
                        }
                        else
                        {
                                if(g_has_strong[id])
                                emit_sound(id, channel, strong_sounds[random_num(1,2)], volume, attn, flags, pitch)
                                if(g_has_katana[id])
                                emit_sound(id, channel, katana_sounds[random_num(1,2)], volume, attn, flags, pitch)
                                if(g_has_combat[id])
                                emit_sound(id, channel, combat_sounds[random_num(1,2)], volume, attn, flags, pitch)
                                if(g_has_hammer_fire[id])
                                emit_sound(id, channel, hammer_fire_sounds[random_num(1,2)], volume, attn, flags, pitch)
                                if(g_has_hammer_ice[id])
                                emit_sound(id, channel, hammer_ice_sounds[random_num(1,2)], volume, attn, flags, pitch)
                                if(g_has_hammer_poison[id])
                                emit_sound(id, channel, hammer_poison_sounds[random_num(1,2)], volume, attn, flags, pitch)
                                if(g_has_demonsword[id])
                                emit_sound(id, channel, demonsword_sounds[random_num(1,2)], volume, attn, flags, pitch)
                        }
                }
                else
                {
                        if (sample[15] == 'l')
                        {
                                if(g_has_strong[id])
                                emit_sound(id, channel, strong_sounds[4], volume, attn, flags, pitch)
                                if(g_has_katana[id])
                                emit_sound(id, channel, katana_sounds[4], volume, attn, flags, pitch)
                                if(g_has_combat[id])
                                emit_sound(id, channel, combat_sounds[4], volume, attn, flags, pitch)
                                if(g_has_hammer_fire[id])
                                emit_sound(id, channel, hammer_fire_sounds[4], volume, attn, flags, pitch)
                                if(g_has_hammer_ice[id])
                                emit_sound(id, channel, hammer_ice_sounds[4], volume, attn, flags, pitch)
                                if(g_has_hammer_poison[id])
                                emit_sound(id, channel, hammer_poison_sounds[4], volume, attn, flags, pitch)
                                if(g_has_demonsword[id])
                                emit_sound(id, channel, demonsword_sounds[4], volume, attn, flags, pitch)
                        }
                        else
                        {
                                if(g_has_strong[id])
                                emit_sound(id, channel, strong_sounds[5], volume, attn, flags, pitch)
                                if(g_has_katana[id] )
                                emit_sound(id, channel, katana_sounds[5], volume, attn, flags, pitch)
                                if(g_has_combat[id] )
                                emit_sound(id, channel, combat_sounds[5], volume, attn, flags, pitch)
                                if(g_has_hammer_fire[id])
                                emit_sound(id, channel, hammer_fire_sounds[5], volume, attn, flags, pitch)
                                if(g_has_hammer_ice[id])
                                emit_sound(id, channel, hammer_ice_sounds[5], volume, attn, flags, pitch)
                                if(g_has_hammer_poison[id])
                                emit_sound(id, channel, hammer_poison_sounds[5], volume, attn, flags, pitch)
                                if(g_has_demonsword[id])
                                emit_sound(id, channel, demonsword_sounds[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_strong[id])
        {
                set_user_maxspeed(id,get_pcvar_float(cvar_speed_strong))
              
                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_strong)
                      
                        set_pev(id, pev_velocity, fVelocity)
                        set_pev(id, pev_gaitsequence, 6)
                }
        }
      
        if(weapon == CSW_KNIFE && g_has_katana[id])
        {
                set_user_maxspeed(id,get_pcvar_float(cvar_speed_katana))
              
                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_katana)
                      
                        set_pev(id, pev_velocity, fVelocity)
                        set_pev(id, pev_gaitsequence, 6)
                }
        }
      
        if(weapon == CSW_KNIFE && g_has_combat[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_combat)
                      
                        set_pev(id, pev_velocity, fVelocity)
                        set_pev(id, pev_gaitsequence, 6)
                }
              
                set_user_maxspeed(id,get_pcvar_float(cvar_speed_combat))
        }
        if (weapon == CSW_KNIFE && g_has_hammer_fire[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_hammer_fire)
                      
                        set_pev(id, pev_velocity, fVelocity)
                        set_pev(id, pev_gaitsequence, 6)
                }
              
                set_user_maxspeed(id, get_pcvar_float(cvar_speed_hammer_fire))
        }
        if (weapon == CSW_KNIFE && g_has_hammer_ice[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_hammer_ice)
                      
                        set_pev(id, pev_velocity, fVelocity)
                        set_pev(id, pev_gaitsequence, 6)
                }
              
                set_user_maxspeed(id, get_pcvar_float(cvar_speed_hammer_ice))
        }
        if (weapon == CSW_KNIFE && g_has_hammer_poison[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_hammer_poison)
                      
                        set_pev(id, pev_velocity, fVelocity)
                        set_pev(id, pev_gaitsequence, 6)
                }
              
                set_user_maxspeed(id, get_pcvar_float(cvar_speed_hammer_poison))
        }
        if (weapon == CSW_KNIFE && g_has_demonsword[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_demonsword)
                      
                        set_pev(id, pev_velocity, fVelocity)
                        set_pev(id, pev_gaitsequence, 6)
                }
              
                set_user_maxspeed(id, get_pcvar_float(cvar_speed_demonsword))
        }
        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(get_user_weapon(attacker) == CSW_KNIFE)
        {
              
                if (g_has_strong[attacker])
                {
                        SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_strong))
                      
                        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_strong);
                        vec[1] += oldvelo[1] + 0;
                        set_pev(victim, pev_velocity, vec);
                }
                else if (g_has_katana[attacker])
                {
                        SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_katana))
                      
                        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_katana);
                        vec[1] += oldvelo[1] + 0;
                        set_pev(victim, pev_velocity, vec);
                }
                else if (g_has_combat[attacker])
                {
                        SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_combat))
                      
                        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_combat);
                        vec[1] += oldvelo[1] + 0;
                        set_pev(victim, pev_velocity, vec);
                }
                else if (g_has_hammer_fire[attacker])
                {
                        SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_hammer_fire))
                      
                        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_hammer_fire);
                        vec[1] += oldvelo[1] + 0;
                        set_pev(victim, pev_velocity, vec);

                        if( !task_exists( victim + TASK_FBURN ) )
                        {
                        g_burning_duration[ victim ] += FIRE_DURATION * 5
                        set_task( 0.1, "CTask__BurningFlame", victim + TASK_FBURN, _, _, "b" )
                        }
                }
                else if (g_has_hammer_ice[attacker])
                {
                        SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_hammer_ice))
                      
                        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_hammer_ice);
                        vec[1] += oldvelo[1] + 0;
                        set_pev(victim, pev_velocity, vec);

                        if(!g_freeze_wait[attacker] && !zp_get_user_nemesis(victim))
                {
                        set_pdata_float(victim, m_flNextAttack, TIME_FREEZE)
                        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 if (g_has_hammer_poison[attacker])
                {
                        SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_hammer_poison))
                      
                        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_hammer_poison);
                        vec[1] += oldvelo[1] + 0;
                        set_pev(victim, pev_velocity, vec);

                        if( !task_exists( victim + TASK_POISBURN ) )
                        {
                        g_poisoning_duration[ victim ] += POISON_DURATION * 5
                        set_task( 0.1, "CTask__PoisoningFlame", victim + TASK_POISBURN, _, _, "b" )
                        }
                }
                else if (g_has_demonsword[attacker])
                {
                        SetHamParamFloat(4, damage * get_pcvar_float(cvar_damage_demonsword))
                      
                        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_demonsword);
                        vec[1] += oldvelo[1] + 0;
                        set_pev(victim, pev_velocity, vec);

                        if (!g_antidote_wait[attacker] && !zp_get_user_nemesis(victim) && !zp_get_user_last_zombie(victim))
                        {
                        zp_disinfect_user(victim, 0);
                        g_antidote_wait[attacker] = 1;
                        set_task(20.00, "Antidote_Wait", attacker + 33188951, "", 0, "", 0);
                        }
                }
                more_blood(victim)
        }
        return HAM_IGNORED
}

public Freeze_Wait(taskid)
{
        new attacker = taskid - 1233123
        if (is_user_alive(attacker))
        {
        remove_task(attacker + 1233123)
        g_freeze_wait[attacker] = false
        client_print(attacker, print_center, "Ваша способность готова!")
    }
    else
        {
        remove_task(attacker + 1233123)
        }
}

public Antidote_Wait(taskid)
{
        new attacker = taskid + -33188951;
        if (is_user_alive(attacker))
        {
        remove_task(attacker + 33188951, 0);
        g_antidote_wait[attacker] = 0;
        client_print(attacker, print_center, "Ваша способность готова!")
        }
        else
        {
        remove_task(attacker + 33188951, 0);
        }
        return 0;
}

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)
}
 
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, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_strong[iattacker])
                        set_msg_arg_string(4, "strong")
                }
              
                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_katana[iattacker])
                        set_msg_arg_string(4, "hatchet")
                }
              
                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_combat[iattacker])
                        set_msg_arg_string(4, "mastercombat")
                }
              
                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_hammer_fire[iattacker])
                        set_msg_arg_string(4, "hammer_fire")
                }

                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_hammer_ice[iattacker])
                        set_msg_arg_string(4, "hammer_ice")
                }

                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_hammer_poison[iattacker])
                        set_msg_arg_string(4, "hammer_poison")
                }
                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_demonsword[iattacker])
                        set_msg_arg_string(4, "demonsword")
                }
              
                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(!g_has_strong[iattacker] && !g_has_katana[iattacker] && !g_has_combat[iattacker] && !g_has_hammer_fire[iattacker] && !g_has_hammer_ice[iattacker] && !g_has_hammer_poison[iattacker] && !g_has_demonsword[iattacker] && !zp_get_user_zombie(iattacker))
                        set_msg_arg_string(4, "knife")
                }
        }
        if (zp_get_user_zombie(iattacker))
        {
                if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)
                {
                        if(g_has_strong[iattacker] || g_has_katana[iattacker] || g_has_combat[iattacker] || g_has_hammer_fire[iattacker] || g_has_hammer_ice[iattacker] || g_has_hammer_poison[iattacker] || g_has_demonsword[iattacker])
                        set_msg_arg_string(4, "Claws")
                }
        }
        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_strong[attacker])
        {
                velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_strong) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
                velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_strong) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
        }
        else if (g_has_katana[attacker])
        {
                velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_katana) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
                velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_katana) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
        }
        else if (g_has_combat[attacker])
        {
                velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_combat) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
                velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_combat) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
        }
        else if (g_has_hammer_fire[attacker])
        {
                velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_hammer_fire) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
                velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_hammer_fire) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
        }
        else if (g_has_hammer_ice[attacker])
        {
                velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_hammer_ice) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
                velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_hammer_ice) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
        }
        else if (g_has_hammer_poison[attacker])
        {
                velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_hammer_poison) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
                velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_hammer_poison) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
        }
        else if (g_has_demonsword[attacker])
        {
                velocity[0] = ( origin2[0] * get_pcvar_float(cvar_knock_demonsword) * 3000 ) / floatround(get_distance_f(vicorigin, attorigin));
                velocity[1] = ( origin2[1] * get_pcvar_float(cvar_knock_demonsword) * 3000 ) / 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;
}
 
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()
        }
}
 
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();
}
 
public set_sprite(id)
{
        if(!is_user_alive(id))
        {
                return;
        }
      
        if(zp_get_user_zombie(id))
        {
                sprite(id, "weapon_knife", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
      
        if(g_has_strong[id])
        {
                sprite(id, "zm_knife_strong", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
      
        if(g_has_katana[id])
        {
                sprite(id, "zm_knife_katana", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
      
        if(g_has_combat[id])
        {
                sprite(id, "zm_knife_combat", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
      
        if(g_has_hammer_fire[id])
        {
                sprite(id, "zm_knife_hammer_fire", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
        if(g_has_hammer_ice[id])
        {
                sprite(id, "zm_knife_hammer_ice", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
        if(g_has_hammer_poison[id])
        {
                sprite(id, "zm_knife_hammer_poison", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
        if(g_has_demonsword[id])
        {
                sprite(id, "zm_knife_demonsword", -1, -1, -1, -1, 2, 1, 29, 0)
                return;
        }
}
 
stock ChatColor(const id, const input[], any:...)
{
        new count = 1, players[32]
        static msg[191]
        vformat(msg, 190, input, 3)
      
        replace_all(msg, 190, "!g", "^4")
        replace_all(msg, 190, "!y", "^1")
        replace_all(msg, 190, "!team", "^3")
      
        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 CTask__BurningFlame( taskid )
{
// Get player origin and flags
static origin[3], flags
get_user_origin(ID_FBURN, origin)
flags = pev(ID_FBURN, pev_flags)

// Madness mode - in water - burning stopped
if ((flags & FL_INWATER) || g_burning_duration[ID_FBURN] < 1 || g_fRoundEnd || !is_user_alive(ID_FBURN))
{
// Smoke sprite
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()

// Task not needed anymore
remove_task(taskid)
return
}

// Get player's health
static health
health = pev(ID_FBURN, pev_health)

// Take damage from the fire
if (health - FIRE_DAMAGE > 0)
fm_set_user_health(ID_FBURN, health - FIRE_DAMAGE)

// Flame sprite
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_SPRITE) // TE id
write_coord(origin[0]+random_num(-5, 5)) // x
write_coord(origin[1]+random_num(-5, 5)) // y
write_coord(origin[2]+random_num(-10, 10)) // z
write_short(g_flameSpr) // sprite
write_byte(random_num(5, 10)) // scale
write_byte(200) // brightness
message_end()

g_burning_duration[ID_FBURN]--
}

public CTask__PoisoningFlame( taskid )
{
// Get player origin and flags
static origin[3], flags
get_user_origin(ID_POISBURN, origin)
flags = pev(ID_POISBURN, pev_flags)

// Madness mode - in water - burning stopped
if ((flags & FL_INWATER) || g_poisoning_duration[ID_POISBURN] < 1 || g_fRoundEnd || !is_user_alive(ID_POISBURN))
{
// Smoke sprite
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()

// Task not needed anymore
remove_task(taskid)
return
}

// Get player's health
static health
health = pev(ID_POISBURN, pev_health)

// Take damage from the poison
if (health - POISON_DAMAGE > 0)
fm_set_user_health(ID_POISBURN, health - POISON_DAMAGE)

// Flame sprite
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_SPRITE) // TE id
write_coord(origin[0]+random_num(-5, 5)) // x
write_coord(origin[1]+random_num(-5, 5)) // y
write_coord(origin[2]+random_num(-10, 10)) // z
write_short(g_poisonSpr) // sprite
write_byte(random_num(5, 10)) // scale
write_byte(150) // brightness
message_end()

g_poisoning_duration[ID_POISBURN]--
}

stock fm_set_user_health( index, health )
{
    health > 0 ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index)
}

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();
}
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
Сообщения
418
Реакции
-7
Предупреждения
8
@fl0wer,установил плагин на ножи для зомби серва, добавил эффект заморозки на определенный нож, замораживаю зомбака и убиваю его (пока он находится в заморозке) и вот такая чепуха! Остаётся...
1 Апр 2023
wood-grouse сможешь подсказать пожалуйста?
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
какая чепуха?
 
Сообщения
418
Реакции
-7
Предупреждения
8
@fl0wer,на скрине не видно разве? Мертвая модель игрока осталась
1 Апр 2023
Что-то явно в 1158 - 1167 строках не так 100% раз после убийства в фризе, багует модель что-ли...
1 Апр 2023
Мб g_frozen[victim] = true заменить на g_frozen[victim] = 1 ?
 
Последнее редактирование:
Сообщения
1,082
Реакции
58
Помог
11 раз(а)
В любом случае ты должен присваивать число, так как ты объявлял не bool new g_frozen[33], но это тебе ничего не даст, уберет предупреждение в компиляции
 
Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
Убрать флаг FL_FROZEN в момент смерти.
 
Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
fl0wer, это и так понятно, но его ещё даже на форуме не обновили, поэтому я подсказал решение для всех.
 
Сообщения
33
Реакции
1
Помог
1 раз(а)
судя со слов автора поста проблему он решил еще в другой теме и можно закрывать тему RedGamer
 
Сообщения
418
Реакции
-7
Предупреждения
8
l3ound, ещё не факт, я не проверял.
1 Апр 2023
@fl0wer,ReGameDLL? Нету) я на hlds)
1 Апр 2023
Nordic Warrior,м.. допустим, где это прописать?
 
Статус
В этой теме нельзя размещать новые ответы.

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

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