Raised This Month: $ Target: $400
 0% 

Quick Jump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spider853
Senior Member
Join Date: Jul 2006
Old 12-30-2006 , 04:31   Quick Jump
Reply With Quote #1

I Want To Make A Function That Make The Player Jump Higher But Not Slowly Like Gravity....
Can Somebody Helpme?
spider853 is offline
Send a message via ICQ to spider853
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-30-2006 , 15:04   Re: Quick Jump
Reply With Quote #2

Hook when a player jumps. You could do it like so:

Code:
public fw_playerprethink(id) // FM_PlayerPreThink hook {     if((pev(id,pev_button) & IN_JUMP) && !(pev(id,pev_oldbuttons) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))     {         // PLAYER JUMPED     } }

Make sure you hook FM_PlayerPreThink to that function (or, if using engine, make that function client_PreThink). It checks if they just pressed the jump button, and if they are on the ground. These are pretty much the conditions for a jump.

Then, you will want to grab their current velocity, change it's Z value (dimenson "2") to whatever you want (-1000?), and then set their velocity to that new value.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
spider853
Senior Member
Join Date: Jul 2006
Old 12-30-2006 , 18:08   Re: Quick Jump
Reply With Quote #3

But If I Change The Z Value They Can Stuck In The Ground...

If I Can Get The Vector ... And If Its Up Then Put The Gravity in - Else + and Make The Player Immune To Ground Hit

Last edited by spider853; 12-30-2006 at 18:10.
spider853 is offline
Send a message via ICQ to spider853
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-30-2006 , 18:52   Re: Quick Jump
Reply With Quote #4

Don't change their origin, only their velocity.

Code:
new Float:velocity[3]; pev(id,pev_velcoity,velocity); velocity[2] = -1000.0; set_pev(id,pev_velocity,velocity);

This should make them shoot upwards, still obeying the laws of HL physics (they'll stop if they hit something, and will eventually fall back down).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-31-2006 , 01:07   Re: Quick Jump
Reply With Quote #5

And why negative Z-velocity value? :-/
VEN is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-31-2006 , 01:19   Re: Quick Jump
Reply With Quote #6

Because I forgot which way was up.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-31-2006 , 03:27   Re: Quick Jump
Reply With Quote #7

I see, up is positive for Z-velocity.
VEN is offline
spider853
Senior Member
Join Date: Jul 2006
Old 12-31-2006 , 08:08   Re: Quick Jump
Reply With Quote #8

OK SO I Need FakeMeta And Engine?

Last edited by spider853; 12-31-2006 at 08:15.
spider853 is offline
Send a message via ICQ to spider853
spider853
Senior Member
Join Date: Jul 2006
Old 12-31-2006 , 08:27   Re: Quick Jump
Reply With Quote #9

I MADE'it... WE Made'it.. It Jump...
Now i know how to make the bunnyjump
velocity[0]*=1.2
velocity[1]*=1.2

but now i need to Make The Player Immune To Ground Hit



Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fakemeta> //#include <fakemeta_util> #include <engine>   #define PLUGIN "Spider" #define VERSION "1.0" #define AUTHOR "JumpMod"   public plugin_init() {  register_plugin(PLUGIN, VERSION, AUTHOR)  register_forward(FM_PlayerPreThink,"pref",0)  // Add your code here... } public pref(id) {  if((pev(id,pev_button) & IN_JUMP) && !(pev(id,pev_oldbuttons) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))     {         new Float:velocity[3];  pev(id,pev_velocity,velocity);  velocity[0]*=1.5  velocity[1]*=1.5  velocity[2] = 500.0;    set_pev(id,pev_velocity,velocity);     } }

Last edited by spider853; 12-31-2006 at 08:34.
spider853 is offline
Send a message via ICQ to spider853
VEN
Veteran Member
Join Date: Jan 2005
Old 12-31-2006 , 09:37   Re: Quick Jump
Reply With Quote #10

For example:
Code:
#include <amxmodx> #include <fakemeta> #define MAX_PLAYERS 32 new bool:g_in_the_air[MAX_PLAYERS + 1] public plugin_init() {     register_forward(FM_PlayerPostThink, "forward_player_postthink") } public forward_player_postthink(id) {     if (!is_user_alive(id))         return FMRES_IGNORED     if (!(pev(id, pev_flags) & FL_ONGROUND))         g_in_the_air[id] = true     else if (g_in_the_air[id]) {         set_pev(id, pev_watertype, CONTENTS_WATER)         g_in_the_air[id] = false     }     return FMRES_IGNORED }
VEN is offline
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:23.


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