How to hook ?
#1

Hello guys i want to create an include that has OnPlayerConnect and my GM already has it so how do i hook eachother
Reply
#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
#3

yes man thx
Reply
#4

Made an error - re-check my post.
Reply
#5

i think i will go with y hooks and save all the hassle anyways thx again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)