AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Request plugin death effect (https://forums.alliedmods.net/showthread.php?t=342718)

jerkofici 05-07-2023 11:08

Request plugin death effect
 
Hello everybody !!

Sorry for taking from your time but I am looking for a plugin for cs 1.6 server (amx vers 1.9) that looks like this :

Soul / spirit leave body when player get killed .

https://vm.tiktok.com/ZGJuJEyoR/

I do not want to make advertising or something but i saw this on TikTok and I did not find the plugin .

Do somebody can help me with a source code / model / plugin ?

Thanks a lot !

mlibre 05-07-2023 18:24

Re: Request plugin death effect
 
you have the sprite

jerkofici 05-08-2023 11:52

Re: Request plugin death effect
 
Quote:

Originally Posted by mlibre (Post 2804077)
you have the sprite

Hello...no...i do not have nothing...

Siska1 05-08-2023 14:19

Re: Request plugin death effect
 
https://dev-cs.ru/resources/899/

mlibre 05-08-2023 18:24

Re: Request plugin death effect
 
Quote:

Originally Posted by jerkofici (Post 2804053)
Hello everybody !!

Sorry for taking from your time but I am looking for a plugin for cs 1.6 server (amx vers 1.9) that looks like this :

Soul / spirit leave body when player get killed .

https://vm.tiktok.com/ZGJuJEyoR/

I do not want to make advertising or something but i saw this on TikTok and I did not find the plugin .

Do somebody can help me with a source code / model / plugin ?

Thanks a lot !

I tried to recreate what was seen in the video, this was the closest I could get it
  1. First way, its behavior is the same but with another simpler methodology

    PHP Code:

    #include <amxmodx>
    #include <hamsandwich>
    #include <engine>

    #define PLUGIN "Player Soul"
    #define VERSION "1.3"
    #define AUTHOR "mlibre"

    new g_soulSprg_iCvarScreenFadeg_iCvarFloatHeight

    public plugin_precache() {
        
    register_plugin(PLUGINVERSIONAUTHOR)
        
        
    g_iCvarScreenFade register_cvar("amx_psoul_screenfade""1")
        
    g_iCvarFloatHeight register_cvar("amx_psoul_floatheight""180")
        
        
    g_soulSpr precache_model("sprites/iplayerdead.spr")
        
        
    RegisterHam(Ham_Killed"player""Ham_KilledPlayer_Post"1)
    }

    public 
    Ham_KilledPlayer_Post(idattacker)
    {
        
    //green effects
        
    if(get_pcvar_num(g_iCvarScreenFade))
        {
            
    set_ScreenFade(attacker)
        }
        
        
    //generate the soul
        
    new Float:fOrigin[3]; entity_get_vector(idEV_VEC_originfOrigin)
        
        
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
    write_byte(TE_BUBBLES)
        
    #if !defined write_coord_f
        
    write_coord(floatround(fOrigin[0]))
        
    write_coord(floatround(fOrigin[1]))
        
    write_coord(floatround(fOrigin[2]))    //min start position
        
    write_coord(floatround(fOrigin[0]))
        
    write_coord(floatround(fOrigin[1]))
        
    write_coord(floatround(fOrigin[2])+10)    //max start position
        #else
        
    write_coord_f(fOrigin[0])
        
    write_coord_f(fOrigin[1])
        
    write_coord_f(fOrigin[2])        //min start position
        
    write_coord_f(fOrigin[0])
        
    write_coord_f(fOrigin[1])
        
    write_coord_f(fOrigin[2]+10)        //max start position
        #endif
        
    write_coord(get_pcvar_num(g_iCvarFloatHeight))    //float height
        
    write_short(g_soulSpr)
        
    write_byte(1)        //count
        
    write_coord(1)        //speed
        
    message_end()
    }

    stock set_ScreenFade(id)
    {
        static 
    maxplayers
        
        
    if( !maxplayers )
            
    maxplayers get_maxplayers()
            
        
    #define isPlayer(%1)    (1 <= %1 <= maxplayers)
        
        
    if( !isPlayer(id) )
            return
        
        static 
    msgid_ScreenFade
        
        
    if( !msgid_ScreenFade )
            
    msgid_ScreenFade get_user_msgid("ScreenFade")
        
        
    message_begin(MSG_ONE_UNRELIABLEmsgid_ScreenFade, {0,0,0}, id)
        
    write_short(1<<10)    // Duration
        
    write_short(1<<10)    // Hold time
        
    write_short(0x0000)    // Fade type
        
    write_byte(120)    // Red
        
    write_byte(255)    // Green
        
    write_byte(120)    // Blue
        
    write_byte(100)    // Alpha
        
    message_end()


    changelog 1.x
  2. The second way is the one that fits the most, as you can see I did not use a sprite but the same player models that do not require precaching

    PHP Code:

    #include <amxmodx>
    #include <hamsandwich>
    #include <engine>

    #define PLUGIN "Player Soul"
    #define VERSION "2.3"
    #define AUTHOR "mlibre"

    new g_iCvarScreenFadeg_fCvarTransparencyg_fCvarVelocity

    public plugin_init() {
        
    register_plugin(PLUGINVERSIONAUTHOR)
        
        
    g_iCvarScreenFade register_cvar("amx_psoul_screenfade""1")
        
    g_fCvarTransparency register_cvar("amx_psoul_transparency""50.0")
        
    g_fCvarVelocity register_cvar("amx_psoul_velocity""80.0")
        
        
    RegisterHam(Ham_Killed"player""Ham_KilledPlayer_Post"1)
    }

    public 
    Ham_KilledPlayer_Post(idattacker)
    {
        
    //green effects
        
    if(get_pcvar_num(g_iCvarScreenFade))
        {
            
    set_ScreenFade(attacker)
        }
        
        
    //generate the soul
        
    new ent create_entity("info_target")
        
        if( !
    ent )
            return
            
        
    entity_set_string(entEV_SZ_classname"s0ul")
        
    entity_set_int(entEV_INT_movetypeMOVETYPE_NOCLIP)
        
    entity_set_int(entEV_INT_solidSOLID_NOT)
        
        new 
    szInfo[64]; get_user_info(id"model"szInfocharsmax(szInfo))
        
        new 
    szModel[256]; formatex(szModelcharsmax(szModel), "models/player/%s/%s.mdl"szInfoszInfo)
        
        
    //antiCrash!
        
    if(szModel[strlen(szModel) - 4] == '.' 
        
    && szModel[strlen(szModel) - 3] == 'm'
        
    && szModel[strlen(szModel) - 2] == 'd'
        
    && szModel[strlen(szModel) - 1] == 'l')
        {
            
    entity_set_model(entszModel)
        }
        else 
        {
            
    log_amx("%s *** overflow!"szModel)
            
            
    entity_set_model(ent"models/player.mdl")
        }
        
        
    entity_set_int(entEV_INT_sequence64)    // set player body =--()--=
        
    entity_set_float(entEV_FL_frame0.0)
        
        new 
    Float:fOrigin[3]; entity_get_vector(idEV_VEC_originfOrigin)
        
        
    fOrigin[2] += 10.0
        
        entity_set_origin
    (entfOrigin)
        
        
    // effect soul
        
    entity_set_int(entEV_INT_renderfxkRenderFxGlowShell)
        
    entity_set_int(entEV_INT_rendermodekRenderTransAlpha)
        
    entity_set_float(entEV_FL_renderamtget_pcvar_float(g_fCvarTransparency))
        
        
    // apply motion
        
    new Float:fVelocity[3]
        
        
    fVelocity[2] = get_pcvar_float(g_fCvarVelocity)
        
        
    entity_set_vector(entEV_VEC_velocityfVelocity)
        
        
    set_task(3.0"remove_s0ul"ent)
    }

    public 
    remove_s0ul(ent)
    {
        if(
    is_valid_ent(ent))
            
    entity_set_int(entEV_INT_flagsFL_KILLME)
    }

    stock set_ScreenFade(id)
    {
        static 
    maxplayers
        
        
    if( !maxplayers )
            
    maxplayers get_maxplayers()
            
        
    #define isPlayer(%1)    (1 <= %1 <= maxplayers)
        
        
    if( !isPlayer(id) )
            return
        
        static 
    msgid_ScreenFade
        
        
    if( !msgid_ScreenFade )
            
    msgid_ScreenFade get_user_msgid("ScreenFade")
        
        
    message_begin(MSG_ONE_UNRELIABLEmsgid_ScreenFade, {0,0,0}, id)
        
    write_short(1<<10)    // Duration
        
    write_short(1<<10)    // Hold time
        
    write_short(0x0000)    // Fade type
        
    write_byte(120)    // Red
        
    write_byte(255)    // Green
        
    write_byte(120)    // Blue
        
    write_byte(100)    // Alpha
        
    message_end()


    changelog 2.x

metal_upa 05-09-2023 03:59

Re: Request plugin death effect
 
1 Attachment(s)
This is my version that required regamedll + reapi

code

DJEarthQuake 05-09-2023 12:34

Re: Request plugin death effect
 
1 Attachment(s)
Quote:

Originally Posted by mlibre (Post 2804077)
you have the sprite

It's ghost.mdl; player skin for Half-Life: Opposing Force.


All times are GMT -4. The time now is 22:48.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.