A friend asked me how to use PM_* functions. Those functions use a structure defined in the global scope that is only passed to the PM_Move function. For now, with the module, the only way of accessing that structure is in that function. You can retrieve data and save it to use in the other functions but, that is limited since there are situations where accessing the structure directly inside the functions would be better. Will be supported later.
Example of blocking Jump for players with odd Id's.
Code:
name "PM_Move"
signature "PM_Move"
arguments "playermove_s *" "int"
Code:
name "PM_Jump"
signature "PM_Jump"
PHP Code:
#include <amxmodx>
#include <orpheu>
new OrpheuFunction:PM_JumpFunction
new OrpheuHook:PM_JumpHook
public plugin_init()
{
OrpheuRegisterHookFromName("PM_Move","PM_Move")
PM_JumpFunction = OrpheuGetFunction("PM_Jump")
}
public PM_Move(ppmove,server)
{
new id = 1 + OrpheuGetStructParam(1,"player_index")
if(id % 2)
{
PM_JumpHook = OrpheuRegisterHook(PM_JumpFunction,"PM_Jump")
}
}
public PM_Jump()
{
OrpheuUnregisterHook(PM_JumpHook)
return OrpheuSupercede
}
As attachment ships an updated module with the support for the parameters of this structure.
Can be used for storing and retrieving vectors and strings by reference.