AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Double Jump (https://forums.alliedmods.net/showthread.php?t=99874)

paegus 08-10-2009 08:50

Double Jump
 
1 Attachment(s)
Code:

/*
 * Double Jump
 *
 * Description:
 *  Allows players to double-jump
 *  Original idea: NcB_Sav
 *
 * Convars:
 *  sm_doublejump_enabled [bool] : Enables or disable double-jumping. Default: 1
 *  sm_doublejump_boost [amount] : Amount to boost the player. Default: 250
 *  sm_doublejump_max [jumps]    : Maximum number of re-jumps while airborne. Default: 1
 *
 * Changelog:
 *  v1.0.1
 *  Minor code optimization.
 *  v1.0.0
 *  Initial release.
 *
 * Known issues:
 *  Doesn't register all mouse-wheel triggered +jumps
 *
 * Todo:
 *  Employ upcoming OnPlayerRunCmd function to remove excess OnGameFrame-age.
 *
 * Contact:
 *  Paegus: paegus(at)gmail(dot)com
 *  SourceMod: http://www.sourcemod.net
 *  NcB_Sav: http://forums.alliedmods.net/showthread.php?t=99228
 */

Original Thread

Get an updated version with less OnGameFrame and more updated syntax down here courtesy of Grey83

almcaeobtac 08-10-2009 13:04

Re: Double Jump
 
Where is it?

Doc-Holiday 08-10-2009 14:34

Re: Double Jump
 
Kind of assanying since i asked if you would mind if i release my version with your teleport fucntion....

Thanks though for putting it out there now i can link to it on my surviovr mod

retsam 08-10-2009 14:39

Re: Double Jump
 
Yeah bud, you kinda forgot to attach the plugin. :)

paegus 08-10-2009 14:47

Re: Double Jump
 
oops

Quote:

Originally Posted by NcB_Sav (Post 895484)
Kind of assanying since i asked if you would mind if i release my version with your teleport fucntion....

Thanks though for putting it out there now i can link to it on my surviovr mod

sorry... wasn't thinking. thought you were working on a combo plugin as oppose to this specifically. if you want i'll take it down since it's essentially your idea.

almcaeobtac 08-10-2009 15:17

Re: Double Jump
 
Can't wait to try it :D

Doc-Holiday 08-10-2009 15:19

Re: Double Jump
 
naw man its all good its already up i dont mind just add me for th idea:)

Used it mainly on my bones server *survivor mod*


Like this more then hook

bl4nk 08-10-2009 16:18

Re: Double Jump
 
Once 1.3 lands, you could rewrite this to use OnPlayerRunCmd, making it so you're not having to constantly check every player inside of OnGameFrame.

Doc-Holiday 08-10-2009 16:59

Re: Double Jump
 
Quote:

Originally Posted by bl4nk (Post 895590)
Once 1.3 lands, you could rewrite this to use OnPlayerRunCmd, making it so you're not having to constantly check every player inside of OnGameFrame.


That i will no know how to do heheh

paegus 08-10-2009 17:48

Re: Double Jump
 
Quote:

Originally Posted by bl4nk (Post 895590)
Once 1.3 lands, you could rewrite this to use OnPlayerRunCmd, making it so you're not having to constantly check every player inside of OnGameFrame.

is there a similar function (OnPlayerStateChange?) to catch flag changes for say FL_ONGROUND?

otherwise there would need to be a scan to find when that state changes to catch the 1st jump. even if OnPlayerRunCmd() fires before the player's flags change you still need to detect the landing again to reset the jump count properly.


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

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