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

How to increase gravity for one player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 10-24-2018 , 10:36   How to increase gravity for one player
Reply With Quote #1

Or just make player instantly fall. For example, player jumps then he presses IN_SPEED (when he is in air) and he should fall immideatly. Don't care about fall damage, it's okay if player will die because of it.

Game - csgo

SORRY FOR OLD SYNTAX

PHP Code:
public OnGameFrame()
{                        
    for (new 
1<= MaxClientsi++)
    {
                if (
IsClientInGame(i) && IsPlayerAlive(i)
        
g_bClientIsInAir[i] = !(GetEntityFlags(i) & FL_ONGROUND);
    }
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &iWeapon)
{
    if(
buttons IN_SPEED)
    {
        if(
g_bClientIsInAir[client])
        {
            
//Some code to make client fall or increase his gravity
        
}
    }
    


Last edited by impossible_cc; 10-24-2018 at 10:37.
impossible_cc is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 10-24-2018 , 10:52   Re: How to increase gravity for one player
Reply With Quote #2

PHP Code:
public OnGameFrame()
{                        
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i)
            
g_bClientIsInAir[i] = !(GetEntityFlags(i) & FL_ONGROUND);
    }
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &iWeapon)
{
    if(
buttons IN_SPEED)
    {
        if(
g_bClientIsInAir[client])
        {
            
float vVel[3];
            
GetEntPropVector(clientProp_Data"m_vecVelocity"vVel);
            
vVel[2] = -800.0;
            
TeleportEntity(clientNULL_VECTORNULL_VECTORvVel);
        }
    }

__________________
My Steam I take private requests if related with TF2
My Plugins
Facksy is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 10-24-2018 , 15:23   Re: How to increase gravity for one player
Reply With Quote #3

Works perfectly, thanks
impossible_cc is offline
Reply


Thread Tools
Display Modes

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 21:48.


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