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

Solved Force player duck without Orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-19-2018 , 18:12   Re: Force player duck without Orpheu
Reply With Quote #11

You say you do not want to use orpheu for such simple thing. Given that you can not find a solution it ain't that simple, is it?
__________________

Last edited by HamletEagle; 01-19-2018 at 18:12.
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-19-2018 , 19:17   Re: Force player duck without Orpheu
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
You say you do not want to use orpheu for such simple thing. Given that you can not find a solution it ain't that simple, is it?
You gotta admit, it's a simple thing with no solution. Alright, I'll use Orpheu, it's not that I don't want, it's that I'm a total beginner in it, could you provide me with an example of forcing duck on PM_Move?

EDIT: I made this but I'm sure it's wrong:
PHP Code:
#include < amxmodx >
#include < orpheu >
#include < orpheu_stocks >

new OrpheuStruct:g_ppmove;

public 
plugin_init( )
{
    
OrpheuRegisterHookOrpheuGetDLLFunction"pfnPM_Move""PM_Move" ), "OnPM_Move" );
    
OrpheuRegisterHookOrpheuGetFunction"PM_PlayerMove" ), "OnPM_PlayerMove" );
}

public 
OnPM_MoveOrpheuStruct:ppmoveserver )
{
    
g_ppmove ppmove;
}

public 
OnPM_PlayerMove( )
{
    if ( !( 
OrpheuGetStructMemberg_ppmove "flags" ) & FL_DUCKING ) ) 
    
OrpheuSetStructMemberg_ppmove "flags"OrpheuGetStructMemberg_ppmove"flags" ) & FL_DUCKING 

__________________

Last edited by edon1337; 01-20-2018 at 07:26.
edon1337 is offline
Old 01-26-2018, 15:56
edon1337
This message has been deleted by HamletEagle. Reason: Wait 14 days before bumping
Old 01-27-2018, 05:28
HamletEagle
This message has been deleted by HamletEagle.
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-02-2018 , 15:26   Re: Force player duck without Orpheu
Reply With Quote #13

up
__________________
edon1337 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 02-02-2018 , 18:13   Re: Force player duck without Orpheu
Reply With Quote #14

try this

Code:
#include < amxmodx > #include < orpheu > #include < orpheu_stocks > new OrpheuStruct:g_ppmove; public plugin_init( ) {     OrpheuRegisterHook(OrpheuGetFunction("PM_Duck"), "PM_Duck_pre", OrpheuHookPre) } public OrpheuHookReturn:PM_Duck_pre() {     new OrpheuStruct:ppmove = OrpheuGetStructFromAddress(OrpheuStructPlayerMove,OrpheuMemoryGet("pmove"))     OrpheuSetStructMember(ppmove , "flags", OrpheuGetStructMember(ppmove, "flags" ) & FL_DUCKING)     OrpheuSetStructMember(ppmove , "cmd.buttons", OrpheuGetStructMember(ppmove, "cmd.buttons" ) & IN_DUCK) }

PM_Duck
Code:
{
	"name" : "PM_Duck",
	"library" : "mod",
	"identifiers" :
	[
		{
			"os" : "windows",
			"mod" : "cstrike",
			"value" : [0x81,0xEC,0x94,0x00,0x00,0x00,0x53,0x55,0x56,0x8B,0x35,"*","*","*","*",0x57]
		},
		{
			"os" : "linux",
			"mod" : "cstrike",
			"value" : "PM_Duck"
		}
	]
}
lel if this works it should work with Ham_Duck also. you just need both FL_DUCKING and IN_DUCK set

Last edited by jimaway; 02-02-2018 at 18:21.
jimaway is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-03-2018 , 13:24   Re: Force player duck without Orpheu
Reply With Quote #15

Quote:
Originally Posted by jimaway View Post
try this

Code:
#include < amxmodx > #include < orpheu > #include < orpheu_stocks > new OrpheuStruct:g_ppmove; public plugin_init( ) {     OrpheuRegisterHook(OrpheuGetFunction("PM_Duck"), "PM_Duck_pre", OrpheuHookPre) } public OrpheuHookReturn:PM_Duck_pre() {     new OrpheuStruct:ppmove = OrpheuGetStructFromAddress(OrpheuStructPlayerMove,OrpheuMemoryGet("pmove"))     OrpheuSetStructMember(ppmove , "flags", OrpheuGetStructMember(ppmove, "flags" ) & FL_DUCKING)     OrpheuSetStructMember(ppmove , "cmd.buttons", OrpheuGetStructMember(ppmove, "cmd.buttons" ) & IN_DUCK) }

PM_Duck
Code:
{
	"name" : "PM_Duck",
	"library" : "mod",
	"identifiers" :
	[
		{
			"os" : "windows",
			"mod" : "cstrike",
			"value" : [0x81,0xEC,0x94,0x00,0x00,0x00,0x53,0x55,0x56,0x8B,0x35,"*","*","*","*",0x57]
		},
		{
			"os" : "linux",
			"mod" : "cstrike",
			"value" : "PM_Duck"
		}
	]
}
lel if this works it should work with Ham_Duck also. you just need both FL_DUCKING and IN_DUCK set
In which folder should I put the signature?
__________________
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-03-2018 , 13:34   Re: Force player duck without Orpheu
Reply With Quote #16

configs/orpheu/functions
__________________
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-03-2018 , 19:24   Re: Force player duck without Orpheu
Reply With Quote #17

The code wasn't working, also it was giving a few errors, something like 'invalid memory address' or 'invalid struct member', I fixed it but I'm getting a tag mismatch:
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(ppmoveOrpheuGetStructMembercmd"buttons" ), OrpheuGetStructMembercmd"buttons" ) & IN_DUCK)

Here
PHP Code:
    OrpheuSetStructMember(ppmoveOrpheuGetStructMembercmd"buttons" ), OrpheuGetStructMembercmd"buttons" ) & IN_DUCK
__________________

Last edited by edon1337; 02-03-2018 at 19:24.
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-19-2018 , 17:20   Re: Force player duck without Orpheu
Reply With Quote #18

Bump
__________________
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-20-2018 , 02:48   Re: Force player duck without Orpheu
Reply With Quote #19

Did you ever take a look at the prototype of OrpheuSetStructMember? See what the second param actually is and what you are passing to it.
https://github.com/Arkshine/Orpheu/b...rpheu.inc#L132

Also to add flags you use flags | flag instead of flags & flag. To remove them you use flags & ~flag.
__________________

Last edited by klippy; 02-20-2018 at 05:22.
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-20-2018 , 05:04   Re: Force player duck without Orpheu
Reply With Quote #20

Quote:
Originally Posted by KliPPy View Post
Did you ever take a look at the prototype of OrpheuSetStructMember? See what the second param actually is and what you are passing to it.
https://github.com/Arkshine/Orpheu/b...ude/orpheu.inc
Struct member and I'm using OrpheuGetStructMember?
__________________

Last edited by edon1337; 02-20-2018 at 05:04.
edon1337 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 07:37.


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