Как сделать поджег зомби при выстреле в CS 1.6
Как сделать поджег зомби при выстреле в CS 1.6

В этой статье будет рассказано как добавить к оружию эффект поджога зомби

После инклюдов пишем следующие строчки:
#define TASK_FBURN                100
#define ID_FBURN                                ( taskid - TASK_FBURN )

#define MAX_CLIENTS                32

new bool:g_fRoundEnd

#define FIRE_DURATION        6
#define FIRE_DAMAGE        25
Получиться примерно так:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <xs>
#include <cstrike>
#include <zombieplague>

#define ENG_NULLENT            -1
#define EV_INT_WEAPONKEY    EV_INT_impulse
#define cv4760r_WEAPONKEY     843
#define MAX_PLAYERS          32
#define IsValidUser(%1) (1 <= %1 <= g_MaxPlayers)

#define TASK_FBURN                100
#define ID_FBURN                                     ( taskid - TASK_FBURN )

#define MAX_CLIENTS                32

new bool:g_fRoundEnd

#define FIRE_DURATION        6
#define FIRE_DAMAGE        25
Ниже добавляем это:
new g_flameSpr
new g_smokeSpr
new g_burning_duration[ MAX_CLIENTS + 1 ]
В public plugin_precache добавляем эти строчки
g_flameSpr = precache_model( "sprites/flame.spr" );
g_smokeSpr = precache_model( "sprites/black_smoke3.spr" );
Дальше в public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
Добавляем это (в самый конец)
if( !task_exists( victim + TASK_FBURN ) )
                {
                g_burning_duration[ victim ] += FIRE_DURATION * 5
                
                set_task( 0.2, "CTask__BurningFlame", victim + TASK_FBURN, _, _, "b" )
            }
        }
    }
}  

Получиться примерно так:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
    if (victim != attacker && is_user_connected(attacker))
    {
        if(get_user_weapon(attacker) == CSW_AK47)
        {
            if(g_has_cv4760r[attacker])
                SetHamParamFloat(4, damage * get_pcvar_float(cvar_dmg_cv4760r))

                        if( !task_exists( victim + TASK_FBURN ) )
            {
                g_burning_duration[ victim ] += FIRE_DURATION * 5
                
                set_task( 0.2, "CTask__BurningFlame", victim + TASK_FBURN, _, _, "b" )
            }
        }
    }
}  
В самый конец исходника добавляем это:
 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]--
}

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

Hello, Our administration publishes only cannon content, put like under the post below and write the top comment, we are preparing the material just for you, Darling Гость.

Comments 5
  1. )_NEO_(
    Вроде можно зделать куда меньше, в моих ножах по другому зделано 
    • 14 June 2018 09:36
  2. h3lls1ng
    На зм сру статья была про поджог зомби.
    Коментатор всея Руси.
    vk.com/h3lls1ng
    • 14 June 2018 09:55
  3. Rothmans
    не легче сделать через zombie_plague40.sma ?

    • 3 March 2019 19:09
    1. BuB9neC
      BuB9neC
      • +1
      пиздец, ну ты рофлан)
      • 3 March 2019 19:11
    2. resident_evil
      Ухахаха уёбок сраный
      • 27 August 2019 19:04
Users belonging to group Guests cannot add comments to this article.
Base for Your Build
Information

Welcome to TB-TEAM.COM!

To become a full-fledged user of our portal, you need to register.
Register
Create your own account!

Register Now
Log In
Already registered? Go ahead and log in!

Log In