AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   How to increase gravity for one player (https://forums.alliedmods.net/showthread.php?t=311582)

impossible_cc 10-24-2018 10:36

How to increase gravity for one player
 
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
        
}
    }
    



Facksy 10-24-2018 10:52

Re: How to increase gravity for one player
 
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);
        }
    }



impossible_cc 10-24-2018 15:23

Re: How to increase gravity for one player
 
Works perfectly, thanks


All times are GMT -4. The time now is 06:22.

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