AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Jump Height Modifier (https://forums.alliedmods.net/showthread.php?t=196276)

striker07 09-17-2012 20:13

Jump Height Modifier
 
I just meshed up this lil code to increase the players jump height when he jumps,
I was wondering if this would work (cant test it myself for the moment).
(raising the players jump height with lowering the gravity for him is not an option.)
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
 
#define PLUGIN "Jump height modifier"
#define VERSION "0.0.1"
#define AUTHOR "striker07"
 
public plugin_init()
{
     
register_plugin(PLUGINVERSIONAUTHOR);
 
     
RegisterHam(Ham_Player_Jump"player""fwdPlayerJump");
}
public 
fwdPlayerJump(id)
{
     if(!(
pev(idpev_flags) & FL_ONGROUND))
     {
          static 
Float:velocity[3];
          
pev(idpev_velocityvelocity);
 
          
velocity[2] = velocity[2] * (0.1 levelvariable)
 
          
set_pev(idpev_velocityvelocity)
     }



Bugsy 09-18-2012 20:38

Re: Jump Height Modifier
 
You have the right idea by increasing velocity. Your code will need more work, though.

jimaway 09-19-2012 02:23

Re: Jump Height Modifier
 
velocity[2] = velocity[2] * (0.1 * levelvariable)
that will actually decrease the jump height if levelvariable < 10 :D

striker07 09-19-2012 10:56

Re: Jump Height Modifier
 
Quote:

Originally Posted by Bugsy (Post 1802145)
You have the right idea by increasing velocity. Your code will need more work, though.

Ok thanks,
and its been a while since i've seen you, sup? :)

Quote:

Originally Posted by jimaway (Post 1802217)
velocity[2] = velocity[2] * (0.1 * levelvariable)
that will actually decrease the jump height if levelvariable < 10 :D

yes i noticed yesterday wen i made some extra stuff for it :).
did the first test yesterday too and i noticed that when you jump once, by the time you press the jump button again while still going upward from previous jump, the velocity is already set as a downard velocity ^^ so i just killed myself when i jumped and jump again :wink:
pretty strange physics :)

Bugsy 09-19-2012 21:38

Re: Jump Height Modifier
 
Quote:

Originally Posted by striker07 (Post 1802370)
Ok thanks,
and its been a while since i've seen you, sup? :)

Chillin, busy with life, don't have as much free time as I used to.

striker07 09-21-2012 06:51

Re: Jump Height Modifier
 
Quote:

Originally Posted by Bugsy (Post 1802621)
Chillin, busy with life, don't have as much free time as I used to.

ah i see, to bad you are a great coder ^^

anyway to get back to the topic, this is what i have now, (it's going to be an rpgx upgrade)

The jumps height are not modified, when i used client_prints to debug none of the prints came up so i think its not working, as how it is coded now only the jumps after the first jumps should increase the jump height, but i dont think its working and the first jump should aslo be modified, any help?

tryed with fakemeta, didnt work now with engine and it still doesnt work :s

http://pastebin.com/YCMEp8ft


All times are GMT -4. The time now is 08:12.

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