AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Accelerating when Jump Upward (https://forums.alliedmods.net/showthread.php?t=83168)

Mlk27 01-05-2009 09:07

Accelerating when Jump Upward
 
how do you give high jump to players?

SnoW 01-05-2009 10:00

Re: Accelerating when Jump Upward
 
I'm not sure what are you talking about, but what I understood, I would do like this: (FM version ofc)
Code:

new Float:velocity[3];
 pev(index, pev_velocity, velocity);
 velocity[2] = 300.0;  //How high you want that player gets...
 set_pev(index, pev_velocity, velocity);

If you want to make it usable when player is already in air with speed, you should use:
Code:

velocity[2] += 300.0;

Mlk27 01-12-2009 19:38

Re: Accelerating when Jump Upward
 
err i mean when a player jumps vertically. so i hook FM_CmdStart and prethink?

Exolent[jNr] 01-12-2009 20:46

Re: Accelerating when Jump Upward
 
Do you just want a higher jump?

Mlk27 01-12-2009 20:56

Re: Accelerating when Jump Upward
 
yep

Exolent[jNr] 01-12-2009 21:17

Re: Accelerating when Jump Upward
 
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> new bool:g_do_jump[33]; public plugin_init() {     RegisterHam(Ham_Player_Jump, "player", "FwdPlayerJumpPre", 0);     RegisterHam(Ham_Player_Jump, "player", "FwdPlayerJumpPost", 1); } public FwdPlayerPre(client) {     if( !is_user_alive(client) ) return HAM_IGNORED;         g_do_jump[client] = bool:(pev(client, pev_flags) & FL_ONGROUND);         return HAM_HANDLED; } public FwdPlayerJumpPost(client) {     if( !g_do_jump[client] ) return HAM_IGNORED;         static Float:velocity[3];     pev(client, pev_velocity, velocity);         velocity[2] = 500.0;         set_pev(client, pev_velocity, velocity);         g_do_jump[client] = false;         return HAM_HANDLED; }

Mlk27 01-12-2009 21:44

Re: Accelerating when Jump Upward
 
nice it works but if players press and hold jump button or keep pressing jump while in air, they never fall on ground. lol

can you please make this works exactly like normal jump in cs, except that they can jump higher..?

Exolent[jNr] 01-12-2009 22:33

Re: Accelerating when Jump Upward
 
Try that.


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

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