Raised This Month: $ Target: $400
 0% 

How to check is player falling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Decak
Senior Member
Join Date: Sep 2012
Old 10-03-2014 , 10:10   How to check is player falling
Reply With Quote #1

Hello.I have a 1 simple question.How to check if a player falling while he jumping?? Example:
I jumped , and now, I'm going up, and then, I start falling. I need time while player falling , if someone know how to check is player falling, please, help Goodbye.
Decak is offline
Kuma77
Senior Member
Join Date: Sep 2014
Location: Behind PC
Old 10-03-2014 , 10:50   Re: How to check is player falling
Reply With Quote #2

sorry i was know how to get speed falling i mean ( when player fall down what is his speed .. ! ) but i forget that 'couse was'nt my code , so thats mean this guys can help you
__________________
SPACE TIME
Kuma77 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-03-2014 , 11:54   Re: How to check is player falling
Reply With Quote #3

Check if
PHP Code:
new FloatfFallVelocity;
pev(indexpev_flFallVelocityfFallVelocity); 
is greater than 0.0. Or, you could use the code below
PHP Code:
new FloatfVelocity[3];
pev(indexpev_velocityfVelocity); 
then check if fVelocity[2] is lesser than 0.0.
klippy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-03-2014 , 11:56   Re: How to check is player falling
Reply With Quote #4

If you only need the time, you may try this:
1. Hook Ham_Jump and cache get_gametime value.
2. Enable a touch forward between the player and the worldspawn.
3. In the Ham forward above check if the player is on ground( FL_ONGROUND ), then use get_gametime again.
4. Disable the Ham_Touch forward.
5. The time while the player was in the air is the difference between them.

I don't quite understood what you want, but you may also check m_flFallVelocity offset.
__________________

Last edited by HamletEagle; 10-03-2014 at 11:57.
HamletEagle is offline
Decak
Senior Member
Join Date: Sep 2012
Old 10-03-2014 , 12:43   Re: How to check is player falling
Reply With Quote #5

Thanks you gays, a pogotovo tebi klippy bog ti pomogo hahah
Decak is offline
Strick3n
Member
Join Date: Apr 2013
Old 10-03-2014 , 16:17   Re: How to check is player falling
Reply With Quote #6

Quote:
Originally Posted by Decak View Post
Thanks you gays, a pogotovo tebi klippy bog ti pomogo hahah
hahahahaha
__________________
Strick3n is offline
Strick3n
Member
Join Date: Apr 2013
Old 10-03-2014 , 16:28   Re: How to check is player falling
Reply With Quote #7

you can check v3x's plugin
https://forums.alliedmods.net/showthread.php?t=23824
__________________
Strick3n is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-03-2014 , 23:55   Re: How to check is player falling
Reply With Quote #8

Quote:
Originally Posted by Strick3n View Post
Don't use that plugin for this - it's old, and it's very inefficient + badly coded.
hornet is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-04-2014 , 09:41   Re: How to check is player falling
Reply With Quote #9

Quote:
Originally Posted by hornet View Post
Don't use that plugin for this - it's old, and it's very inefficient + badly coded.
What you would suggest as an alternative ? I'm thinking of hooking TakeDamage, checking if player is falling and setting the damage to 0.0
__________________

Last edited by HamletEagle; 10-04-2014 at 09:42.
HamletEagle is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 10-04-2014 , 12:55   Re: How to check is player falling
Reply With Quote #10

PHP Code:
public client_PreThink(id)
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE
    
    
if(entity_get_float(idEV_FL_flFallVelocity) >= FALL_VELOCITY) {
      
falling[id] = true;
    } 
    else {
      
falling[id] = false;
    }
    
    return 
PLUGIN_CONTINUE
}

#define FALL_VELOCITY 350.0 
only workz on 800grav srv
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Reply



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 17:41.


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