Raised This Month: $ Target: $400
 0% 

Solved FL_ONGROUND counts standing on entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TBagT
Member
Join Date: Aug 2016
Location: Lithuania
Old 06-26-2017 , 03:56   FL_ONGROUND counts standing on entity
Reply With Quote #1

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( ( pevidpev_flags ) & FL_ONGROUND ) && pevidpev_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_touchidvictim ) {
        if( !
g_playerid][ ability_in_use ] )
                return;

        static 
sz_classname32 ];
        
entity_get_stringvictimEV_SZ_classnamesz_classnamecharsmaxsz_classname ) );

        
// effects of hitting //
        
static Floatstop_origin];
        
entity_get_vectoridEV_VEC_originstop_origin );

        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byteTE_BEAMCYLINDER );
        
engfuncEngFunc_WriteCoordstop_origin] );
        
engfuncEngFunc_WriteCoordstop_origin] );
        
engfuncEngFunc_WriteCoordstop_origin] );
        
engfuncEngFunc_WriteCoordstop_origin] );
        
engfuncEngFunc_WriteCoordstop_origin] );
        
engfuncEngFunc_WriteCoordstop_origin] + get_pcvar_floatg_cvarsRADIUS ] ) * );
        
write_shortexplosion_spr );
        
write_byte);
        
write_byte);
        
write_byte);
        
write_byte20 );
        
write_byte);
        
write_byte211 );
        
write_byte197 );
        
write_byte180 );
        
write_byte150 );
        
write_byte);
        
message_end( );

        
// End run //
        
emit_soundidCHAN_STREAMg_hit1.0ATTN_NORM0PITCH_NORM );
        
fw_sprint_endid TASK_SPRINT );


Last edited by TBagT; 06-26-2017 at 15:34.
TBagT is offline
 



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 23:06.


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