Okay so if the player touches worldspawn entity while sprinting, it stops the sprinting and creates a sprite, everything works fine but if player falls on ground, touches a small slope on ground or stairs like in de_dust2 it it counts as touching, any work around for this ?
Sprite code:
PHP Code:
if( equal( sz_classname, "worldspawn" ) && ( flags & FL_ONGROUND ) ) {
// effects of hitting //
static Float: stop_origin[ 3 ];
entity_get_vector( id, EV_VEC_origin, stop_origin );
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_BEAMCYLINDER );
engfunc( EngFunc_WriteCoord, stop_origin[ 0 ] );
engfunc( EngFunc_WriteCoord, stop_origin[ 1 ] );
engfunc( EngFunc_WriteCoord, stop_origin[ 2 ] );
engfunc( EngFunc_WriteCoord, stop_origin[ 0 ] );
engfunc( EngFunc_WriteCoord, stop_origin[ 1 ] );
engfunc( EngFunc_WriteCoord, stop_origin[ 2 ] + get_pcvar_float( g_cvars[ RADIUS ] ) * 2 );
write_short( explosion_spr );
write_byte( 0 );
write_byte( 0 );
write_byte( 5 );
write_byte( 20 );
write_byte( 5 );
write_byte( 211 );
write_byte( 197 );
write_byte( 180 );
write_byte( 150 );
write_byte( 0 );
message_end( );
// End run //
emit_sound( id, CHAN_BODY, g_hit, 1.0, ATTN_NORM, 0, PITCH_NORM );
fw_charger_sprint_end( id + TASK_SPRINT );
client_print( id, print_center, "Ent touched: %s || %d", sz_classname, victim );
}