Raised This Month: $51 Target: $400
 12% 

How to check if player is falling [CS:GO]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jcrr
Senior Member
Join Date: Jul 2015
Old 08-03-2015 , 14:24   How to check if player is falling [CS:GO]
Reply With Quote #1

Hello, anyone know how can i check if player is falling + have more velocity than normal jump?
I want to do somthing like this

Action: player is falling (fall with DMG)
{
Do somthing when touch ground
}

Thanks in advance ;)

Last edited by Jcrr; 08-03-2015 at 14:24.
Jcrr is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-03-2015 , 14:27   Re: How to check if player is falling [CS:GO]
Reply With Quote #2

You can use FL_ONGROUND And create your timer and check how much time he isnt on ground cause it may 1.0 seconds for simple step that doesn't damage..
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-03-2015 , 15:40   Re: How to check if player is falling [CS:GO]
Reply With Quote #3

...are you looking "no fall damage" ?
No Fall Damage
Bacardi is offline
Jcrr
Senior Member
Join Date: Jul 2015
Old 08-03-2015 , 16:35   Re: How to check if player is falling [CS:GO]
Reply With Quote #4

No, i want to change variable, when player will fall and damage self (even 1hp)
Jcrr is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 08-03-2015 , 17:07   Re: How to check if player is falling [CS:GO]
Reply With Quote #5

The method there still works, a TakeDamage hook checking for DMG_FALL
Miu is offline
Jcrr
Senior Member
Join Date: Jul 2015
Old 08-04-2015 , 15:30   Re: How to check if player is falling [CS:GO]
Reply With Quote #6

Somthing like this?
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_falldamage"OnFallDamageEventHookMode_Pre);
}

public 
Action:OnFallDamage(Handle:event, const String:name[], bool:dontBroadcast)
{
    Do 
code here

Jcrr is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 08-04-2015 , 18:09   Re: How to check if player is falling [CS:GO]
Reply With Quote #7

No, he meant the method used for the No Fall Damage plugin that was linked to earlier.
Marcus_Brown001 is offline
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 08-06-2015 , 19:47   Re: How to check if player is falling [CS:GO]
Reply With Quote #8

If you just want to use a looping timer to check if a player is mid-air (hence, falling), you can just do this:
Code:
public Action CheckPlayerFallStatus(Handle timer, any userid)
{
    int client = GetClientOfUserId(userid);
    if(!client || client>MaxClients)
       return Plugin_Stop;

    if(!IsClientInGame(client))
       return Plugin_Stop;

    if(GetEntityFlags(client) & FL_ONGROUND) // Player is not mid-air
       return Plugin_Stop;

    // Action you want to do here
    return Plugin_Continue;
}
If you just want to change the fall damage a player receives, then hook OnTakeDamage:
Code:
public Action OnTakeDamage(int client, int &attacker, int &inflictor, float &damage, int &damagetype)
{
    if(!client || client>MaxClients)
       return Plugin_Continue;

    if(!IsClientInGame(client))
       return Plugin_Continue;

    if(damagetype & DMG_FALL)
    {
       damage=<new value here (float)>;
       return Plugin_Changed;
    }
    return Plugin_Continue;
}
__________________

Last edited by 93SHADoW; 08-06-2015 at 19:59.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
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 12:00.


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