Reklam gösterimini engelleyici yazılım kullandığınızı görüyoruz.
Sitemizin ayakta kalıp sizlere hizmet edebilmek için en büyük gelir kaynağı sayfamızda gösterilen reklamlardır.
Reklam gösterimde bizim sayfamıza ayrıcalık tanıyarak ayakta kalmamıza destek olmak ister misiniz ?

Silinmiş Konu   | knife özellik ekleme

Konu

#1
merhaba arkadaşlar vermiş oldugum bicak menusundeki 2. seçenekti strong knife özellik ekliyebilirmisiniz örneğin vurunca : vurdugu kısı donsun , vurdugu kısı yansın , vurdugu kısı yavaslasın vb hangisi olursa farketmez cvar komut eklerseniz sevinirim örneğin cvar zp_storng_frost 1 // donma süresi gibi yardımcı olabilirseniz sevinirim Gülücük

Kod:
#include <amxmodx>

#include <fakemeta>

#include <fun>

#include <engine>

#include <hamsandwich>

#include <zombieplague>




#define PLUGIN    "ZP knife menu"

#define VERSION    "1.0"

#define AUTHOR    "DOPER"


#define VIP ADMIN_LEVEL_H
#define ADMIN_FLAG ADMIN_BAN

#define SVIP ADMIN_LEVEL_G
#define BOSS ADMIN_PASSWORD
#define MAXPLAYERS 32

#define ID_FBURN1    (taskid - 100)

#define ID_FBURN2    (taskid - 100)

#define ID_FBURN3    (taskid - 100)

#define ID_FBURN4    (taskid - 100)

#define ID_FBURN5    (taskid - 100)

#define ID_FBURN6    (taskid - 100)

#define ID_FBURN7    (taskid - 100)



new            g_burning1[33],
            g_burning2[33],
                       g_burning3[33],
                       g_burning4[33],
                       g_burning5[33],
                       g_burning6[33],
                       g_burning7[33],
            g_sprite1,
            g_sprite2,
                       g_sprite3,
                       g_sprite4,
                       g_sprite5,
                       g_sprite6,
                       g_sprite7
 


new combat_v_model[] = "models/zp_knife_menu/v_combat_knife.mdl"

new combat_p_model[] = "models/zp_knife_menu/p_combat_knife.mdl"



new strong_v_model[] = "models/zp_knife_menu/v_strong_knife.mdl"

new strong_p_model[] = "models/zp_knife_menu/p_strong_knife.mdl"



new axe_v_model[] = "models/zp_knife_menu/v_axe_knife.mdl"    

new axe_p_model[] = "models/zp_knife_menu/p_axe_knife.mdl"    



new katana_v_model[] = "models/zp_knife_menu/v_warhammer.mdl"    

new katana_p_model[] = "models/zp_knife_menu/p_warhammer.mdl"



new hammer_v_model[] = "models/zp_knife_menu/v_warhammer_storm.mdl"    

new hammer_p_model[] = "models/zp_knife_menu/p_warhammer_storm.mdl"    



new thanatos_v_model[] = "models/zp_knife_menu/v_warhammer_ice.mdl"    

new thanatos_p_model[] = "models/zp_knife_menu/p_warhammer_ice.mdl"



new boss_v_model[] = "models/zp_knife_menu/v_boss_hammer.mdl"    

new boss_p_model[] = "models/zp_knife_menu/p_boss_hammer.mdl"



new sur_v_model[] = "models/zp_knife_menu/v_sur_hammer.mdl"    

new sur_p_model[] = "models/zp_knife_menu/p_sur_hammer.mdl"




const m_pPlayer = 41

const m_flNextPrimaryAttack = 46

const m_flNextSecondaryAttack = 47

const m_flTimeWeaponIdle = 48



new SayText

new bool:g_WasShowed[MAXPLAYERS + 1]

new g_knife_combat[33], cvar_knife_combat_jump, cvar_knife_combat_spd, cvar_knife_combat_dmg, cvar_knife_combat_knock, cvar_knife_combat_spd_attack2

new g_knife_strong[33], cvar_knife_strong_jump, cvar_knife_strong_spd, cvar_knife_strong_dmg, cvar_knife_strong_knock, cvar_knife_strong_spd_attack2

new g_knife_axe[33], cvar_knife_axe_jump, cvar_knife_axe_spd, cvar_knife_axe_dmg, cvar_knife_axe_knock, cvar_knife_axe_spd_attack2

new g_knife_katana[33], cvar_knife_katana_jump, cvar_knife_katana_spd, cvar_knife_katana_dmg, cvar_knife_katana_knock, cvar_knife_katana_spd_attack2

new g_knife_hammer[33], cvar_knife_hammer_jump, cvar_knife_hammer_spd, cvar_knife_hammer_dmg, cvar_knife_hammer_knock, cvar_hammer_spd_attack2

new g_knife_thanatos[33], cvar_knife_thanatos_jump, cvar_knife_thanatos_spd, cvar_knife_thanatos_dmg, cvar_knife_thanatos_knock, cvar_thanatos_spd_attack2

new g_knife_boss[33], cvar_knife_boss_jump, cvar_knife_boss_spd, cvar_knife_boss_dmg, cvar_knife_boss_knock, cvar_boss_spd_attack2

new g_knife_sur[33], cvar_knife_sur_jump, cvar_knife_sur_spd, cvar_knife_sur_dmg, cvar_knife_sur_knock, cvar_sur_spd_attack2



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



new const combat_sounds[][] =

{

    "zp_knife_menu/cabret_deploy.wav",

    "zp_knife_menu/cabret_hit.wav"    ,

    "zp_knife_menu/cabret_hit.wav"    ,

    "zp_knife_menu/cabret_hitwall.wav",

    "zp_knife_menu/cabret_slash.wav",

    "zp_knife_menu/cabret_stab.wav"

}



new const strong_sounds[][] =

{

    "zp_knife_menu/katana_deploy.wav",

    "zp_knife_menu/katana_hit.wav",

    "zp_knife_menu/katana_hit.wav",

    "zp_knife_menu/katana_hitwall.wav",

    "zp_knife_menu/katana_slash.wav",

    "zp_knife_menu/katana_stab.wav"

}



new const axe_sounds[][] =

{

    "zp_knife_menu/thanatos_deploy.wav",

    "zp_knife_menu/thanatos_hit.wav",

    "zp_knife_menu/thanatos_hit.wav",

    "zp_knife_menu/thanatos_hitwall.wav",

    "zp_knife_menu/thanatos_slash.wav",

    "zp_knife_menu/thanatos_stab.wav"

}



new const katana_sounds[][] =

{

    "zp_knife_menu/hammer_deploy.wav",

    "zp_knife_menu/hammer_hit.wav",

    "zp_knife_menu/hammer_hit.wav",

    "zp_knife_menu/hammer_hitwall.wav",

    "zp_knife_menu/hammer_slash.wav",

    "zp_knife_menu/hammer_stab.wav"

}



new const hammer_sounds[][] =

{

    "zp_knife_menu/warhammer_deploy.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hitwall.wav",

    "zp_knife_menu/warhammer_slash.wav",

    "zp_knife_menu/warhammer_stab.wav"

}



new const thanatos_sounds[][] =

{

    "zp_knife_menu/warhammer_deploy.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hitwall.wav",

    "zp_knife_menu/warhammer_slash.wav",

    "zp_knife_menu/warhammer_stab.wav"

}


new const boss_sounds[][] =

{

    "zp_knife_menu/warhammer_deploy.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hitwall.wav",

    "zp_knife_menu/warhammer_slash.wav",

    "zp_knife_menu/warhammer_stab.wav"

}

new const sur_sounds[][] =

{

    "zp_knife_menu/warhammer_deploy.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hit.wav",

    "zp_knife_menu/warhammer_hitwall.wav",

    "zp_knife_menu/warhammer_slash.wav",

    "zp_knife_menu/warhammer_stab.wav"

}


public plugin_init()

{

    register_plugin(PLUGIN , VERSION , AUTHOR);

    register_cvar("zp_addon_knife", VERSION, FCVAR_SERVER);

       SayText = get_user_msgid("SayText")  



    register_clcmd("say /knife","knife_menu",ADMIN_ALL,"knife_menu")

    register_clcmd("/knife","knife_menu",ADMIN_ALL,"knife_menu")

    register_clcmd("combat", "give_combat")

    register_clcmd("strong", "give_strong")

    register_clcmd("axe", "give_axe")

    register_clcmd("katana", "give_katana")

    register_clcmd("hammer", "give_hammer")

    register_clcmd("thanatos", "give_thanatos")

       register_clcmd("boss", "give_boss")

       register_clcmd("sur", "give_sur")


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

    register_event("Damage" , "event_Damage" , "b" , "2>0");



    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");

       register_forward(FM_EmitSound, "CEntity__EmitSound");



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



    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");

       RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "fw_Knife_SecondaryAttack_Post", 1)



    cvar_knife_combat_jump= register_cvar("zp_knife_combat_jump", "270.0");

    cvar_knife_combat_spd = register_cvar("zp_knife_combat_spd", "310.0");

    cvar_knife_combat_dmg = register_cvar("zp_knife_combat_dmg" , "4.0");

    cvar_knife_combat_knock = register_cvar("zp_knife_combat_knock" , "6.0");

    cvar_knife_combat_spd_attack2 = register_cvar("zp_knife_combat_spd_attack2" , "1.2");



    cvar_knife_strong_jump= register_cvar("zp_knife_strong_jump", "265.0");

    cvar_knife_strong_spd = register_cvar("zp_knife_strong_spd", "255.0");

    cvar_knife_strong_dmg = register_cvar("zp_knife_strong_dmg" , "12.0");

    cvar_knife_strong_knock = register_cvar("zp_knife_strong_knock" , "7.0");

    cvar_knife_strong_spd_attack2 = register_cvar("zp_knife_strong_spd_attack2" , "1.6");



    cvar_knife_axe_jump= register_cvar("zp_knife_axe_jump", "335.0");

    cvar_knife_axe_spd = register_cvar("zp_knife_axe_spd", "250.0");

    cvar_knife_axe_dmg = register_cvar("zp_knife_axe_dmg" , "5.0");

    cvar_knife_axe_knock = register_cvar("zp_knife_axe_knock" , "6.0");

    cvar_knife_axe_spd_attack2 = register_cvar("zp_knife_axe_spd_attack2" , "1.4");



    cvar_knife_katana_jump= register_cvar("zp_knife_katana_jump", "275.0");

    cvar_knife_katana_spd = register_cvar("zp_knife_katana_spd", "265.0");

    cvar_knife_katana_dmg = register_cvar("zp_knife_katana_dmg" , "5.0");

    cvar_knife_katana_knock = register_cvar("zp_knife_katana_knock" , "15.0");

    cvar_knife_katana_spd_attack2 = register_cvar("zp_knife_katana_spd_attack2" , "1.2");



    cvar_knife_hammer_jump= register_cvar("zp_knife_hammer_jump", "335.0");

    cvar_knife_hammer_spd= register_cvar("zp_knife_hammer_spd", "315.0");

    cvar_knife_hammer_dmg = register_cvar("zp_knife_hammer_dmg" , "15.0");

    cvar_knife_hammer_knock = register_cvar("zp_knife_hammer_knock" , "15.0");

    cvar_hammer_spd_attack2 = register_cvar("zp_knife_hammer_spd_attack2" , "1.8");



    cvar_knife_thanatos_jump= register_cvar("zp_knife_thanatos_jump", "385.0");

    cvar_knife_thanatos_spd= register_cvar("zp_knife_thanatos_spd", "320.0");

    cvar_knife_thanatos_dmg = register_cvar("zp_knife_thanatos_dmg" , "17.0");

    cvar_knife_thanatos_knock = register_cvar("zp_knife_thanatos_knock" , "17.0");

    cvar_thanatos_spd_attack2 = register_cvar("zp_knife_thanatos_spd_attack2" , "1.8");


       cvar_knife_boss_jump= register_cvar("zp_knife_boss_jump", "400.0");

    cvar_knife_boss_spd= register_cvar("zp_knife_boss_spd", "350.0");

    cvar_knife_boss_dmg = register_cvar("zp_knife_boss_dmg" , "20.0");

    cvar_knife_boss_knock = register_cvar("zp_knife_boss_knock" , "120.0");

    cvar_boss_spd_attack2 = register_cvar("zp_knife_boss_spd_attack2" , "2.0");
    

       cvar_knife_sur_jump= register_cvar("zp_knife_sur_jump", "380.0");

    cvar_knife_sur_spd= register_cvar("zp_knife_sur_spd", "370.0");

    cvar_knife_sur_dmg = register_cvar("zp_knife_sur_dmg" , "22.0");

    cvar_knife_sur_knock = register_cvar("zp_knife_sur_knock" , "100.0");

    cvar_sur_spd_attack2 = register_cvar("zp_knife_sur_spd_attack2" , "2.2");


       register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

}


public zp_round_started()
{
   for(new id = 1; id <=get_maxplayers(); id++)
   {
       if(zp_get_user_survivor(id))
       set_task(1.0, "task_give", id+45634)
   }
}

public task_give(id)
{
   id -= 45634
   if(zp_get_user_survivor(id) && is_user_alive(id))
   {
        give_sur(id)
   }
}  


public zp_round_ended()
{
   for(new id = 1; id <=get_maxplayers(); id++)
   {
       if(zp_get_user_survivor(id))
       set_task(1.0, "task_remove", id-45634)
   }
}

public task_remove(id)
{
   id -= -45634
   if(zp_get_user_survivor(id))
   {
        remove_sur(id)
   }
}  

public client_connect(id)

{

    g_knife_combat[id] = false

    g_knife_strong[id] = false

    g_knife_axe[id] = false

    g_knife_katana[id] = false

    g_knife_hammer[id] = false

    g_knife_thanatos[id] = false

       g_knife_boss[id] = false

       g_knife_sur[id] = false

}



public client_disconnect(id)

{

    g_knife_combat[id] = false

    g_knife_strong[id] = false

    g_knife_axe[id] = false

    g_knife_katana[id] = false

    g_knife_hammer[id] = false

    g_knife_thanatos[id] = false

       g_knife_boss[id] = false

       g_knife_sur[id] = false

}



public plugin_precache()

{

    precache_model(combat_v_model)

    precache_model(combat_p_model)

    precache_model(strong_v_model)

    precache_model(strong_p_model)

    precache_model(axe_v_model)

    precache_model(axe_p_model)

    precache_model(katana_v_model)

    precache_model(katana_p_model)

    precache_model(hammer_v_model)

    precache_model(hammer_p_model)

    precache_model(thanatos_p_model)

    precache_model(thanatos_v_model)

       precache_model(boss_p_model)

    precache_model(boss_v_model)

       precache_model(sur_p_model)

    precache_model(sur_v_model)


    precache_sound(g_sound_knife)



    for(new i = 0; i < sizeof combat_sounds; i++)

        precache_sound(combat_sounds[i])



    for(new i = 0; i < sizeof strong_sounds; i++)

        precache_sound(strong_sounds[i])



    for(new i = 0; i < sizeof axe_sounds; i++)

        precache_sound(axe_sounds[i])  



    for(new i = 0; i < sizeof katana_sounds; i++)

        precache_sound(katana_sounds[i])



    for(new i = 0; i < sizeof hammer_sounds; i++)

        precache_sound(hammer_sounds[i])



    for(new i = 0; i < sizeof thanatos_sounds; i++)

        precache_sound(thanatos_sounds[i])


       for(new i = 0; i < sizeof boss_sounds; i++)

        precache_sound(boss_sounds[i])

       for(new i = 0; i < sizeof sur_sounds; i++)

        precache_sound(sur_sounds[i])


       g_sprite1 = precache_model("sprites/zp_knife_menu/1.spr")
    
    g_sprite2 = precache_model("sprites/zp_knife_menu/2.spr")

       g_sprite3 = precache_model("sprites/zp_knife_menu/3.spr")

       g_sprite4 = precache_model("sprites/zp_knife_menu/4.spr")

       g_sprite5 = precache_model("sprites/zp_knife_menu/5.spr")

       g_sprite6 = precache_model("sprites/zp_knife_menu/6.spr")

       g_sprite7 = precache_model("sprites/zp_knife_menu/7.spr")


}



public event_round_start(id)

{

       for (new i; i < MAXPLAYERS + 1; i++)

           g_WasShowed[i] = false

}



public knife_menu(id)

{


    if(is_user_alive(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id))

    {

        my_menu(id)

    }



    return PLUGIN_HANDLED

}



public my_menu(id)

{

    new menu = menu_create("\w|\r**\w[ZP] \rNEW Knife \yMenu\r**\w|^n\w|\r**\wBy \yDoper :D\r**\w|^n", "menu_handler");

    menu_additem(menu, "\r|\wCombat \dKnife\r| \w[\wSpeed]", "1", 0);

    menu_additem(menu, "\r|\wStrong \dKnife\r| \w[\wDamage]", "2", 0);

    menu_additem(menu, "\r|\wAxe \dKnife\r| \w[\wJump]^n", "3", 0);


       if(get_user_flags(id) & VIP)
    menu_additem(menu, "\r|\wWar \dHammer\r| \r[\wVip \yx2\r]", "4", 0);

       else
       menu_additem(menu, "\r|\wWar \dHammer\r| \r[\wVIP \yCost - 2 boost\r]", "4", 0);

       if(get_user_flags(id) & SVIP)
    menu_additem(menu, "\r|\wStorm \dHammer\r| \r[\wSvip \yx4\r]", "5", 0);

       else
       menu_additem(menu, "\r|\wStorm \dHammer\r| \r[\wSVIP \yCost - 4 boost\r]", "5", 0);

       if(get_user_flags(id) & ADMIN_FLAG)
    menu_additem(menu, "\r|\wIce \dHammer\r| \r[\wADMIN \yx6\r]^n", "6", 0);

       else
       menu_additem(menu, "\r|\wIce \dHammer\r| \r[\wAdmin \yCost - 6 boost\r]", "6", 0);  

       if(get_user_flags(id) & BOSS)
    menu_additem(menu, "\r|\wBoss \dHammer\r| \r[\wOwner \yFull Skill xXx\r]", "7", 0);
       
       else
       menu_additem(menu, "\r|\wBoss \dHammer\r| \r[\wOWNER \yCost - 20 Euro\r]", "7", 0);  

    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

   

    menu_display(id, menu, 0);    

}



public menu_handler(id, menu, item)

{

    if( item == MENU_EXIT )

    {

              menu_destroy(menu);

           return PLUGIN_HANDLED;    

    }

   

    new data[7], iName[64];

    new access, callback;

   

    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

   

    new key = str_to_num(data);

   

    switch(key)

    {

           case 1:

           {

            give_combat(id)

            menu_destroy(menu);

            return PLUGIN_HANDLED

        }

        case 2:

        {

            give_strong(id)

            menu_destroy(menu);

            return PLUGIN_HANDLED

        }

        case 3:

        {

            give_axe(id)

            menu_destroy(menu);

            return PLUGIN_HANDLED

        }

        case 4:

        {

            give_katana(id)

            menu_destroy(menu);

            return PLUGIN_HANDLED

        }

        case 5:

        {

            give_hammer(id)

            menu_destroy(menu);

            return PLUGIN_HANDLED

        }

        case 6:

        {

            give_thanatos(id)

            menu_destroy(menu);

            return PLUGIN_HANDLED

        }

               case 7:

        {

            give_boss(id)

            menu_destroy(menu);

            return PLUGIN_HANDLED

        }

    }

    menu_destroy(menu);

    return PLUGIN_HANDLED

}



public give_combat(id)

{

    g_knife_combat[id] = true    

    g_knife_strong[id] = false

    g_knife_axe[id] = false    

    g_knife_katana[id] = false    

    g_knife_hammer[id] = false

    g_knife_thanatos[id] = false

       g_knife_boss[id] = false

       g_knife_sur[id] = false

    g_WasShowed[id] = true



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

}



public give_strong(id)

{

    g_knife_combat[id] = false    

    g_knife_strong[id] = true    

    g_knife_axe[id] = false

    g_knife_katana[id] = false    

    g_knife_hammer[id] = false

    g_knife_thanatos[id] = false

       g_knife_boss[id] = false
   
       g_knife_sur[id] = false

    g_WasShowed[id] = true



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

}



public give_axe(id)

{

    g_knife_combat[id] = false    

    g_knife_strong[id] = false    

    g_knife_axe[id] = true

    g_knife_katana[id] = false    

    g_knife_hammer[id] = false

    g_knife_thanatos[id] = false
       
       g_knife_sur[id] = false

       g_knife_boss[id] = false

    g_WasShowed[id] = true



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

}



public give_katana(id)


    if (get_user_flags(id) & VIP)

{

    g_knife_combat[id] = false    

    g_knife_strong[id] = false    

    g_knife_axe[id] = false

    g_knife_katana[id] = true    

    g_knife_hammer[id] = false

    g_knife_thanatos[id] = false

       g_knife_boss[id] = false
     
       g_knife_sur[id] = false

    g_WasShowed[id] = true



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

}





public give_hammer(id)



    if (get_user_flags(id) & SVIP)

    {

        g_knife_combat[id] = false    

        g_knife_strong[id] = false    

        g_knife_axe[id] = false

        g_knife_katana[id] = false

        g_knife_hammer[id] = true

        g_knife_thanatos[id] = false

               g_knife_boss[id] = false
           
               g_knife_sur[id] = false

        g_WasShowed[id] = true



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

    }



public give_thanatos(id)


    if (get_user_flags(id) & ADMIN_FLAG)

    {

        g_knife_combat[id] = false    

        g_knife_strong[id] = false    

        g_knife_axe[id] = false

        g_knife_katana[id] = false

        g_knife_hammer[id] = false

        g_knife_thanatos[id] = true

               g_knife_boss[id] = false
             
               g_knife_sur[id] = false

        g_WasShowed[id] = true



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

    }


public give_boss(id)


      if (get_user_flags(id) & BOSS)

      {

        g_knife_combat[id] = false    

        g_knife_strong[id] = false    

        g_knife_axe[id] = false

        g_knife_katana[id] = false

        g_knife_hammer[id] = false

        g_knife_thanatos[id] = false

               g_knife_boss[id] = true

               g_knife_sur[id] = false

        g_WasShowed[id] = true



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

public give_sur(id)

{


        g_knife_combat[id] = false    

        g_knife_strong[id] = false    

        g_knife_axe[id] = false

        g_knife_katana[id] = false

        g_knife_hammer[id] = false

        g_knife_thanatos[id] = false

               g_knife_boss[id] = false

               g_knife_sur[id] = true

        g_WasShowed[id] = true



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

    

}


public remove_sur(id)

{


        g_knife_combat[id] = true    

        g_knife_strong[id] = false    

        g_knife_axe[id] = false

        g_knife_katana[id] = false

        g_knife_hammer[id] = false

        g_knife_thanatos[id] = false

               g_knife_boss[id] = false

               g_knife_sur[id] = false

        g_WasShowed[id] = false



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

    

}

public checkWeapon(id)

{

    new plrWeapId

   

    plrWeapId = get_user_weapon(id)

   

    if (plrWeapId == CSW_KNIFE && (g_knife_combat[id] || g_knife_strong[id] || g_knife_axe[id] || g_knife_katana[id] || g_knife_hammer[id]|| g_knife_thanatos[id] || g_knife_boss[id] || g_knife_sur[id]))

    {

        checkModel(id)

    }

}



public checkModel(id)

{

    if (zp_get_user_zombie(id))

        return PLUGIN_HANDLED

   

    if (g_knife_combat[id])

    {

        set_pev(id, pev_viewmodel2, combat_v_model)

        set_pev(id, pev_weaponmodel2, combat_p_model)

    }



    if (g_knife_strong[id])

    {

        set_pev(id, pev_viewmodel2, strong_v_model)

        set_pev(id, pev_weaponmodel2, strong_p_model)

    }



    if (g_knife_axe[id])

    {

        set_pev(id, pev_viewmodel2, axe_v_model)

        set_pev(id, pev_weaponmodel2, axe_p_model)

    }



    if (g_knife_katana[id])

    {

        set_pev(id, pev_viewmodel2, katana_v_model)

        set_pev(id, pev_weaponmodel2, katana_p_model)

    }



    if (g_knife_hammer[id])

    {

        set_pev(id, pev_viewmodel2, hammer_v_model)

        set_pev(id, pev_weaponmodel2, hammer_p_model)

    }

    if (g_knife_thanatos[id])

    {

        set_pev(id, pev_viewmodel2, thanatos_v_model)

        set_pev(id, pev_weaponmodel2, thanatos_p_model)

    }

       if (g_knife_boss[id])

    {

        set_pev(id, pev_viewmodel2, boss_v_model)

        set_pev(id, pev_weaponmodel2, boss_p_model)

    }

       if (g_knife_sur[id])

    {

        set_pev(id, pev_viewmodel2, sur_v_model)

        set_pev(id, pev_weaponmodel2, sur_p_model)

    }


    return PLUGIN_HANDLED

}


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_knife_combat[id])

               emit_sound(id, channel, combat_sounds[0], volume, attn, flags, pitch)

           if(g_knife_strong[id])

               emit_sound(id, channel, strong_sounds[0], volume, attn, flags, pitch)

           if(g_knife_axe[id])

               emit_sound(id, channel, axe_sounds[0], volume, attn, flags, pitch)

           if(g_knife_katana[id])

               emit_sound(id, channel, katana_sounds[0], volume, attn, flags, pitch)

           if(g_knife_hammer[id])

               emit_sound(id, channel, hammer_sounds[0], volume, attn, flags, pitch)

           if(g_knife_thanatos[id])

               emit_sound(id, channel, thanatos_sounds[0], volume, attn, flags, pitch)

           if(g_knife_boss[id])

               emit_sound(id, channel, boss_sounds[0], volume, attn, flags, pitch)

           if(g_knife_sur[id])

               emit_sound(id, channel, sur_sounds[0], volume, attn, flags, pitch)

       }

       else if (sample[14] == 'h')

       {

           if (sample[17] == 'w')

           {

               if(g_knife_combat[id])

                   emit_sound(id, channel, combat_sounds[3], volume, attn, flags, pitch)

               if(g_knife_strong[id])

                   emit_sound(id, channel, strong_sounds[3], volume, attn, flags, pitch)

               if(g_knife_axe[id])

                   emit_sound(id, channel, axe_sounds[3], volume, attn, flags, pitch)

               if(g_knife_katana[id] )

                   emit_sound(id, channel, katana_sounds[3], volume, attn, flags, pitch)

               if(g_knife_hammer[id])

                   emit_sound(id, channel, hammer_sounds[3], volume, attn, flags, pitch)

               if(g_knife_thanatos[id])

                   emit_sound(id, channel, thanatos_sounds[3], volume, attn, flags, pitch)

               if(g_knife_boss[id])

                   emit_sound(id, channel, boss_sounds[3], volume, attn, flags, pitch)

               if(g_knife_sur[id])

                   emit_sound(id, channel, sur_sounds[3], volume, attn, flags, pitch)


           }

           else

           {

               if(g_knife_combat[id])

                   emit_sound(id, channel, combat_sounds[random_num(1,2)], volume, attn, flags, pitch)

               if(g_knife_strong[id])

                   emit_sound(id, channel, strong_sounds[random_num(1,2)], volume, attn, flags, pitch)

               if(g_knife_axe[id])

                   emit_sound(id, channel, axe_sounds[random_num(1,2)], volume, attn, flags, pitch)

               if(g_knife_katana[id])

                   emit_sound(id, channel, katana_sounds[random_num(1,2)], volume, attn, flags, pitch)

               if(g_knife_hammer[id])

                   emit_sound(id, channel, hammer_sounds[random_num(1,2)], volume, attn, flags, pitch)

               if(g_knife_thanatos[id])

                   emit_sound(id, channel, thanatos_sounds[random_num(1,2)], volume, attn, flags, pitch)

               if(g_knife_boss[id])

                   emit_sound(id, channel, boss_sounds[random_num(1,2)], volume, attn, flags, pitch)
             
               if(g_knife_sur[id])

                   emit_sound(id, channel, sur_sounds[random_num(1,2)], volume, attn, flags, pitch)


           }

       }

       else

       {

           if (sample[15] == 'l')

           {

               if(g_knife_combat[id])

                   emit_sound(id, channel, combat_sounds[4], volume, attn, flags, pitch)

               if(g_knife_strong[id])

                   emit_sound(id, channel, strong_sounds[4], volume, attn, flags, pitch)

               if(g_knife_axe[id])

                   emit_sound(id, channel, axe_sounds[4], volume, attn, flags, pitch)

               if(g_knife_katana[id])

                   emit_sound(id, channel, katana_sounds[4], volume, attn, flags, pitch)

               if(g_knife_hammer[id])

                   emit_sound(id, channel, hammer_sounds[4], volume, attn, flags, pitch)

               if(g_knife_thanatos[id])

                   emit_sound(id, channel, thanatos_sounds[4], volume, attn, flags, pitch)

               if(g_knife_boss[id])

                   emit_sound(id, channel, boss_sounds[4], volume, attn, flags, pitch)

         
               if(g_knife_sur[id])

                   emit_sound(id, channel, sur_sounds[4], volume, attn, flags, pitch)

           }

           else

           {

               if(g_knife_combat[id])

                   emit_sound(id, channel, combat_sounds[5], volume, attn, flags, pitch)

               if(g_knife_strong[id] )

                   emit_sound(id, channel, strong_sounds[5], volume, attn, flags, pitch)

               if(g_knife_axe[id] )

                   emit_sound(id, channel, axe_sounds[5], volume, attn, flags, pitch)

               if(g_knife_katana[id])

                   emit_sound(id, channel, katana_sounds[5], volume, attn, flags, pitch)

               if(g_knife_hammer[id])

                   emit_sound(id, channel, hammer_sounds[5], volume, attn, flags, pitch)

               if(g_knife_thanatos[id])

                   emit_sound(id, channel, thanatos_sounds[5], volume, attn, flags, pitch)

               if(g_knife_boss[id])

                   emit_sound(id, channel, boss_sounds[5], volume, attn, flags, pitch)

               if(g_knife_sur[id])

                   emit_sound(id, channel, sur_sounds[5], volume, attn, flags, pitch)


           }

       }

       return HAM_SUPERCEDE

   }

   return HAM_IGNORED

}



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_knife_combat[iattacker])

                set_msg_arg_string(4, "Combat knife")

        }

    

        if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)

        {

            if(g_knife_strong[iattacker])

                set_msg_arg_string(4, "Strong knife")

        }



        if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)

        {

            if(g_knife_axe[iattacker])

                set_msg_arg_string(4, "Axe knife")

        }



        if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)

        {

            if(g_knife_katana[iattacker])

                set_msg_arg_string(4, "Katana knife")

        }



        if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)

        {

            if(g_knife_hammer[iattacker])

                set_msg_arg_string(4, "Ice knife")

        }

        if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)

        {

            if(g_knife_thanatos[iattacker])

                set_msg_arg_string(4, "Scythe knife")

        }

               if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)

        {

            if(g_knife_boss[iattacker])

                set_msg_arg_string(4, "Fire knife")

        }

               
               if(equal(szTruncatedWeapon, "knife") && get_user_weapon(iattacker) == CSW_KNIFE)

        {

            if(g_knife_sur[iattacker])

                set_msg_arg_string(4, "Sur knife")

        }

    }

    return PLUGIN_CONTINUE

}



stock print_col_chat(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, "!t", "^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, SayText, _, players[i]);  

                       write_byte(players[i]);  

                       write_string(msg);  

                       message_end();  

                   }  

           }  

       }  

}  



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_knife_combat[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_combat_spd))

    }



    if(weapon == CSW_KNIFE && g_knife_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_knife_combat_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    if (weapon == CSW_KNIFE && g_knife_strong[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_strong_spd))



        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_knife_strong_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    }

    if (weapon == CSW_KNIFE && g_knife_axe[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_axe_spd))



        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_knife_axe_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    }

    if (weapon == CSW_KNIFE && g_knife_katana[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_katana_spd))



        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_knife_katana_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    }

    if (weapon == CSW_KNIFE && g_knife_hammer[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_hammer_spd))



        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_knife_hammer_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    }

    if (weapon == CSW_KNIFE && g_knife_thanatos[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_thanatos_spd))



        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_knife_thanatos_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    }


       if (weapon == CSW_KNIFE && g_knife_boss[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_boss_spd))



        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_knife_boss_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    }


       if (weapon == CSW_KNIFE && g_knife_sur[id])

    {

        set_pev(id, get_pcvar_float(cvar_knife_sur_spd))



        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_knife_sur_jump)

            

            set_pev(id, pev_velocity, fVelocity)

            set_pev(id, pev_gaitsequence, 7)

        }

    }


    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



    new weapon = get_user_weapon(attacker)



    if (weapon == CSW_KNIFE && g_knife_combat[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_combat_dmg))

    }

    if (weapon == CSW_KNIFE && g_knife_strong[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_strong_dmg))

    }

    if (weapon == CSW_KNIFE && g_knife_axe[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_axe_dmg))

    }

    if (weapon == CSW_KNIFE && g_knife_katana[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_katana_dmg))

    }

        

    if (weapon == CSW_KNIFE && g_knife_hammer[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_hammer_dmg))

    }

    

    if (weapon == CSW_KNIFE && g_knife_thanatos[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_thanatos_dmg))

    }


       if (weapon == CSW_KNIFE && g_knife_boss[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_boss_dmg))

    }


       if (weapon == CSW_KNIFE && g_knife_sur[attacker])

    {    

        SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_sur_dmg))

    }


       if (weapon == CSW_KNIFE && g_knife_combat[attacker])
    {
        if(!task_exists(victim + 100))
        {
            g_burning1[victim] += 5
            
            set_task(0.1, "Burning1", victim + 100, _, _, "b")
        }
    }


    if (weapon == CSW_KNIFE && g_knife_strong[attacker])
    {
        if(!task_exists(victim + 100))
        {
            g_burning2[victim] += 6
            
            set_task(0.1, "Burning2", victim + 100, _, _, "b")
        }
    }

       
       if (weapon == CSW_KNIFE && g_knife_axe[attacker])
    {
        if(!task_exists(victim + 100))
        {
            g_burning3[victim] += 4
            
            set_task(0.1, "Burning3", victim + 100, _, _, "b")
        }
    }


    if (weapon == CSW_KNIFE && g_knife_katana[attacker])
    {
        if(!task_exists(victim + 100))
        {
            g_burning4[victim] += 7
            
            set_task(0.1, "Burning4", victim + 100, _, _, "b")
        }
    }


       if (weapon == CSW_KNIFE && g_knife_hammer[attacker])
    {
        if(!task_exists(victim + 100))
        {
            g_burning5[victim] += 8
            
            set_task(0.1, "Burning5", victim + 100, _, _, "b")
        }
    }


    if (weapon == CSW_KNIFE && g_knife_thanatos[attacker])
    {
        if(!task_exists(victim + 100))
        {
            g_burning6[victim] += 9
            
            set_task(0.1, "Burning6", victim + 100, _, _, "b")
        }
    }


       if (weapon == CSW_KNIFE && g_knife_boss[attacker])
    {
        if(!task_exists(victim + 100))
        {
            g_burning7[victim] += 11
            
            set_task(0.1, "Burning7", victim + 100, _, _, "b")
        }
    }


    return HAM_IGNORED

}



public fw_Knife_SecondaryAttack_Post(knife)

{    

       static id

       id = get_pdata_cbase(knife, m_pPlayer, 4)



       if(zp_get_user_zombie(id))

        return HAM_IGNORED

   

       if(is_user_connected(id) && g_knife_combat[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_knife_combat_spd_attack2)

       

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }



       if(is_user_connected(id) && g_knife_strong[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_knife_strong_spd_attack2)

           

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }



       if(is_user_connected(id) && g_knife_axe[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_knife_axe_spd_attack2)

               

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }



       if(is_user_connected(id) && g_knife_katana[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_knife_katana_spd_attack2)

               

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }



       if(is_user_connected(id) && g_knife_hammer[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_hammer_spd_attack2)

           

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }     

    

    if(is_user_connected(id) && g_knife_thanatos[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_thanatos_spd_attack2)

           

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }     


       if(is_user_connected(id) && g_knife_boss[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_boss_spd_attack2)

           

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }     
 

       if(is_user_connected(id) && g_knife_sur[id])

       {

           static Float:flRate

           flRate = get_pcvar_float(cvar_sur_spd_attack2)

           

           set_pdata_float(knife, m_flNextPrimaryAttack, flRate, 4)

           set_pdata_float(knife, m_flNextSecondaryAttack, flRate, 4)

           set_pdata_float(knife, m_flTimeWeaponIdle, flRate, 4)

       }     


       return HAM_IGNORED

}



public Burning1(taskid)

{

    static origin[3], flags

    get_user_origin(ID_FBURN1, origin)

    flags = pev(ID_FBURN1, pev_flags)

    if ((flags & FL_INWATER) || g_burning1[ID_FBURN1] < 1 || !is_user_alive(ID_FBURN1))

    {

        remove_task(taskid)

        return

    }

    message_begin(MSG_PVS, SVC_TEMPENTITY, origin)

    write_byte(TE_SPRITE)

    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_sprite1)

    write_byte(2)

    write_byte(200)

    message_end()
    

    g_burning1[ID_FBURN1]--

}



public Burning2(taskid)

{

    static origin[3], flags

    get_user_origin(ID_FBURN2, origin)

    flags = pev(ID_FBURN2, pev_flags)

    if ((flags & FL_INWATER) || g_burning2[ID_FBURN2] < 1 || !is_user_alive(ID_FBURN2))

    {

        remove_task(taskid)

        return

    }

    message_begin(MSG_PVS, SVC_TEMPENTITY, origin)

    write_byte(TE_SPRITE)

    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_sprite2)

    write_byte(2)

    write_byte(200)

    message_end()
    

    g_burning2[ID_FBURN2]--

}



public Burning3(taskid)

{

    static origin[3], flags

    get_user_origin(ID_FBURN3, origin)

    flags = pev(ID_FBURN3, pev_flags)

    if ((flags & FL_INWATER) || g_burning3[ID_FBURN3] < 1 || !is_user_alive(ID_FBURN3))

    {

        remove_task(taskid)

        return

    }

    message_begin(MSG_PVS, SVC_TEMPENTITY, origin)

    write_byte(TE_SPRITE)

    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_sprite3)

    write_byte(2)

    write_byte(200)

    message_end()
    

    g_burning3[ID_FBURN3]--

}



public Burning4(taskid)

{

    static origin[3], flags

    get_user_origin(ID_FBURN4, origin)

    flags = pev(ID_FBURN1, pev_flags)

    if ((flags & FL_INWATER) || g_burning4[ID_FBURN4] < 1 || !is_user_alive(ID_FBURN4))

    {

        remove_task(taskid)

        return

    }

    message_begin(MSG_PVS, SVC_TEMPENTITY, origin)

    write_byte(TE_SPRITE)

    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_sprite4)

    write_byte(2)

    write_byte(200)

    message_end()
    

    g_burning4[ID_FBURN1]--

}



public Burning5(taskid)

{

    static origin[3], flags

    get_user_origin(ID_FBURN5, origin)

    flags = pev(ID_FBURN5, pev_flags)

    if ((flags & FL_INWATER) || g_burning5[ID_FBURN5] < 1 || !is_user_alive(ID_FBURN5))

    {

        remove_task(taskid)

        return

    }

    message_begin(MSG_PVS, SVC_TEMPENTITY, origin)

    write_byte(TE_SPRITE)

    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_sprite5)

    write_byte(2)

    write_byte(200)

    message_end()
    

    g_burning5[ID_FBURN5]--


}



public Burning6(taskid)

{

    static origin[3], flags

    get_user_origin(ID_FBURN6, origin)

    flags = pev(ID_FBURN6, pev_flags)

    if ((flags & FL_INWATER) || g_burning6[ID_FBURN6] < 1 || !is_user_alive(ID_FBURN6))

    {

        remove_task(taskid)

        return

    }

    message_begin(MSG_PVS, SVC_TEMPENTITY, origin)

    write_byte(TE_SPRITE)

    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_sprite6)

    write_byte(2)

    write_byte(200)

    message_end()
    

    g_burning6[ID_FBURN6]--

}


public Burning7(taskid)

{

    static origin[3], flags

    get_user_origin(ID_FBURN7, origin)

    flags = pev(ID_FBURN7, pev_flags)

    if ((flags & FL_INWATER) || g_burning7[ID_FBURN7] < 1 || !is_user_alive(ID_FBURN7))

    {

        remove_task(taskid)

        return

    }

    message_begin(MSG_PVS, SVC_TEMPENTITY, origin)

    write_byte(TE_SPRITE)

    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_sprite7)

    write_byte(2)

    write_byte(200)

    message_end()
    
    g_burning7[ID_FBURN7]--
}


public event_Damage(id)

{

    new weapon , attacker = get_user_attacker(id , weapon);



    if(!is_user_alive(attacker))

        return PLUGIN_CONTINUE;



    if(weapon == CSW_KNIFE && g_knife_combat[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }



    if(weapon == CSW_KNIFE && g_knife_strong[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }



    if(weapon == CSW_KNIFE && g_knife_axe[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }



    if(weapon == CSW_KNIFE && g_knife_katana[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }



    if(weapon == CSW_KNIFE && g_knife_hammer[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }

    

    if(weapon == CSW_KNIFE && g_knife_thanatos[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }


       if(weapon == CSW_KNIFE && g_knife_boss[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }
     
       if(weapon == CSW_KNIFE && g_knife_sur[attacker])

    {

        new Float:vec[3];

        new Float:oldvelo[3];

        get_user_velocity(id, oldvelo);

        create_velocity_vector(id , attacker , vec);

        vec[0] += oldvelo[0];

        vec[1] += oldvelo[1];

        set_user_velocity(id , vec);

    }


    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];

    entity_get_vector(victim   , EV_VEC_origin , vicorigin);

    entity_get_vector(attacker , EV_VEC_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_knife_combat[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_combat_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_combat_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }



    if (g_knife_strong[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_strong_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_strong_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }



    if (g_knife_axe[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_axe_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_axe_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }



    if (g_knife_katana[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_katana_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_katana_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }



    if (g_knife_hammer[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_hammer_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_hammer_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }



    if (g_knife_thanatos[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_thanatos_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_thanatos_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }


       if (g_knife_boss[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_boss_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_boss_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }


       if (g_knife_sur[attacker])

    {

        velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_sur_knock) * 3000) ) / get_entity_distance(victim , attacker);

        velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_sur_knock) * 3000) ) / get_entity_distance(victim , attacker);

    }


    if(velocity[0] <= 20.0 || velocity[1] <= 20.0)

        velocity[2] = random_float(200.0 , 275.0);



    return 1;

}



public client_putinserver(id)

{

    switch(random_num(0, 0))

    {

        case 0:

        {

            g_knife_combat[id] = true

        }



    }

}




#2
Ters döndürüyor.


.sma xx.sma (Dosya Boyutu: 52.56 KB | İndirme Sayısı: 2)


#3
usta eline sağlık fakat pek bi yararını göremedım bu :/
başka birşey yaapbilirmisin örneğin vurunca yansın veya vurunca donsuın 1 saniyelinğne
şunları ekledım ama olmadı
#define FIRE_DURATION1
#define FIRE_DAMAGE1


#4
Bakarım yarın



#5
(14-01-2019, Saat: 20:00)ITenGriTR Adlı Kullanıcıdan Alıntı: Bakarım yarın
tamam aga dondurma özelliği ekliyebilirmisin zahmet olmassa
vurdugu kısı donsun zp_storng_frost 1 // donma süresi 


#6
(14-01-2019, Saat: 20:00)ITenGriTR Adlı Kullanıcıdan Alıntı: Bakarım yarın
aga yapabildin mi ?


#7
....


.sma yy.sma (Dosya Boyutu: 52.74 KB | İndirme Sayısı: 4)


#8
(15-01-2019, Saat: 21:44)ITenGriTR Adlı Kullanıcıdan Alıntı: ....
agam ben birşey anlamadım ama :/

benim istediğim şu videodaki gibi 0.21 saniye ile 0.27 arası izlersen sevinirim
alta link vermış indiridn diye ama yalan inanmayın baska bir menu oda bozuk zaten kullandım denemiştim Üzüldüm





#9
(15-01-2019, Saat: 21:44)ITenGriTR Adlı Kullanıcıdan Alıntı: ....
bu zormuş galiba aga uğraştırmayım seni  söylede yapabilir misin
bomba atınca  zombi  yanma kodları fire grenade de var içindeki yavaşlatma kodunu alıp buraya menuye ekleyip cvar komutu ile o knife ile vurunca örneğin zp_strong_fire_time 5 saniye boyunca yavaş koşucak alev bombası atınca zombi yanınca zaten yavaşliyor içerisinde kodları var sadece yavaşlama kodunu alıp 2.strong knife özelliğine ekliyebilirmisin

Fire Grenade

Kod:
/*================================================================================
    
    --------------------------
    -*- [ZP] Grenade: Fire -*-
    --------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <amx_settings_api>
#include <cs_weap_models_api>
#include <cs_ham_bots_api>
#include <zp50_core>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>

// Settings file
new const ZP_SETTINGS_FILE[] = "zombieplague.ini"

// Default sounds
new const sound_grenade_fire_explode[][] = { "zombie_plague/grenade_explode.wav" }
new const sound_grenade_fire_player[][] = { "zombie_plague/zombie_burn3.wav" , "zombie_plague/zombie_burn4.wav" , "zombie_plague/zombie_burn5.wav" , "zombie_plague/zombie_burn6.wav" , "zombie_plague/zombie_burn7.wav" }

#define MODEL_MAX_LENGTH 64
#define SOUND_MAX_LENGTH 64
#define SPRITE_MAX_LENGTH 64

// Models
new g_model_grenade_fire[MODEL_MAX_LENGTH] = "models/zombie_plague/v_grenade_fire.mdl"

// Sprites
new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
new g_sprite_grenade_fire[SPRITE_MAX_LENGTH] = "sprites/flame.spr"
new g_sprite_grenade_smoke[SPRITE_MAX_LENGTH] = "sprites/black_smoke3.spr"

new Array:g_sound_grenade_fire_explode
new Array:g_sound_grenade_fire_player

// Explosion radius for custom grenades
const Float:NADE_EXPLOSION_RADIUS = 240.0

// HACK: pev_ field used to store custom nade types and their values
const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_NAPALM = 2222

#define TASK_BURN 100
#define ID_BURN (taskid - TASK_BURN)

#define MAXPLAYERS 32

// Custom Forwards
enum _:TOTAL_FORWARDS
{
    FW_USER_BURN_PRE = 0
}
new g_Forwards[TOTAL_FORWARDS]
new g_ForwardResult

new g_BurningDuration[MAXPLAYERS+1]

new g_MsgDamage
new g_trailSpr, g_exploSpr, g_flameSpr, g_smokeSpr

new cvar_grenade_fire_duration, cvar_grenade_fire_damage, cvar_grenade_fire_slowdown, cvar_grenade_fire_hudicon, cvar_grenade_fire_explosion

public plugin_init()
{
    register_plugin("[ZP] Grenade: Fire", ZP_VERSION_STRING, "ZP Dev Team")
    
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    RegisterHamBots(Ham_Killed, "fw_PlayerKilled")
    register_forward(FM_SetModel, "fw_SetModel")
    RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
    
    g_MsgDamage = get_user_msgid("Damage")
    
    cvar_grenade_fire_duration = register_cvar("zp_grenade_fire_duration", "10")
    cvar_grenade_fire_damage = register_cvar("zp_grenade_fire_damage", "5")
    cvar_grenade_fire_slowdown = register_cvar("zp_grenade_fire_slowdown", "0.5")
    cvar_grenade_fire_hudicon = register_cvar("zp_grenade_fire_hudicon", "1")
    cvar_grenade_fire_explosion = register_cvar("zp_grenade_fire_explosion", "0")
    
    g_Forwards[FW_USER_BURN_PRE] = CreateMultiForward("zp_fw_grenade_fire_pre", ET_CONTINUE, FP_CELL)
}

public plugin_precache()
{
    // Initialize arrays
    g_sound_grenade_fire_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)
    g_sound_grenade_fire_player = ArrayCreate(SOUND_MAX_LENGTH, 1)
    
    // Load from external file
    amx_load_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "GRENADE FIRE EXPLODE", g_sound_grenade_fire_explode)
    amx_load_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "GRENADE FIRE PLAYER", g_sound_grenade_fire_player)
    
    // If we couldn't load custom sounds from file, use and save default ones
    new index
    if (ArraySize(g_sound_grenade_fire_explode) == 0)
    {
        for (index = 0; index < sizeof sound_grenade_fire_explode; index++)
            ArrayPushString(g_sound_grenade_fire_explode, sound_grenade_fire_explode[index])
        
        // Save to external file
        amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "GRENADE FIRE EXPLODE", g_sound_grenade_fire_explode)
    }
    if (ArraySize(g_sound_grenade_fire_player) == 0)
    {
        for (index = 0; index < sizeof sound_grenade_fire_player; index++)
            ArrayPushString(g_sound_grenade_fire_player, sound_grenade_fire_player[index])
        
        // Save to external file
        amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "GRENADE FIRE PLAYER", g_sound_grenade_fire_player)
    }
    
    // Load from external file, save if not found
    if (!amx_load_setting_string(ZP_SETTINGS_FILE, "Weapon Models", "GRENADE FIRE", g_model_grenade_fire, charsmax(g_model_grenade_fire)))
        amx_save_setting_string(ZP_SETTINGS_FILE, "Weapon Models", "GRENADE FIRE", g_model_grenade_fire)
    if (!amx_load_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))
        amx_save_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail)
    if (!amx_load_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))
        amx_save_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring)
    if (!amx_load_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "FIRE", g_sprite_grenade_fire, charsmax(g_sprite_grenade_fire)))
        amx_save_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "FIRE", g_sprite_grenade_fire)
    if (!amx_load_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "SMOKE", g_sprite_grenade_smoke, charsmax(g_sprite_grenade_smoke)))
        amx_save_setting_string(ZP_SETTINGS_FILE, "Grenade Sprites", "SMOKE", g_sprite_grenade_smoke)
    
    // Precache sounds
    new sound[SOUND_MAX_LENGTH]
    for (index = 0; index < ArraySize(g_sound_grenade_fire_explode); index++)
    {
        ArrayGetString(g_sound_grenade_fire_explode, index, sound, charsmax(sound))
        precache_sound(sound)
    }
    for (index = 0; index < ArraySize(g_sound_grenade_fire_player); index++)
    {
        ArrayGetString(g_sound_grenade_fire_player, index, sound, charsmax(sound))
        precache_sound(sound)
    }
    
    // Precache models
    precache_model(g_model_grenade_fire)
    g_trailSpr = precache_model(g_sprite_grenade_trail)
    g_exploSpr = precache_model(g_sprite_grenade_ring)
    g_flameSpr = precache_model(g_sprite_grenade_fire)
    g_smokeSpr = precache_model(g_sprite_grenade_smoke)
}

public plugin_natives()
{
    register_library("zp50_grenade_fire")
    register_native("zp_grenade_fire_get", "native_grenade_fire_get")
    register_native("zp_grenade_fire_set", "native_grenade_fire_set")
    
    set_module_filter("module_filter")
    set_native_filter("native_filter")
}
public module_filter(const module[])
{
    if (equal(module, LIBRARY_NEMESIS))
        return PLUGIN_HANDLED;
    
    return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap)
{
    if (!trap)
        return PLUGIN_HANDLED;
        
    return PLUGIN_CONTINUE;
}

public native_grenade_fire_get(plugin_id, num_params)
{
    new id = get_param(1)
    
    if (!is_user_alive(id))
    {
        log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
        return false;
    }
    
    return task_exists(id+TASK_BURN);
}

public native_grenade_fire_set(plugin_id, num_params)
{
    new id = get_param(1)
    
    if (!is_user_alive(id))
    {
        log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
        return false;
    }
    
    new set = get_param(2)
    
    // End fire
    if (!set)
    {
        // Not burning
        if (!task_exists(id+TASK_BURN))
            return true;
        
        // Get player origin
        static origin[3]
        get_user_origin(id, origin)
        
        // 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(id+TASK_BURN)
        return true;
    }
    
    // Set on fire
    return set_on_fire(id);
}

public zp_fw_core_cure_post(id, attacker)
{
    // Stop burning
    remove_task(id+TASK_BURN)
    g_BurningDuration[id] = 0
    
    // Set custom grenade model
    cs_set_player_view_model(id, CSW_HEGRENADE, g_model_grenade_fire)
}

public zp_fw_core_infect(id, attacker)
{
    // Remove custom grenade model
    cs_reset_player_view_model(id, CSW_HEGRENADE)
}

// Ham Player Killed Forward
public fw_PlayerKilled(victim, attacker, shouldgib)
{
    // Stop burning
    remove_task(victim+TASK_BURN)
    g_BurningDuration[victim] = 0
}

public client_disconnect(id)
{
    // Stop burning
    remove_task(id+TASK_BURN)
    g_BurningDuration[id] = 0
}

// Forward Set Model
public fw_SetModel(entity, const model[])
{
    // We don't care
    if (strlen(model) < 8)
        return;
    
    // Narrow down our matches a bit
    if (model[7] != 'w' || model[8] != '_')
        return;
    
    // Get damage time of grenade
    static Float:dmgtime
    pev(entity, pev_dmgtime, dmgtime)
    
    // Grenade not yet thrown
    if (dmgtime == 0.0)
        return;
    
    // Grenade's owner is zombie?
    if (zp_core_is_zombie(pev(entity, pev_owner)))
        return;
    
    // HE Grenade
    if (model[9] == 'h' && model[10] == 'e')
    {
        // Give it a glow
        fm_set_rendering(entity, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16)
        
        // And a colored trail
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(TE_BEAMFOLLOW) // TE id
        write_short(entity) // entity
        write_short(g_trailSpr) // sprite
        write_byte(10) // life
        write_byte(10) // width
        write_byte(200) // r
        write_byte(0) // g
        write_byte(0) // b
        write_byte(200) // brightness
        message_end()
        
        // Set grenade type on the thrown grenade entity
        set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_NAPALM)
    }
}

// Ham Grenade Think Forward
public fw_ThinkGrenade(entity)
{
    // Invalid entity
    if (!pev_valid(entity)) return HAM_IGNORED;
    
    // Get damage time of grenade
    static Float:dmgtime
    pev(entity, pev_dmgtime, dmgtime)
    
    // Check if it's time to go off
    if (dmgtime > get_gametime())
        return HAM_IGNORED;
    
    // Not a napalm grenade
    if (pev(entity, PEV_NADE_TYPE) != NADE_TYPE_NAPALM)
        return HAM_IGNORED;
    
    fire_explode(entity);
    
    // Keep the original explosion?
    if (get_pcvar_num(cvar_grenade_fire_explosion))
    {
        set_pev(entity, PEV_NADE_TYPE, 0)
        return HAM_IGNORED;
    }
    
    // Get rid of the grenade
    engfunc(EngFunc_RemoveEntity, entity)
    return HAM_SUPERCEDE;
}

// Fire Grenade Explosion
fire_explode(ent)
{
    // Get origin
    static Float:origin[3]
    pev(ent, pev_origin, origin)
    
    // Override original HE grenade explosion?
    if (!get_pcvar_num(cvar_grenade_fire_explosion))
    {
        // Make the explosion
        create_blast2(origin)
        
        // Fire nade explode sound
        static sound[SOUND_MAX_LENGTH]
        ArrayGetString(g_sound_grenade_fire_explode, random_num(0, ArraySize(g_sound_grenade_fire_explode) - 1), sound, charsmax(sound))
        emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
    }
    
    // Collisions
    new victim = -1
    
    while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, NADE_EXPLOSION_RADIUS)) != 0)
    {
        // Only effect alive zombies
        if (!is_user_alive(victim) || !zp_core_is_zombie(victim))
            continue;
        
        set_on_fire(victim)
    }
}

set_on_fire(victim)
{
    // Allow other plugins to decide whether player should be burned or not
    ExecuteForward(g_Forwards[FW_USER_BURN_PRE], g_ForwardResult, victim)
    if (g_ForwardResult >= PLUGIN_HANDLED)
        return false;
    
    // Heat icon?
    if (get_pcvar_num(cvar_grenade_fire_hudicon))
    {
        message_begin(MSG_ONE_UNRELIABLE, g_MsgDamage, _, victim)
        write_byte(0) // damage save
        write_byte(0) // damage take
        write_long(DMG_BURN) // damage type
        write_coord(0) // x
        write_coord(0) // y
        write_coord(0) // z
        message_end()
    }
    
    // Reduced duration for Nemesis
    if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(victim))
    {
        // fire duration (nemesis)
        g_BurningDuration[victim] += get_pcvar_num(cvar_grenade_fire_duration)
    }
    else
    {
        // fire duration (zombie)
        g_BurningDuration[victim] += get_pcvar_num(cvar_grenade_fire_duration) * 5
    }
    
    // Set burning task on victim
    remove_task(victim+TASK_BURN)
    set_task(0.2, "burning_flame", victim+TASK_BURN, _, _, "b")
    return true;
}

// Burning Flames
public burning_flame(taskid)
{
    // Get player origin and flags
    static origin[3]
    get_user_origin(ID_BURN, origin)
    new flags = pev(ID_BURN, pev_flags)
    
    // In water or burning stopped
    if ((flags & FL_INWATER) || g_BurningDuration[ID_BURN] < 1)
    {
        // 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;
    }
    
    // Nemesis Class loaded?
    if (!LibraryExists(LIBRARY_NEMESIS, LibType_Library) || !zp_class_nemesis_get(ID_BURN))
    {
        // Randomly play burning zombie scream sounds
        if (random_num(1, 20) == 1)
        {
            static sound[SOUND_MAX_LENGTH]
            ArrayGetString(g_sound_grenade_fire_player, random_num(0, ArraySize(g_sound_grenade_fire_player) - 1), sound, charsmax(sound))
            emit_sound(ID_BURN, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
        }
        
        // Fire slow down
        if ((flags & FL_ONGROUND) && get_pcvar_float(cvar_grenade_fire_slowdown) > 0.0)
        {
            static Float:velocity[3]
            pev(ID_BURN, pev_velocity, velocity)
            xs_vec_mul_scalar(velocity, get_pcvar_float(cvar_grenade_fire_slowdown), velocity)
            set_pev(ID_BURN, pev_velocity, velocity)
        }
    }
    
    // Get player's health
    new health = get_user_health(ID_BURN)
    
    // Take damage from the fire
    if (health - floatround(get_pcvar_float(cvar_grenade_fire_damage), floatround_ceil) > 0)
        set_user_health(ID_BURN, health - floatround(get_pcvar_float(cvar_grenade_fire_damage), floatround_ceil))
    
    // 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()
    
    // Decrease burning duration counter
    g_BurningDuration[ID_BURN]--
}

// Fire Grenade: Fire Blast
create_blast2(const Float:origin[3])
{
    // Smallest ring
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
    write_byte(TE_BEAMCYLINDER) // TE id
    engfunc(EngFunc_WriteCoord, origin[0]) // x
    engfunc(EngFunc_WriteCoord, origin[1]) // y
    engfunc(EngFunc_WriteCoord, origin[2]) // z
    engfunc(EngFunc_WriteCoord, origin[0]) // x axis
    engfunc(EngFunc_WriteCoord, origin[1]) // y axis
    engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis
    write_short(g_exploSpr) // sprite
    write_byte(0) // startframe
    write_byte(0) // framerate
    write_byte(4) // life
    write_byte(60) // width
    write_byte(0) // noise
    write_byte(200) // red
    write_byte(100) // green
    write_byte(0) // blue
    write_byte(200) // brightness
    write_byte(0) // speed
    message_end()
    
    // Medium ring
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
    write_byte(TE_BEAMCYLINDER) // TE id
    engfunc(EngFunc_WriteCoord, origin[0]) // x
    engfunc(EngFunc_WriteCoord, origin[1]) // y
    engfunc(EngFunc_WriteCoord, origin[2]) // z
    engfunc(EngFunc_WriteCoord, origin[0]) // x axis
    engfunc(EngFunc_WriteCoord, origin[1]) // y axis
    engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis
    write_short(g_exploSpr) // sprite
    write_byte(0) // startframe
    write_byte(0) // framerate
    write_byte(4) // life
    write_byte(60) // width
    write_byte(0) // noise
    write_byte(200) // red
    write_byte(50) // green
    write_byte(0) // blue
    write_byte(200) // brightness
    write_byte(0) // speed
    message_end()
    
    // Largest ring
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
    write_byte(TE_BEAMCYLINDER) // TE id
    engfunc(EngFunc_WriteCoord, origin[0]) // x
    engfunc(EngFunc_WriteCoord, origin[1]) // y
    engfunc(EngFunc_WriteCoord, origin[2]) // z
    engfunc(EngFunc_WriteCoord, origin[0]) // x axis
    engfunc(EngFunc_WriteCoord, origin[1]) // y axis
    engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis
    write_short(g_exploSpr) // sprite
    write_byte(0) // startframe
    write_byte(0) // framerate
    write_byte(4) // life
    write_byte(60) // width
    write_byte(0) // noise
    write_byte(200) // red
    write_byte(0) // green
    write_byte(0) // blue
    write_byte(200) // brightness
    write_byte(0) // speed
    message_end()
}

// Set entity's rendering type (from fakemeta_util)
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
    static Float:color[3]
    color[0] = float(r)
    color[1] = float(g)
    color[2] = float(b)
    
    set_pev(entity, pev_renderfx, fx)
    set_pev(entity, pev_rendercolor, color)
    set_pev(entity, pev_rendermode, render)
    set_pev(entity, pev_renderamt, float(amount))
}




#10
(14-01-2019, Saat: 20:00)ITenGriTR Adlı Kullanıcıdan Alıntı: Bakarım yarın
müsaitmisin Gülücük




Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
Silinmiş Konu   | Say Komutu Ekleme admin1963- 1 237 23-12-2019, Saat: 21:25
Son Yorum: By.KinG
Silinmiş Konu   | sma ya Dosya ekleme 1 admin1963+ 1 285 01-12-2019, Saat: 15:33
Son Yorum: By.KinG
Silinmiş Konu   | sma ya Dosya ekleme admin1963+ 1 302 01-12-2019, Saat: 15:31
Son Yorum: By.KinG
Silinmiş Konu   | Jbmenuye hulk modu ekleme ATEŞ BAŞKAN 5 368 26-08-2019, Saat: 21:44
Son Yorum: Smash
Silinmiş Konu   | Jbmenuye hulk modu ekleme ATEŞ BAŞKAN 2 281 26-08-2019, Saat: 16:56
Son Yorum: Aconyonn

Task