Quote:
Originally Posted by Arkshine
This is supposed to be a float value (f for float), and you don't retrieve value as a float.
About your error, no idea, you better show all your code as it is, so we can understand better what you're doing.
|
PHP Code:
#include <amxmodx>
#include <orpheu>
#include <hlsdk_const>
#define VERSION "1.7.2"
new Float:oldMaxSpeed
new OrpheuStruct:ppmove
public plugin_init()
{
register_plugin("axn bhop", VERSION, "aportner & ConnorMcLeod")
new szVersion[12]
formatex(szVersion, charsmax(szVersion), "%s_Orpheu", VERSION)
register_cvar("axn_version", szVersion, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
OrpheuRegisterHook(OrpheuGetFunction("PM_Move"), "onPMMovePre", OrpheuHookPre)
OrpheuRegisterHook(OrpheuGetFunction("PM_Jump"), "onPMJumpPre", OrpheuHookPre)
OrpheuRegisterHook(OrpheuGetFunction("PM_Jump"), "onPMJumpPost", OrpheuHookPost)
// OrpheuRegisterHook(OrpheuGetFunction("PM_PlayerMove"), "onPMPlayerMovePre", OrpheuHookPre)
OrpheuRegisterHook(OrpheuGetFunction("PM_Duck"), "onPMDuckPost", OrpheuHookPost)
}
public onPMMovePre(OrpheuStruct:pmove,server)
{
ppmove = pmove
}
public onPMJumpPre()
{
// bhop acceleration
oldMaxSpeed = Float:OrpheuGetStructMember(ppmove, "maxspeed")
OrpheuSetStructMember(ppmove, "maxspeed", 0.0)
}
public onPMJumpPost()
{
/* Here's my code */
new Float:fuser3[3]
OrpheuGetStructMember(ppmove, "fuser2", fuser3)
client_print(0, print_chat, "fuser2: %f", fuser3[2]) // example
/* Here's my code */
// remove fuser2 slowdown
OrpheuSetStructMember(ppmove, "fuser2", 0.0)
// restore maxspeed from acceleration
OrpheuSetStructMember(ppmove, "maxspeed", oldMaxSpeed)
}
/*public onPMPlayerMovePre()
{
}*/
public onPMDuckPost()
{
if( OrpheuGetStructMember(ppmove, "onground") != -1
&& OrpheuGetStructMember(OrpheuStruct:OrpheuGetStructMember( ppmove, "cmd" ), "buttons" ) & IN_USE )
{
new Float:fVecVelocity[3]
OrpheuGetStructMember(ppmove, "velocity", fVecVelocity)
fVecVelocity[0] *= 0.3
fVecVelocity[1] *= 0.3
fVecVelocity[2] *= 0.3
OrpheuSetStructMember(ppmove, "velocity", fVecVelocity)
}
}
That gives me a Invalid structure error, on a sidenote I think the "onPMDuckPost()" function is not working, and he does the exactly same under there
PHP Code:
new Float:fVecVelocity[3]
OrpheuGetStructMember(ppmove, "velocity", fVecVelocity)
I just wanna grab the value of fuser2 and print it out.
And here's the PM_Duck file which I'm using (since it's not included when you download Orpheu):
https://forums.alliedmods.net/showthread.php?t=118476
Taken from joaquims PM_Pack.