So, I need to use OnPublicCall in my plugin, where I use SAMPGDK as a dynamic library.
The signature is this one here:
PLUGIN_EXPORT bool PLUGIN_CALL OnPublicCall(AMX *amx, const char *name, cell *params, cell *retval)
Now, let's say I want hooked "OnPlayerText". Now, to my understand, params[0] contains the value 8, since there are two parameters - playerid and text.
How exactly do I get the real address of the text parameter? params[2] certainly does not contain the real address, since it's value is 0 and according to Y_Less, it's probably an offset.
Now, I've tried using amx_GetAddr, however, the server stops working on it's first invocation with
So, I need to use
OnPublicCall
in my plugin, where I use SAMPGDK as a dynamic library.The signature is this one here:
PLUGIN_EXPORT bool PLUGIN_CALL OnPublicCall(AMX *amx, const char *name, cell *params, cell *retval)
Now, let's say I want hooked "OnPlayerText". Now, to my understand, params[0] contains the value 8, since there are two parameters - playerid and text. How exactly do I get the real address of the text parameter? params[2] certainly does not contain the real address, since it's value is 0 and according to Y_Less, it's probably an offset.
Now, I've tried using amx_GetAddr, however, the server stops working on it's first invocation with
How exactly am I supposed to do this? I need the pointer to the beginning of the string.