AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   Orpheu: Engine PM Functions (https://forums.alliedmods.net/showthread.php?t=118476)

Lt.RAT 05-07-2010 13:16

Re: Orpheu: Engine PM Functions
 
Need to block any player "key" movement, but save movetype_walk, did test plugin, and wonder why it`s not working

PHP Code:

#include <amxmodx> 
#include <fakemeta> 

#include <orpheu> 
#include <orpheu_memory> 
#include <orpheu_advanced> 

public plugin_init() 

    
register_plugin("cmd_test""0.1""Lt.RAT"
     
    
OrpheuRegisterHook(OrpheuGetFunction("PM_Move"),"OnPM_move"); 


public 
OnPM_move(move,server

//    new id = OrpheuGetParamStructMember( 1 , "player_index" ) + 1; 

    
new OrpheuStruct:cmd OrpheuStruct:OrpheuGetParamStructMember"cmd" ); 

    
//set_uc(_:cmd, UC_Msec, 2); //working (like plugin slow-mo) 

    
static Float:d0,Float:d1,Float:d2
    
d0 OrpheuGetStructMember(cmd"forwardmove"); //ret correct value 
    
d1 OrpheuGetStructMember(cmd"sidemove"); //ret correct value 
    
d2 OrpheuGetStructMember(cmd"upmove"); //ret correct value 

    
set_uc(_:cmdUC_ForwardMove0); //not working 
    
set_uc(_:cmdUC_SideMove0); //not working 
    
set_uc(_:cmdUC_UpMove0); //not working 

    
OrpheuSetStructMember(cmd"forwardmove"0); //not working 
    
OrpheuSetStructMember(cmd"sidemove"0); //not working 
    
OrpheuSetStructMember(cmd"upmove"0); //not working 
    
OrpheuSetStructMember(cmd"buttons"0); //not working 


"not working" means no effect in PM_Move and other PM_ functions (you can run in any direction you want).

ADD:
Right, it works :) Something happened and before full server restart it wont work :(

Shooting and punchangle calculated with cmd from DLLFunc_CmdStart as i know.

Arkshine 05-07-2010 13:43

Re: Orpheu: Engine PM Functions
 
It works for me ( I can not move at all ) except shooting which is not blocked.

Lt.RAT 05-09-2010 11:52

Re: Orpheu: Engine PM Functions
 
1 Attachment(s)
Wrote signatures for some functions.

Hook of PM_Init, PM_CreateStuckTable and PM_InitTextureTypes not possible coz Orpheu loads after their work.

Tested signatures with several libraries.
For
Code:

PM_WaterMove
PM_ClipVelocity
PM_FlyMove

there is no way to create universal signatures (from start of functions) :(

All checks passed:
Code:

PM_CatagorizeTextureType
PM_CheckFalling
PM_CheckParamters
PM_CheckStuck
PM_CheckVelocity
PM_CheckWater
PM_CheckWaterJump
PM_ClipVelocity
PM_CreateStuckTable
PM_Duck
PM_FindTextureType
PM_Init
PM_InitTextureTypes
PM_Jump
PM_Ladder
PM_LadderMove
PM_Move
PM_Physics_Toss
PM_PlayerMove
PM_PlayStepSound
PM_ReduceTimers
PM_WalkMove

Good only for latest server build (maybe better to use offsets instead of them in this case)
Code:

PM_AirAccelerate
PM_AirMove
PM_CatagorizePosition
PM_FlyMove
PM_Friction
PM_SpectatorMove
PM_UpdateStepSound
PM_WaterMove


lazarev 05-11-2010 09:01

Re: Orpheu: Engine PM Functions
 
Can someone make a sig for PM_DropPunchAngle?

Arkshine 05-11-2010 09:27

Re: Orpheu: Engine PM Functions
 
You can't hook it for 2 reasons :

- It's integrated into PM_CheckParamters()
- I guess vec3_t can't be used with orpheu.

lazarev 05-11-2010 10:00

Re: Orpheu: Engine PM Functions
 
vec3_t = Float:Vec[3];

I checked PM_AiraAccelerate sig, it has
Code:

"type" : "Vector *",
"info" : "wishdir"

wishdir is vec3_t.

Arkshine 05-11-2010 10:03

Re: Orpheu: Engine PM Functions
 
I know and ?

Lt.RAT 05-11-2010 15:30

Re: Orpheu: Engine PM Functions
 
Yeah, i`ve confronted with vec3_t problem when tried to write signature.
vec3_t is vec_t[3] and vec_t is float.
I`ve tried and tested Vector instead of vec3_t and found that it works. And used in that declaration Vector instead of vec3_t.

Quote:

Originally Posted by lazarev (Post 1177237)
Can someone make a sig for PM_DropPunchAngle?

Quote:

Originally Posted by Arkshine (Post 1177260)
You can't hook it:
- It's integrated into PM_CheckParamters()

The only one thing we can do - emulate code of function.


I have a question: How to use pmove->PM_PlayerTrace and all other funcs in playermove_t?

joropito 05-11-2010 15:39

Re: Orpheu: Engine PM Functions
 
Can't vec3_t be read as a chunk of bytes and convert to float vectors with pawn?

Lt.RAT 05-11-2010 15:51

Re: Orpheu: Engine PM Functions
 
Quote:

Originally Posted by joropito (Post 1177569)
Can't vec3_t be read as a chunk of bytes and convert to float vectors with pawn?

Vectors in pawn chunk of bytes too :) But it`s ok in code, but what about function arguments ?


All times are GMT -4. The time now is 17:17.

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