Raised This Month: $ Target: $400
 0% 

[Solved][Help] How to detect a player landing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 01-10-2014 , 23:27   Re: [Help] How to detect a player landing
Reply With Quote #4

Quote:
Originally Posted by hornet View Post
There doesn't seem to be a solid way to do this. The game engine detects landing on PostThink() so we have to do the same, unless the player incurs damage on the fall.

I suppose you could polish it up a little using a bitsum for alive checks, and unregister the forward where possible:

Code:
#include <amxmodx> #include <fakemeta> const XO_PLAYER     =   5; const m_flFallVelocity  =   251; public plugin_init() {     register_plugin( "Detect Landing", "0.0.1", "hornet" );     register_forward( FM_PlayerPostThink, "CBasePlayer_PostThink" ); } public CBasePlayer_PostThink( id ) {     if( is_user_alive( id ) )     {         static Float:flFallVelocity; flFallVelocity = get_pdata_float( id, m_flFallVelocity, XO_PLAYER );                 if( flFallVelocity && pev( id, pev_flags ) & FL_ONGROUND )         {             //PLAYER JUST LANDED         }     } }
Do you know that touch is called one time when player is landing?
.Dare Devil. 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 10:06.


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