[Include] pause.inc (Check for players pause/AFK status.)
#4

Okay so CallLocalFunction is slower than a direct call, so if i were you i'd do it like this:

Код:
#if defined OnPlayerPause
    OnPlayerPause(playerid);
#endif
then anywhere in the include just forward it with a check as well.

Код:
#if defined OnPlayerPause
    forward OnPlayerPause(playerid);
#endif
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:
Код:
#if defined afkChecker_included_
    #endinput
#endif

#define afkChecker_included_
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)