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

[Orpheu] Ladder move speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ortega
Junior Member
Join Date: Nov 2009
Old 09-03-2010 , 12:34   [Orpheu] Ladder move speed
Reply With Quote #1

Hi. I made plugin which change the value of speed on the ladder but it doesn't work. What's wrong?

PHP Code:
#include < amxmodx >
#include < orpheu >

new pSpeed;

public 
plugin_init( ) {
    
OrpheuRegisterHookOrpheuGetFunction"PM_LadderMove" ), "OnPM_LadderMove"OrpheuHookPost );
    
    
pSpeed register_cvar"FLM_speed""300.0" );
    
}

public 
OrpheuHookReturn:OnPM_LadderMoveOrpheuStruct:ppmoveserver ) {
    new 
client OrpheuGetStructMemberppmove"player_index" ) + 1;
    
    if( 
is_user_aliveclient ) )
    {
        
OrpheuSetParamStructMember1"clientmaxspeed"get_pcvar_floatpSpeed ) );
        
        return 
OrpheuSupercede;
    }
    return 
OrpheuIgnored;

Ortega is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 09-03-2010 , 14:33   Re: [Orpheu] Ladder move speed
Reply With Quote #2

PHP Code:
#include < amxmodx >
#include < orpheu >
#include < orpheu_stocks >

new MAX_CLIMB_SPEEDOrpheuStruct:pmove;

public 
plugin_init( ) 
{
    
MAX_CLIMB_SPEED register_cvar"orpheu_ladder_speed""200.0" ); // #define MAX_CLIMB_SPEED 200 [pm_shared.c]
    
OrpheuRegisterHookOrpheuGetDLLFunction"pfnPM_Move","PM_Move" ), "OnPM_Move" );
    
OrpheuRegisterHookOrpheuGetFunction"PM_LadderMove" ), "OnPM_LadderMove"OrpheuHookPost );
}

public 
OrpheuHookReturn:OnPM_MoveOrpheuStruct:ppmoveserver )
{    
    
pmove ppmove;
    return 
OrpheuIgnored;
}  

public 
OrpheuHookReturn:OnPM_LadderMove( const pLadder 
{
    new 
Float:velocity[3];
    
OrpheuGetStructMemberpmove"velocity"velocity );
        
    
velocity[2] = velocity[2] / 200 get_pcvar_floatMAX_CLIMB_SPEED );
    
OrpheuSetStructMemberpmove"velocity"velocity );
    
    return 
OrpheuIgnored;


Last edited by lazarev; 09-04-2010 at 09:21.
lazarev is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-03-2010 , 14:38   Re: [Orpheu] Ladder move speed
Reply With Quote #3

- You don't need to supercede when you change on-the-fly a param.
- Superceding while hooking as post would do nothing.
- You forgot the config files, and you should instead hooking PM_Move, and storing ppmove globally.
__________________

Last edited by Arkshine; 09-03-2010 at 14:42.
Arkshine is offline
Old 09-03-2010, 14:43
lazarev
This message has been deleted by lazarev.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-03-2010 , 14:45   Re: [Orpheu] Ladder move speed
Reply With Quote #4

Anyway don't show a wrong example.
__________________
Arkshine is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 09-03-2010 , 14:52   Re: [Orpheu] Ladder move speed
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Anyway don't show a wrong example.
you got me, I've edited code.

Last edited by lazarev; 09-03-2010 at 14:55.
lazarev is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 03-22-2018 , 09:52   Re: [Orpheu] Ladder move speed
Reply With Quote #6

Sorry to resurrect an old thread but I've been looking for some way to slow down climb speed on ladders, this is the nearest I've come but lazarev's code doesn't seem to work.

I've checked the console for errors and at first it can't find "PM_LadderMove". I then downloaded a pack from this thread and the no more errors are present but ladder climbing speed is still normal, even after changing MAX_CLIMB_SPEED to just '10'.

Can anyone help me? Am I just missing something or does code really doesn't work?...
__________________
hellmonja 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:55.


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