hey,nnif you use a medic plugin or something that make you gain health,nyou probably want the plugin to check if the health exceeds pcvar(p_health).nnyou can do this by replacing the "make_footsteps(param[])" function with this.nn
npublic make_footsteps( param[] )n{n new id = param[0];n n if ( get_user_health( id ) > get_pcvar_num( p_health ) || !is_user_alive( id ) || !is_user_connected( id ) )n {n if( task_exists( TASK_ID + id ) )n {n remove_task( TASK_ID + id );n }n g_isDying[id] = false;n return;n }n n if ( !get_pcvar_num( p_active ) || get_user_speed( id ) < 120 )n {n return;n }nn new origin[3];n n get_user_origin( id,origin );n n if( pev( id, pev_bInDuck ) == 1 )n {n origin[2] -= 18;n }n elsen {n origin[2] -= 36;n }n n new Float:velocity[3], ent_angles[3], ent_origin[3];n n new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );nn pev( id, pev_v_angle,ent_angles );n pev( id, pev_origin,ent_origin );nn if( ent > 0 )n {n ent_angles[0] = 0; //tried changing to 180n n if(g_decalSwitch[id] == 0)n {n ent_angles[1] -= 90;n }n elsen {n ent_angles[1] += 90;n }n n set_pev( ent, pev_origin, ent_origin );n set_pev( ent, pev_v_angle, ent_angles );n velocity_by_aim( ent, 12, velocity );nn engfunc( EngFunc_RemoveEntity, ent );n }n n message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );n write_byte( 116 );n write_coord( origin[0] + floatround( velocity[0] ) );n write_coord( origin[1] + floatround( velocity[1] ) );n write_coord( origin[2] );n write_byte( decals[g_decalSwitch[id]] );n message_end();n n g_decalSwitch[id] = 1 - g_decalSwitch[id];n n return;n}n
nit also removed the "Tag mismatch" error from ent_angles[0].nnBut if you want this plus a neat and nice coding and a few small changes,nthen you can just replace it all:nn
n//////////////////////////////////////////////////////////////////////////////////n//n// DoD Follow The Woundedn// - Version 1.0n// - 05.20.2008n// - dod port: diamond-opticn// - original: KRoT@Ln//n//////////////////////////////////////////////////////////////////////////////////n//n// Information:n//n// - When the health of a player goes below ftw_health,n// the footsteps of this player will be covered with blood,n// thus you can follow him.n//n// CVARs:n//n// ftw_active //Turn on(1)/off(0)n// ftw_health //Health needs to be below this for effectn//n// Credits:n//n// - Original plugin by KRoT@Ln// - http://www.amxmodx.org/forums/viewtopic.php?t=17688n// - Ported to DoD by diamond-opticn//n// Known Problems:n//n// - Sometime the footprints show up at wierd angles on the ground.n//n// Changelog:n//n// - 02.23.2006 Version 0.1n// Initial DoD port releasen//n// - 07.09.2006 Version 0.2n// Replaced ENGINE module with FAKEMETAn// Removed AMXMISC modulen//n// - 05.20.2008 Version 1.0n// Changed Public CVAR formatn// Replaced respawn hook with PStatus methodn// Removed dodx death & damage registersn// Moved task id to a definen// Added PCVARsn//n// - 10.15.2011 Version 1.1 - by [R]eTaRDn// Optimized code for readingn// Make_footsteps now checks if players health exceeds the pcvar(p_health)n// Changed ent_angles[0] to 0 instead of 0.0 and removed error Tag Mismatchn// Checks if user is connectedn//n//////////////////////////////////////////////////////////////////////////////////nn#include <amxmodx>n#include <fakemeta>n#include <dodx>nn#define VERSION "1.1"n#define SVERSION "v1.1 - by diamond-optic (www.AvaMods.com) and [R]eTaRD"nn#define TASK_ID 424754nnnew decals[2] = {120,121};nnnew bool:g_isDying[33];nnew g_decalSwitch[33];nnnew p_active,p_health;nnpublic plugin_init()n{n register_plugin("DoD Follow the Wounded",VERSION,"AMXX DoD Team & KRoTaL & [R]eTaRD");n register_cvar("dod_follow_the_wounded_stats",SVERSION,FCVAR_SERVER|FCVAR_SPONLY);nn p_active = register_cvar( "ftw_active", "1" );n p_health = register_cvar( "ftw_health", "5" );nn //Temp fix for spawningn register_message( get_user_msgid( "PStatus" ), "msg_PStatus" );n}nn////////////////////////////////////////////////////n// Temp fix for spawn hookn//npublic msg_PStatus( msgid, msgdest, id )n{n if( msgdest == 2 && !id )n {n new player = get_msg_arg_int( 1 );n new status = get_msg_arg_int( 2 );n n if( is_user_connected( player ) && status == 0 )n {n set_task( Float:0.1, "player_spawn", player );n }n }n}nnpublic client_connect( id )n{n if( g_isDying[id] )n {n g_isDying[id] = false;n n if( task_exists( TASK_ID + id ) )n {n remove_task( TASK_ID + id );n }n }n}nnpublic player_spawn( id )n{n if( g_isDying[id] )n {n g_isDying[id] = false;n n if( task_exists( TASK_ID + id ) )n {n remove_task( TASK_ID + id );n }n }n}nnpublic make_footsteps( param[] )n{n new id = param[0];n n if ( get_user_health( id ) > get_pcvar_num( p_health ) || !is_user_alive( id ) || !is_user_connected( id ) )n {n if( task_exists( TASK_ID + id ) )n {n remove_task( TASK_ID + id );n }n g_isDying[id] = false;n return;n }n n if ( !get_pcvar_num( p_active ) || get_user_speed( id ) < 120 )n {n return;n }nn new origin[3];n n get_user_origin( id,origin );n n if( pev( id, pev_bInDuck ) == 1 )n {n origin[2] -= 18;n }n elsen {n origin[2] -= 36;n }n n new Float:velocity[3], ent_angles[3], ent_origin[3];n n new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );nn pev( id, pev_v_angle,ent_angles );n pev( id, pev_origin,ent_origin );nn if( ent > 0 )n {n ent_angles[0] = 0; //tried changing to 180n n if(g_decalSwitch[id] == 0)n {n ent_angles[1] -= 90;n }n elsen {n ent_angles[1] += 90;n }n n set_pev( ent, pev_origin, ent_origin );n set_pev( ent, pev_v_angle, ent_angles );n velocity_by_aim( ent, 12, velocity );nn engfunc( EngFunc_RemoveEntity, ent );n }n n message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );n write_byte( 116 );n write_coord( origin[0] + floatround( velocity[0] ) );n write_coord( origin[1] + floatround( velocity[1] ) );n write_coord( origin[2] );n write_byte( decals[g_decalSwitch[id]] );n message_end();n n g_decalSwitch[id] = 1 - g_decalSwitch[id];n n return;n}nnpublic client_damage( attacker, victim, damage, wpnindex, hitplace, TA )n{n if( !get_pcvar_num( p_active ) || !is_user_alive( victim ) )n {n return PLUGIN_CONTINUE;n }nn if( !g_isDying[victim] && get_user_health( victim ) <= get_pcvar_num( p_health ) )n {n g_isDying[victim] = true;n g_decalSwitch[victim] = 0;n n new param[1];n param[0] = victim;n n set_task( 0.2, "make_footsteps", TASK_ID + victim, param, 1, "b" );n }n n return PLUGIN_CONTINUE;n}nnpublic client_death( killer, victim, wpnindex, hitplace, TK )n{n if( g_isDying[victim] )n {n g_isDying[victim] = false;n n if( task_exists( TASK_ID + victim ) )n {n remove_task( TASK_ID + victim );n }n }n}nnstock get_user_speed( id ) //stock from fakemeta_util by VENn{ n new Float:Vel[3];n pev( id, pev_velocity, Vel );nn return floatround( vector_length( Vel ) );n}n
nnn:)