Raised This Month: $ Target: $400
 0% 

How to check is player falling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-04-2014 , 19:53   Re: How to check is player falling
Reply With Quote #2

Quote:
Originally Posted by HamletEagle View Post
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
Quote:
Originally Posted by aron9forever View Post
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
As Jimaway said DMG_FALL. To use PostThink() for such a thing is a nightmare.
hornet 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