Hello,
So FL_ONGROUND counts as standing on entity ? Is there a work around or check if player is standing on entity or on map ground ? I tried xPaws code:
PHP Code:
if( ( pev( id, pev_flags ) & FL_ONGROUND ) && pev( id, pev_groundentity ) == ent ) {
// player is on entity
}
But then touching the ground of the map is being also disabled. Or it would be better to somehow check if player touched an entity which is in front of him because what I am trying to do is to play a sprite when player touches anything but the ground, the problem is that if the player is standing on some specific entities on map the sprite plays immediately.
PHP Code:
public fw_touch( id, victim ) {
if( !g_player[ id][ ability_in_use ] )
return;
static sz_classname[ 32 ];
entity_get_string( victim, EV_SZ_classname, sz_classname, charsmax( sz_classname ) );
// 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_STREAM, g_hit, 1.0, ATTN_NORM, 0, PITCH_NORM );
fw_sprint_end( id + TASK_SPRINT );
}