AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Orpheu PM_Move setting angles (https://forums.alliedmods.net/showthread.php?t=154845)

Exolent[jNr] 04-14-2011 00:46

Orpheu PM_Move setting angles
 
Code:
#include < amxmodx > #include < orpheu > #include < orpheu_stocks > new Float:g_vecMoveAngles[ 3 ]; public plugin_init( ) {     new OrpheuFunction:funcPM_Move = OrpheuGetDLLFunction( "pfnPM_Move", "PM_Move" );     OrpheuRegisterHook( funcPM_Move, "OnPM_Move" );     OrpheuRegisterHook( funcPM_Move, "OnPM_Move_Post", OrpheuHookPost ); } public OnPM_Move( OrpheuStruct:ppmove, server ) {     OrpheuGetStructMember( ppmove, "angles", g_vecMoveAngles );     OrpheuSetStructMember( ppmove, "angles", Float:{ 0.0, 0.0, 0.0 } ); } public OnPM_Move_Post( OrpheuStruct:ppmove, server ) {     OrpheuSetStructMember( ppmove, "angles", g_vecMoveAngles ); }

The idea is to set angles to 0,0,0 so that the movement is always the same direction for each movement key.
For example, holding +forward key will always go the same direction regardless of player angles.
However, it isn't working.

There are no errors in parsing anything when Orpheu loads, and there are no errors in the plugin.

Exolent[jNr] 04-14-2011 18:15

Re: Orpheu PM_Move setting angles
 
Solved setting the forward/right/up vectors instead of the angles.

Code:
#include < amxmodx > #include < orpheu > #include < orpheu_stocks > new OrpheuStruct:g_ppmove; public plugin_init( ) {     OrpheuRegisterHook( OrpheuGetDLLFunction( "pfnPM_Move", "PM_Move" ), "OnPM_Move" );     OrpheuRegisterHook( OrpheuGetFunction( "PM_PlayerMove" ), "OnPM_PlayerMove" ); } public OnPM_Move( OrpheuStruct:ppmove, server ) {     g_ppmove = ppmove; } public OnPM_PlayerMove( ) {     OrpheuSetStructMember( g_ppmove, "forward", Float:{ 1.0, 0.0, 0.0 } );     OrpheuSetStructMember( g_ppmove, "right", Float:{ 0.0, -1.0, 0.0 } );     OrpheuSetStructMember( g_ppmove, "up", Float:{ 0.0, 0.0, 1.0 } ); }


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

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