PDA

View Full Version : DoD Follow The Wounded (v1.0)


diamond-optic
07-22-2006, 02:01 AM
DoD Follow The Wounded
- Version 1.0
- 05.20.2008
- dod port: diamond-optic
- original: KRoT@L

Credit:

- Original plugin by KRoT@L
- http://www.amxmodx.org/forums/viewtopic.php?t=17688
- Ported to DoD by diamond-optic
Information:

- When the health of a player goes below ftw_health,
the footsteps of this player will be covered with blood,
thus you can follow him.
CVARs:

ftw_active //Turn on(1)/off(0)
ftw_health //Health needs to be below this for effect
Known Problems:

- Sometime the footprints show up at wierd angles on the ground.
Version Info:

- 02.23.2006 Version 0.1
Initial DoD port release

- 07.09.2006 Version 0.2
Replaced ENGINE module with FAKEMETA
Removed AMXMISC module

- 05.20.2008 Version 1.0
Changed Public CVAR format
Replaced respawn hook with PStatus method
Removed dodx death & damage registers
Moved task id to a define
Added PCVARs
DOWNLOAD MIRROR: http://www.avamods.com/download.php?view.40

=|[76AD]|= TatsuSaisei
08-21-2006, 05:32 PM
Is it possible to change the color of the footsteps ?? I tried looking through the code, and compared it to other plugins that use code to color things, but I couldn't quite figure it out. I do not want to "ruin" the code by screwing around with aspects I do not know about yet, so maybe you can help me...

I just want to change the color of the footsteps to a dark red, instead of the "orange" color they are now. Something to match the color of the blood I know I have through the gore plugin.

I love your plugins, and about 90% of the plugins I run on my server are based off of most of the plugins found HERE !! You guys have done a wonderful job for the world of DOD, and I plan to help as much as I can along the way...

diamond-optic
08-21-2006, 06:42 PM
im not really sure theres any way to change the decal colors...

they might be set in the engine or somewhere i dont know.. becuase ive never been able to figure out how to change the color of a decal whether it be in amxx or adding it right to a map itself..

i would think there has got to be some way to do it tho, i just havent ever figured it out..

and it looks like a dark red to me.. but i might have diff brightness/gamma/contrast/color settings on my monitor or in my video settings

zak1212
09-28-2006, 04:11 PM
When i use this plugin i get arrows and boxes everywhere not footsteps when the im bleeding (client/server)

do i have to download a file to run with this model etc to get the footsteps to work

or have i overlooked something

regards

diamond-optic
09-28-2006, 05:45 PM
hmm it should work fine as the footprints are right from the decals.wad file in the dod gcf file..

have you put a new/custom/etc decals.wad file in your dod folder?

zak1212
10-16-2006, 10:10 AM
That fixed it.!

dotn know how that got changed but it works now

superb plugin many thanks

!TK!- Cold Blooded
11-09-2006, 05:35 AM
Hey I am very very new at this, so when it says "CVAR" do I need to add that to the CVAR file or what? And where would I put the JPEG image?

=|[76AD]|= TatsuSaisei
11-09-2006, 10:43 AM
Hey I am very very new at this, so when it says "CVAR" do I need to add that to the CVAR file or what? And where would I put the JPEG image?
LOL, what jpeg image ?? There is no jpeg file for this plugin !! The jpeg you found is just a screenshot preview of what the plugin does.

The CVAR on the other hand goes into a file called amxx.cfg which is found in:
dod/addons/amxmodx/configs/amxx.cfg

Open the file (with notepad/wordpad) and append the line to the bottom of the file, save, upload back to server, and enjoy...

!TK!- Cold Blooded
11-10-2006, 07:12 AM
|= TatsuSaisei;2176']LOL, what jpeg image ?? There is no jpeg file for this plugin !! The jpeg you found is just a screenshot preview of what the plugin does.

The CVAR on the other hand goes into a file called amxx.cfg which is found in:
dod/addons/amxmodx/configs/amxx.cfg

Open the file (with notepad/wordpad) and append the line to the bottom of the file, save, upload back to server, and enjoy...

HAHAHA holy crumb! Told you I was a newb! I was going crazy trying to figure out where the heck that goes. Thanks a bunch!!!

diamond-optic
07-27-2008, 08:25 PM
updated to v1.0


- 05.20.2008 Version 1.0
Changed Public CVAR format
Replaced respawn hook with PStatus method
Removed dodx death & damage registers
Moved task id to a define
Added PCVARs

Agente
06-16-2010, 12:25 PM
Is there any way to change the time that the footprints are on the ground

diamond-optic
06-16-2010, 07:14 PM
i believe the only thing you can do for that is to have each client increase their r_decals value (which allows them to have more decals at once which will make the footsteps not disappear as fast)

danniboy90
10-14-2011, 11:56 PM
hey,

if you use a medic plugin or something that make you gain health,
you probably want the plugin to check if the health exceeds pcvar(p_health).

you can do this by replacing the "make_footsteps(param[])" function with this.


public make_footsteps( param[] )
{
new id = param[0];

if ( get_user_health( id ) > get_pcvar_num( p_health ) || !is_user_alive( id ) || !is_user_connected( id ) )
{
if( task_exists( TASK_ID + id ) )
{
remove_task( TASK_ID + id );
}
g_isDying[id] = false;
return;
}

if ( !get_pcvar_num( p_active ) || get_user_speed( id ) < 120 )
{
return;
}

new origin[3];

get_user_origin( id,origin );

if( pev( id, pev_bInDuck ) == 1 )
{
origin[2] -= 18;
}
else
{
origin[2] -= 36;
}

new Float:velocity[3], ent_angles[3], ent_origin[3];

new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );

pev( id, pev_v_angle,ent_angles );
pev( id, pev_origin,ent_origin );

if( ent > 0 )
{
ent_angles[0] = 0; //tried changing to 180

if(g_decalSwitch[id] == 0)
{
ent_angles[1] -= 90;
}
else
{
ent_angles[1] += 90;
}

set_pev( ent, pev_origin, ent_origin );
set_pev( ent, pev_v_angle, ent_angles );
velocity_by_aim( ent, 12, velocity );

engfunc( EngFunc_RemoveEntity, ent );
}

message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
write_byte( 116 );
write_coord( origin[0] + floatround( velocity[0] ) );
write_coord( origin[1] + floatround( velocity[1] ) );
write_coord( origin[2] );
write_byte( decals[g_decalSwitch[id]] );
message_end();

g_decalSwitch[id] = 1 - g_decalSwitch[id];

return;
}

it also removed the "Tag mismatch" error from ent_angles[0].

But if you want this plus a neat and nice coding and a few small changes,
then you can just replace it all:


//////////////////////////////////////////////////////////////////////////////////
//
// DoD Follow The Wounded
// - Version 1.0
// - 05.20.2008
// - dod port: diamond-optic
// - original: KRoT@L
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
// - When the health of a player goes below ftw_health,
// the footsteps of this player will be covered with blood,
// thus you can follow him.
//
// CVARs:
//
// ftw_active //Turn on(1)/off(0)
// ftw_health //Health needs to be below this for effect
//
// Credits:
//
// - Original plugin by KRoT@L
// - http://www.amxmodx.org/forums/viewtopic.php?t=17688
// - Ported to DoD by diamond-optic
//
// Known Problems:
//
// - Sometime the footprints show up at wierd angles on the ground.
//
// Changelog:
//
// - 02.23.2006 Version 0.1
// Initial DoD port release
//
// - 07.09.2006 Version 0.2
// Replaced ENGINE module with FAKEMETA
// Removed AMXMISC module
//
// - 05.20.2008 Version 1.0
// Changed Public CVAR format
// Replaced respawn hook with PStatus method
// Removed dodx death & damage registers
// Moved task id to a define
// Added PCVARs
//
// - 10.15.2011 Version 1.1 - by [R]eTaRD
// Optimized code for reading
// Make_footsteps now checks if players health exceeds the pcvar(p_health)
// Changed ent_angles[0] to 0 instead of 0.0 and removed error Tag Mismatch
// Checks if user is connected
//
//////////////////////////////////////////////////////////////////////////////////

#include <amxmodx>
#include <fakemeta>
#include <dodx>

#define VERSION "1.1"
#define SVERSION "v1.1 - by diamond-optic (www.AvaMods.com) and [R]eTaRD"

#define TASK_ID 424754

new decals[2] = {120,121};

new bool:g_isDying[33];
new g_decalSwitch[33];

new p_active,p_health;

public plugin_init()
{
register_plugin("DoD Follow the Wounded",VERSION,"AMXX DoD Team & KRoTaL & [R]eTaRD");
register_cvar("dod_follow_the_wounded_stats",SVERSION,FCVAR_SERVER|FCVAR_SPONLY);

p_active = register_cvar( "ftw_active", "1" );
p_health = register_cvar( "ftw_health", "5" );

//Temp fix for spawning
register_message( get_user_msgid( "PStatus" ), "msg_PStatus" );
}

////////////////////////////////////////////////////
// Temp fix for spawn hook
//
public msg_PStatus( msgid, msgdest, id )
{
if( msgdest == 2 && !id )
{
new player = get_msg_arg_int( 1 );
new status = get_msg_arg_int( 2 );

if( is_user_connected( player ) && status == 0 )
{
set_task( Float:0.1, "player_spawn", player );
}
}
}

public client_connect( id )
{
if( g_isDying[id] )
{
g_isDying[id] = false;

if( task_exists( TASK_ID + id ) )
{
remove_task( TASK_ID + id );
}
}
}

public player_spawn( id )
{
if( g_isDying[id] )
{
g_isDying[id] = false;

if( task_exists( TASK_ID + id ) )
{
remove_task( TASK_ID + id );
}
}
}

public make_footsteps( param[] )
{
new id = param[0];

if ( get_user_health( id ) > get_pcvar_num( p_health ) || !is_user_alive( id ) || !is_user_connected( id ) )
{
if( task_exists( TASK_ID + id ) )
{
remove_task( TASK_ID + id );
}
g_isDying[id] = false;
return;
}

if ( !get_pcvar_num( p_active ) || get_user_speed( id ) < 120 )
{
return;
}

new origin[3];

get_user_origin( id,origin );

if( pev( id, pev_bInDuck ) == 1 )
{
origin[2] -= 18;
}
else
{
origin[2] -= 36;
}

new Float:velocity[3], ent_angles[3], ent_origin[3];

new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );

pev( id, pev_v_angle,ent_angles );
pev( id, pev_origin,ent_origin );

if( ent > 0 )
{
ent_angles[0] = 0; //tried changing to 180

if(g_decalSwitch[id] == 0)
{
ent_angles[1] -= 90;
}
else
{
ent_angles[1] += 90;
}

set_pev( ent, pev_origin, ent_origin );
set_pev( ent, pev_v_angle, ent_angles );
velocity_by_aim( ent, 12, velocity );

engfunc( EngFunc_RemoveEntity, ent );
}

message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
write_byte( 116 );
write_coord( origin[0] + floatround( velocity[0] ) );
write_coord( origin[1] + floatround( velocity[1] ) );
write_coord( origin[2] );
write_byte( decals[g_decalSwitch[id]] );
message_end();

g_decalSwitch[id] = 1 - g_decalSwitch[id];

return;
}

public client_damage( attacker, victim, damage, wpnindex, hitplace, TA )
{
if( !get_pcvar_num( p_active ) || !is_user_alive( victim ) )
{
return PLUGIN_CONTINUE;
}

if( !g_isDying[victim] && get_user_health( victim ) <= get_pcvar_num( p_health ) )
{
g_isDying[victim] = true;
g_decalSwitch[victim] = 0;

new param[1];
param[0] = victim;

set_task( 0.2, "make_footsteps", TASK_ID + victim, param, 1, "b" );
}

return PLUGIN_CONTINUE;
}

public client_death( killer, victim, wpnindex, hitplace, TK )
{
if( g_isDying[victim] )
{
g_isDying[victim] = false;

if( task_exists( TASK_ID + victim ) )
{
remove_task( TASK_ID + victim );
}
}
}

stock get_user_speed( id ) //stock from fakemeta_util by VEN
{
new Float:Vel[3];
pev( id, pev_velocity, Vel );

return floatround( vector_length( Vel ) );
}



:)