|
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
|
05-20-2010
, 08:40
Re: Orpheu: Engine PM Functions
|
#26
|
Quote:
Originally Posted by joaquimandrade
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( ) { OrpheuRegisterHook( OrpheuGetDLLFunction( "pfnPM_Move","PM_Move" ), "PM_Move" ); }
public OrpheuHookReturn:PM_Move(OrpheuStruct:ppmove,server) { new iPlayer = OrpheuGetStructMember( ppmove, "player_index" ) + 1; if( is_user_alive( iPlayer ) ) { new OrpheuStruct:cmd = OrpheuStruct:OrpheuGetStructMember( ppmove, "cmd" ); // change 0.0 to your value OrpheuSetStructMember( cmd, "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.
|
I'll leave this here.
|
|
|
|