That plugin works. The string retrieved by read_argv is patched, but the argument in the string retrieved by read_args is not patched. In my case, I thought if I patch the argument (read_argv) will work, but it didn't work. So I need to patch read_Args to see if it will work. So I tried and modified your example in:
PHP Code:
#include <amxmodx>
#include <orpheu>
#include <orpheu_stocks>
new OrpheuHook:HandleCmd_ArgsHook
public plugin_init()
{
register_clcmd("test", "ClientCommand_Test")
}
public ClientCommand_Test(id)
{
new Args[32]
HandleCmd_ArgsHook = OrpheuRegisterHook(OrpheuGetEngineFunction("pfnCmd_Args", "ReadArgs"), "pfnCmd_Args")
read_args(Args, charsmax(Args))
server_print("Got: %s", Args)
}
public OrpheuHookReturn:pfnCmd_Args()
{
OrpheuSetReturn("SomeRandomReturnHere")
OrpheuUnregisterHook(HandleCmd_ArgsHook)
return OrpheuOverride
}
Signature:
PHP Code:
{
"name" : "ReadArgs",
"library" : "engine",
"return" :
{
"type" : "char *"
}
}
But I got one error:
PHP Code:
[ORPHEU] Invalid function structure "ReadArgs"
Any ideas?