Raised This Month: $12 Target: $400
 3% 

Sniper 3D Assassin Slow Motion final shot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-04-2020 , 23:26   Sniper 3D Assassin Slow Motion final shot
Reply With Quote #1



This would enhance 'assassination maps' or the 'last man standing' replay / game-mode.

Alpha code as seen below. This can be accomplished with 1 trigger camera ent start point, func_train, and pathcorner end point.

PHP Code:
//3D Sniper kill effect replay
//started here https://twhl.info/wiki/page/Tutorial%3A_trigger_camera
#include amxmodx
#include engine
#include hamsandwich


#define PLUGIN      "Camera end-game point"
#define VERSION     "1.0"
#define AUTHOR      "SPiNX"
#define MAX_PLAYERS 32

new const szDeath_symbol_spr[] = "models/bskull_template1.mdl";
new const 
szDeath_symbol_tr[]  = "sprites/smoke.spr";
new 
smokeskull;
new 
g_cam,g_train,g_corner

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Killed"player""client_death");
    
RegisterHam(Ham_Spawn"player""client_spawn"1);
}

public 
client_death(victim,killer)
{
    if ( 
killer <= || killer == victim || is_user_bot(victim)) return PLUGIN_HANDLED_MAIN
    
if ( killer )
    if(
is_user_connected(victim) && !is_user_alive(victim) && !is_user_bot(victim) && is_user_connected(killer))

    {
        
set_view(victimCAMERA_3RDPERSON);
        
console_cmd(victim"default_fov 150");
        new 
Deathcam[3];
        new 
Eye 1;
        
get_user_origin(victim,Deathcam,Eye);

        
#define TE_LIGHTNING 7          // TE_BEAMPOINTS with simplified parameters

        
new Korigin[3];
        
get_user_origin(killer,Korigin,Eye);

        
/*
        new Float:Vaim[3];
        new iVelocity;
        iVelocity = 1.0
        velocity_by_aim(killer, iVelocity, Vaim)

        emessage_begin( 0, SVC_TEMPENTITY, { 0, 0, 0 }, 0 );
        ewrite_byte(TE_PROJECTILE);
        ewrite_coord(Korigin[0]);       // start position
        ewrite_coord(Korigin[1]);
        ewrite_coord(Korigin[2]);
        ewrite_coord(floatround(Vaim[0]));      // end position
        ewrite_coord(floatround(Vaim[1]));
        ewrite_coord(floatround(Vaim[2]));
        ewrite_short(smoke)
        ewrite_byte(100)
        ewrite_byte(0)  //projectile won't collide with owner (if owner == 0, projectile will hit any client).
        emessage_end();
        */

        
emessage_beginMSG_ONE_UNRELIABLESVC_TEMPENTITY, { 00}, victim );
        
ewrite_byte(TE_LIGHTNING);
        
ewrite_coord(Korigin[0]);       // start position
        
ewrite_coord(Korigin[1]);
        
ewrite_coord(Korigin[2]);
        
ewrite_coord(Deathcam[0]);      // end position
        
ewrite_coord(Deathcam[1]);
        
ewrite_coord(Deathcam[2]);
        
ewrite_byte(65);        // life in 0.1's
        
ewrite_byte(100);        // width in 0.1's
        
ewrite_byte(15); // amplitude in 0.01's
        
ewrite_short(smoke);     // sprite model index
        
emessage_end();

        
emessage_beginMSG_ONE_UNRELIABLESVC_TEMPENTITY, { 00}, victim );
        
ewrite_byte(TE_LINE);
        
ewrite_coord(Korigin[0]);
        
ewrite_coord(Korigin[1]);
        
ewrite_coord(Korigin[2]);
        
ewrite_coord(Deathcam[0]);
        
ewrite_coord(Deathcam[1]);
        
ewrite_coord(Deathcam[2]);
        
ewrite_short(60); //life
        
ewrite_byte(0); //r
        
ewrite_byte(255); //g
        
ewrite_byte(0);  //b
        
emessage_end();

       
//After Death effect
        
emessage_beginMSG_ONE_UNRELIABLESVC_TEMPENTITY,{0,0,0}, victim );
        
ewrite_byte(TE_FIREFIELD);

        
ewrite_coord(Deathcam[0]);
        
ewrite_coord(Deathcam[1]);
        
ewrite_coord(Deathcam[2] + random_num(-5001000));

        
ewrite_short(15)/*radius*/;

        switch(
random_num(0,2)) {
            case 
0ewrite_short(skull)
            case 
1ewrite_short(killer)
            case 
2ewrite_short(victim)
        }
        
ewrite_byte(1)/*count*/;
        
ewrite_byte(2)/*flags*/;
        
ewrite_byte(random_num(5,15))/*duration*/;
        
emessage_end();

        return 
PLUGIN_HANDLED;

    }

    return 
PLUGIN_CONTINUE;
}

public 
client_spawn(id)
{
    if(
is_user_bot(id) || is_user_hltv(id) )
        return 
PLUGIN_HANDLED_MAIN;

    if(
is_user_connected(id) && is_user_alive(id) )

    {
        
set_view(idCAMERA_NONE);
        
console_cmd(id"default_fov 100");
    }

    return 
PLUGIN_CONTINUE;
}

public 
plugin_precache()
{
    
skull precache_model(szDeath_symbol_spr);
    
precache_generic(szDeath_symbol_spr);
    
smoke precache_model(szDeath_symbol_tr);
    
precache_generic(szDeath_symbol_spr);
    
#if AMXX_VERSION_NUM != 110
    #if AMXX_VERSION_NUM != 190
    
precache_model("models/rpgrocket.mdl");
    
precache_generic("models/rpgrocket.mdl");
    
#endif
    #endif
}

public 
client_putinserver(id)
    
//Some mods spawn (death) field-of-view.
    
if(is_user_connected(id))
    
set_task(0.5,"client_spawn",id);


public 
client_disconnected(id)
    if(
task_exists(id))
        
remove_task(id); 
__________________

Last edited by DJEarthQuake; 09-21-2021 at 19:59.
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-23-2020 , 19:50   Re: Sniper 3D Assassin Slow Motion final shot
Reply With Quote #2

Sketchily.
__________________
DJEarthQuake is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 10-24-2020 , 06:47   Re: Sniper 3D Assassin Slow Motion final shot
Reply With Quote #3

i guess it can be done, we have an example with grenades, but it would be bad too to the shooter against multiple enemies, if i shoot someone and watch the bullet, when i`m back someone else would have killed me too xD
tarsisd2 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-24-2020 , 09:40   Re: Sniper 3D Assassin Slow Motion final shot
Reply With Quote #4

Right now it is a death message to the victim just tracing origins.
__________________
DJEarthQuake is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-24-2020 , 12:42   Re: Sniper 3D Assassin Slow Motion final shot
Reply With Quote #5

This should be possible..

1. Catching prekilled, drop framerate to everyone and re-create the shot with fake-bullet, but camera behind it.

2. Woud be a bit more work, making it like a kill-cam system. Record everyplayer for 3-5secs (replace oldest with new data, ...) and make a replay of what happend in low framerate the killer and victim. And then create the fake-bullet, camera & put everyone's view to it.

Might do some tests myself when I have the time.

Grtz,
Xalus
__________________
Retired.
Xalus is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-28-2020 , 11:48   Re: Sniper 3D Assassin Slow Motion final shot
Reply With Quote #6

Glad there's some interest. Replay looks like Lud's camera missile. Attach_view(0, final_shot). Cone appears as TE_CYLINDER.
__________________

Last edited by DJEarthQuake; 11-27-2020 at 11:00.
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-21-2021 , 17:32   Re: Sniper 3D Assassin Slow Motion final shot
Reply With Quote #7

Pasted the code on how I did the animated snippet with lightening coming out of barrel as a tracer and included the URL on how to make this in Hammer. It can be translated into Amxx. Trigger camera, func_train, and path_corner is what is needed from what I can see. Will toy with it later.
__________________
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:49.


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