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)

AmirHossaiN 10-15-2016 16:19

Re: Double Jump
 
some time working and most time not working :(

paegus 10-20-2016 15:41

Re: Double Jump
 
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!");

sleggie 10-22-2016 01:19

Re: Double Jump
 
would be nice to make it so only people with certain flags can use it

paegus 10-23-2016 01:19

Re: Double Jump
 
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.

StrikerMan780 06-18-2018 17:56

Re: Double Jump
 
1 Attachment(s)
Here's an optimized version of the plugin that uses OnPlayerRunCMD rather than OnGameFrame, and removes an unnecessary variable.

Unban 12-18-2018 14:02

Re: Double Jump
 
StrikerMan780, big thanks :)

Grey83 10-03-2021 16:03

Double Jump v1.1.0
 
1 Attachment(s)
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()

paegus 10-04-2021 01:14

Re: Double Jump
 
Thanks for updating it! Glad to see people are still making use of this even after all these years.

LividBunny 11-28-2022 03:18

Re: Double Jump
 
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.

paegus 11-30-2022 13:33

Re: Double Jump
 
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?


All times are GMT -4. The time now is 15:52.

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