Raised This Month: $32 Target: $400
 8% 

Human & Zombie Gravity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-30-2021 , 07:43   Human & Zombie Gravity
Reply With Quote #1

Hi guys i want
for Human (CT) Gravity : sv_gravity 570
For Zombie Gravity : sv_gravity 550



Any one ?
Thanks
SHIFT0 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-30-2021 , 19:28   Re: Human & Zombie Gravity
Reply With Quote #2

PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
// #include <amxmisc>
// #include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
#include <fun>
// #include <xs>
// #include <sqlx>

#if AMXX_VERSION_NUM < 183
    
const MAX_PLAYERS 32;
#endif

#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

new pZombieGravitypHumanGravity;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_logevent("roundStart"2"1=Round_Start");

    
pZombieGravity register_cvar("zm_zombiegravity""550");
    
pHumanGravity register_cvar("zm_humangravity""570");
}

public 
roundStart()
{
    new 
iPlayers[MAX_PLAYERS], iCountiIndex;
    
get_players(iPlayersiCount"che""CT");

    new 
Float:fOriginalGravity 800.0;

    if(
iCount)
    {
        new 
Float:fHumanGravity get_pcvar_float(pHumanGravity) / fOriginalGravity;

        for(new 
iiCounti++)
        {
            
iIndex iPlayers[i];

            if(
is_user_alive(iIndex))
            {
                
set_user_gravity(iIndexfHumanGravity);
            }
        }
    }

    
get_players(iPlayersiCount"che""TERRORIST");

    if(
iCount)
    {
        new 
Float:fZombieGravity get_pcvar_float(pZombieGravity) / fOriginalGravity;

        for(new 
iiCounti++)
        {
            
iIndex iPlayers[i];

            if(
is_user_alive(iIndex))
            {
                
set_user_gravity(iIndexfZombieGravity);
            }
        }
    }

__________________

Last edited by Napoleon_be; 12-01-2021 at 07:37.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-01-2021 , 06:02   Re: Human & Zombie Gravity
Reply With Quote #3

Thanks Bro !
Worked
SHIFT0 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-02-2021 , 09:52   Re: Human & Zombie Gravity
Reply With Quote #4

I should make "fOiginalGravity" global so that it only gets created once, instead of every round start, but that's honestly no big deal for this simple plugin.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-02-2021 , 15:49   Re: Human & Zombie Gravity
Reply With Quote #5

Or define it as "static const".
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 22:20.


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