How to hook ?
#2

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
What?Every gamemode has OnPlayerConnect,even the filterscripts,what you're trying to do?
..? Read the topic - he wants to HOOK it in an INCLUDE.

You can either use y_hooks (part of YSI) which makes it extremely easy to hook, i.e.
pawn Код:
Hook:blahblahyoucanputwhateveryoulikehere_OnPlayerConnect(playerid)
{
    // Your shit
    return 1;
}
But that will require people to download YSI. If you wanted, you can just use ALS code, like so:

pawn Код:
public blahblah_OnPlayerConnect(playerid)
{
    // Your shit
    return CallLocalFunction("blahblah_OnPlayerConnect", "i", playerid); // Hooking method
}
#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect blahblah_OnPlayerConnect
forward blahblah_OnPlayerConnect(playerid);
A bit more 'complex' as it were, but it will save people have to download YSI.
Reply


Messages In This Thread
How to hook ? - by Saad_ - 08.06.2012, 19:13
Re: How to hook ? - by MP2 - 08.06.2012, 19:21
Re: How to hook ? - by Saad_ - 08.06.2012, 19:22
Re: How to hook ? - by MP2 - 08.06.2012, 19:24
Re: How to hook ? - by Saad_ - 08.06.2012, 20:05

Forum Jump:


Users browsing this thread: 4 Guest(s)