Raised This Month: $12 Target: $400
 3% 

Double Jump


Post New Thread Reply   
 
Thread Tools Display Modes
AmirHossaiN
Junior Member
Join Date: Oct 2016
Old 10-15-2016 , 16:19   Re: Double Jump
Reply With Quote #31

some time working and most time not working
AmirHossaiN is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-20-2016 , 15:41   Re: Double Jump
Reply With Quote #32

Been a while since I touched this but if you jump too fast (like with a mouse wheel) it might not register them all.

Otherwise, You can try adding server console output at the various stages to see what's firing.

Code:
PrintToChat(client, "IsawThat!");
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
sleggie
Junior Member
Join Date: Mar 2016
Old 10-22-2016 , 01:19   Re: Double Jump
Reply With Quote #33

would be nice to make it so only people with certain flags can use it
sleggie is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-23-2016 , 01:19   Re: Double Jump
Reply With Quote #34

cheep and nasty version is something like:

Code:
//somewhere up top
new AdminFlag:g_afAdminLevel		= Admin_Kick


// somewhere something happens.
 if (CanClientDoThing(client)) {
    // do thing
  }


// somewhere down bottom
stock bool:CanClientDoThing (const any:client) {
	if (g_afAdminLevel == INVALID_ADMIN_ID) {	// No access levels required. Everyone can spectate hidden.
		return true;
	} else {	// Access level specified.
		new AdminId:aiClient = GetUserAdmin (client);
		return (
			aiClient != INVALID_ADMIN_ID &&							// Client is an admin of some kind.
			//GetAdminFlags (aiClient, Access_Real) & ADMFLAG_KICK	// Client has needed access
			GetAdminFlag (aiClient, g_afAdminLevel)					// Client has needed access
		);
	}
}
It might be better to set it up once so it's not checked every time a player tries. Say in client connect or something, enable to disable their player slot. That way you can have it...

Code:
// somewhere something happens.
  if ( CanClientDoThing[client] ) {
    // do thing
  }
...which is far less work since looking up an array location is just a n counts through the array instead of all that other stuff.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 10-23-2016 at 01:19.
paegus is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 06-18-2018 , 17:56   Re: Double Jump
Reply With Quote #35

Here's an optimized version of the plugin that uses OnPlayerRunCMD rather than OnGameFrame, and removes an unnecessary variable.
Attached Files
File Type: sp Get Plugin or Get Source (sm_doublejump.sp - 1051 views - 3.7 KB)
StrikerMan780 is offline
Unban
Junior Member
Join Date: Jul 2011
Location: Lithuania
Old 12-18-2018 , 14:02   Re: Double Jump
Reply With Quote #36

StrikerMan780, big thanks
Unban is offline
Send a message via Skype™ to Unban
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 10-03-2021 , 16:03   Double Jump v1.1.0
Reply With Quote #37

Small update for plugin:
  • Rewritten with new syntax (SM1.7+)
  • Added bounds for convars (the maximum value of the convar sm_doublejump_boost is set to 4095 to avoid the message about clamping)
  • Added the ability to make jumps endless (sm_doublejump_max 0)
  • Added the ability to create an event "player_footstep" when performing a jump in the air (convar sm_doublejump_event)
  • Plugin uses OnPlayerRunCmd() instead of OnGameFrame()
Attached Files
File Type: sp Get Plugin or Get Source (sm_doublejump 1.1.0.sp - 525 views - 2.8 KB)
__________________
Grey83 is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-04-2021 , 01:14   Re: Double Jump
Reply With Quote #38

Thanks for updating it! Glad to see people are still making use of this even after all these years.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
LividBunny
Member
Join Date: Mar 2021
Old 11-28-2022 , 03:18   Re: Double Jump
Reply With Quote #39

Would be cool if when we Double Jump close to the ground after a long fall, fall damage wouldn't be activated.

There's this Addon for Gmod that the YogsCast use on TTT gameplay if you were to fall/thrown far in the air were you to double jump near the ground it wouldn't count towards fall damage, this may be due to TF2 Scout double jump as it seems they tell you that "You'll get errors if you don't have Team Fortress 2 installed."

Is there no way this could be replicated?

EDIT:I mean I tested this on L4D2 I don't know about other games.

Last edited by LividBunny; 11-28-2022 at 03:19.
LividBunny is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 11-30-2022 , 13:33   Re: Double Jump
Reply With Quote #40

It's fairly trivial to allow double jumping while falling. As is the plugin detects the 1st jump to "enable" the second jump. If you remove the was-jumped logic (and maybe increase the max jumps by 1?) it will allow you to jump any time... including after falling instead of jumping initially.

iirc I had to code around making sure people couldn't strip fall damage. there might even be comments indicating the code to pull?
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
Reply


Thread Tools
Display Modes

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 16:23.


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