SA-MP Forums Archive
y_hook question - 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_hook question (/showthread.php?tid=553487)



y_hook question - PaulDinam - 30.12.2014

Is there a way to create a custom function like a timer that allows me to hook from different includes as if I would normally hook let's say.. OnPlayerConnect. And i'm using 4.0 of YSI.


Re: y_hook question - PaulDinam - 30.12.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
In 4.0, yes.
I haven't really been able to accomplish this goal, any way you could demonstrate something?


Re: y_hook question - PaulDinam - 30.12.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
OK, I don't know why, but hooked timers don't work. I honestly don't understand why - hooked custom functions called with "CallLocalFunction" work perfectly and I can't see any fundamental difference between the two...
Thank you for clearing this up.


Re: y_hook question - PaulDinam - 30.12.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
I am trying to figure the problem out, but I'm not at all sure what it could be!
If one day you'll find a solution for this, it'll be the best day of my life.


Re: y_hook question - PaulDinam - 30.12.2014

Right now, the way I use a single timer is with "CallRemoteFunction" to a function that's in another include for example an include of player's system with consists a login timer.

pawn Код:
public SecondTimer()
{
    // [ Login Timer ]
    CallRemoteFunction("HandleLoginTimer", "");
   
   
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(Player[i][isLogged])
        {
           
        }
    }
}