AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HIGH JUMP (https://forums.alliedmods.net/showthread.php?t=293689)

ish12321 02-07-2017 07:34

HIGH JUMP
 
How to properly set player's gravity to different
I want to use it in my adrenaline plugin
provide player high gravity until his adrenaline drains
then revert back his gravity

please an example to help?

OciXCrom 02-07-2017 07:38

Re: HIGH JUMP
 
set_user_gravity???

ish12321 02-07-2017 07:45

Re: HIGH JUMP
 
I mean if the gravity reset on weapon change ?

klippy 02-07-2017 07:51

Re: HIGH JUMP
 
You obviously didn't even try before you asked. Test it yourself.

ish12321 02-07-2017 08:21

Re: HIGH JUMP
 
Please someone tell ...........>.<

OciXCrom 02-07-2017 08:31

Re: HIGH JUMP
 
This is the SCRIPTING section, so either try yourself and ask question a when you give us the code you tried, or don't ask at all.

HamletEagle 02-07-2017 09:12

Re: HIGH JUMP
 
Quote:

Originally Posted by ish12321 (Post 2493631)
Please someone tell ...........>.<

You won't learn anything if you are lazy. Test your plugin and see, for God sake.

edon1337 02-07-2017 10:01

Re: HIGH JUMP
 
Gravity doesn't change on Weapon Switch.
PHP Code:

#include <amxmodx>
#include <engine>
#include <hamsandwich>

#define PLUGIN "Gravity"
#define VERSION "1.0"
#define AUTHOR "DoNii"

#define GRAVITY 0.8

new bool:g_HasGravity[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /unsetgravity""set_player_gravity_default")
    
    
RegisterHam(Ham_Spawn"player""fw_HamSpawnPost"1)
}

public 
fw_HamSpawnPost(id) {
    
    if(!
g_HasGravity[id]) {
        
        
entity_set_float(idEV_FL_gravityGRAVITY)
        
g_HasGravity[id] = 1
    
}
}

public 
set_player_gravity_default(id) {
    
    
entity_set_float(idEV_FL_gravity1.0)
    
g_HasGravity[id] = 0



ish12321 02-07-2017 10:36

Re: HIGH JUMP
 
thanks for your help
But not being rude but as friends I'll like to suggest use bool for g_HasGravity

edon1337 02-07-2017 12:29

Re: HIGH JUMP
 
It was actually meant to be a bool, idk how I forgot that, anyways doing it the way it was is ok too.


All times are GMT -4. The time now is 21:01.

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