Raised This Month: $ Target: $400
 0% 

how to make player move less sideways without slowhacking?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-09-2010 , 13:16   Re: how to make player move less sideways without slowhacking?
Reply With Quote #1

Quote:
Originally Posted by Exolent[jNr] View Post
PM_Move receives ppmove as argument and it's a DLL function so it's safer to use it as such.

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

public plugin_init( )
{
    
OrpheuRegisterHookOrpheuGetDLLFunction"pfnPM_Move","PM_Move" ), "PM_Move" );
}

public 
OrpheuHookReturn:PM_Move(OrpheuStruct:ppmove,server)
{    
    new 
iPlayer OrpheuGetStructMemberppmove"player_index" ) + 1;
    
    if( 
is_user_aliveiPlayer ) )
    {
        new 
OrpheuStruct:cmd OrpheuStruct:OrpheuGetStructMemberppmove"cmd" );
        
        
// change 0.0 to your value
        
OrpheuSetStructMembercmd"sidemove"0.0 );
    }
    
    return 
OrpheuIgnored;

Put this in a file called PM_Move in configs/orpheu/functions

HTML Code:
{
    "name" : "PM_Move",
    "library" : "mod",
    "arguments" :
    [
        {
            "type" : "playermove_s *"
        },
        {
            "type" : "qboolean"
        }
    ]
}
By the way. Getting ppmove like that (for other functions) is not that safe (i have to change that in the tutorial). The best thing probably is hooking always PM_Move like this + storing ppmove in a global var.

Edit: by safe I mean "update proof" but in this case, doing like I said in my last sentence, is also mod independent so I recommend it.
__________________

Last edited by joaquimandrade; 05-09-2010 at 13:23.
joaquimandrade 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 03:34.


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