21.01.2014, 18:32
Sorry, I should report these all at once:
Syntax error on the next call line. Same if you do "const text[]".
Also:
I do hope you can fix these issues! It looks like a useful tool.
pawn Код:
public Hooked_OnPlayerText(playerid, text[])
{
//Your code here
//Call the new version and check if the definition does exist.
#if defined Hooked_OnPlayerText
OnPlayerText(playerid, text[]);
#endif
return true;
}
//Has this been hooked already?
#if defined _ALS_OnPlayerText
#undef OnPlayerText
#else
#define _ALS_OnPlayerText
#endif
//Reroute future calls to our function.
#define OnPlayerText Hooked_OnPlayerText
//To make sure there is no undefined error. we check if its defined.
#if defined Hooked_OnPlayerText
forward Hooked_OnPlayerText(playerid, text[]);
#endif
Also:
pawn Код:
stock Hooked_strcat(dest[], source[], maxlength = sizeof (dest))
{
//Your code here
//Call the old version, no need to check if it exists.
strcat(dest[], source[], maxlength = sizeof (dest));
return true;
}
//Has this been hooked already?
#if defined _ALS_strcat
#undef strcat
#else
#define _ALS_strcat
#endif
//Reroute future calls to our function.
#define strcat Hooked_strcat