SA-MP Forums Archive
y_hooks. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: y_hooks. (/showthread.php?tid=477014)



y_hooks. - PaulDinam - 21.11.2013

Can anyone please tell me what does y_hooks do? I've been looking around the forum but I couldn't find anything.


Re: y_hooks. - Patrick - 21.11.2013

Quote:
Originally Posted by ******
y_hooks - Hook any callback in one line!
y_hooks is for hooking a callback it's easier than using ALS_Hook

pawn Код:
#if defined _ALS_OnPlayerUpdate
    #undef OnPlayerUpdate
#else
    #define _ALS_OnPlayerUpdate
#endif
#define OnPlayerUpdate hook_OnPlayerUpdate
by using y_hook you could simple do this

pawn Код:
hook OnPlayerUpdate( parameters )
{

}
y_hooks: https://sampforum.blast.hk/showthread.php?tid=166016
ALS_Hook: https://sampforum.blast.hk/showthread.php?tid=441293


Re: y_hooks. - PaulDinam - 21.11.2013

So I can basically do something like, this correct?

pawn Код:
hook OnPlayerDeath(playerid, killerid, reason)
{
    SendClientMessage(playerid, -1, "You have died!");
}



Re: y_hooks. - -Prodigy- - 21.11.2013

Yes.