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

Solved Force player duck without Orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-20-2018 , 05:24   Re: Force player duck without Orpheu
Reply With Quote #21

PHP Code:
/**
 * Sets the value of a member of a struct given a struct handler and the member name
 * 
 * @param struct         A handler to the struct
 * @param memberName     The name of the member of the struct we want to deal with
 * @param any             The new value
 */
native OrpheuSetStructMember(OrpheuStruct:struct,const memberName[],any:...) 
On one line you have
PHP Code:
OrpheuSetStructMember(ppmove "flags"OrpheuGetStructMember(ppmove"flags" ) & FL_DUCKING
yet on the other one you have
PHP Code:
OrpheuSetStructMember(ppmoveOrpheuGetStructMembercmd"buttons" ), OrpheuGetStructMembercmd"buttons" ) & IN_DUCK
Do you see the difference?
__________________
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-20-2018 , 05:56   Re: Force player duck without Orpheu
Reply With Quote #22

Quote:
Originally Posted by KliPPy View Post
PHP Code:
/**
 * Sets the value of a member of a struct given a struct handler and the member name
 * 
 * @param struct         A handler to the struct
 * @param memberName     The name of the member of the struct we want to deal with
 * @param any             The new value
 */
native OrpheuSetStructMember(OrpheuStruct:struct,const memberName[],any:...) 
On one line you have
PHP Code:
OrpheuSetStructMember(ppmove "flags"OrpheuGetStructMember(ppmove"flags" ) & FL_DUCKING
yet on the other one you have
PHP Code:
OrpheuSetStructMember(ppmoveOrpheuGetStructMembercmd"buttons" ), OrpheuGetStructMembercmd"buttons" ) & IN_DUCK
Do you see the difference?
Ah, so, like this?
PHP Code:
#include < amxmodx >
#include < orpheu >
#include < orpheu_stocks >
#include < orpheu_memory >

public plugin_init( )
{
    
OrpheuRegisterHook(OrpheuGetFunction("PM_Duck"), "PM_Duck_pre"OrpheuHookPre)
}

public 
OrpheuHookReturn:PM_Duck_pre() {
    new 
OrpheuStruct:ppmove OrpheuGetStructFromAddress(OrpheuStructPlayerMove,OrpheuMemoryGet("ppmove"))
    
OrpheuSetStructMember(ppmove "flags"OrpheuGetStructMember(ppmove"flags" ) | FL_DUCKING)
    
    new 
OrpheuStruct:cmd OrpheuStruct:OrpheuGetStructMemberppmove"cmd" );
    
OrpheuSetStructMember(ppmove"buttons"OrpheuGetStructMembercmd"buttons" ) | IN_DUCK)

__________________

Last edited by edon1337; 02-20-2018 at 05:57.
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-20-2018 , 06:29   Re: Force player duck without Orpheu
Reply With Quote #23

That looks like proper code. You'll have to test it yourself if it works though.
__________________
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-20-2018 , 06:36   Re: Force player duck without Orpheu
Reply With Quote #24

Quote:
Originally Posted by KliPPy View Post
That looks like proper code. You'll have to test it yourself if it works though.
Yeah, obviously. Thanks for the help.
__________________
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-20-2018 , 14:15   Re: Force player duck without Orpheu
Reply With Quote #25

PHP Code:
L 02/20/2018 20:14:31: [AMXX]    [0ForceDuck.sma::PM_Duck_pre (line 18)
L 02/20/2018 20:14:31: [ORPHEUStructure "playermove_s *" doesn't have a member named "button 
Doesn't work, just keeps bouncing me, like auto bhop.
__________________
edon1337 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 14:19.


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