08.10.2018, 23:06
Okay so CallLocalFunction is slower than a direct call, so if i were you i'd do it like this:
then anywhere in the include just forward it with a check as well.
instead of the CallLocalFunction usage and you didn't forward the function.
You should also mention the usage of y_hooks along with the credits in the post. There's also the protection against double including, this:
Also i don't recommend Emmet_'s include at all, it's outdated and needs an update. It has useful code but i wouldn't use it for one function and if i do ever use it it'll still need an update for functions parameters alongside a few more things.
Here's my implementation for an afk checker with a pause checker too. LINK
Код:
#if defined OnPlayerPause OnPlayerPause(playerid); #endif
Код:
#if defined OnPlayerPause forward OnPlayerPause(playerid); #endif
You should also mention the usage of y_hooks along with the credits in the post. There's also the protection against double including, this:
Код:
#if defined afkChecker_included_ #endinput #endif #define afkChecker_included_
Here's my implementation for an afk checker with a pause checker too. LINK