Question about includes
#1

Hi, I'm making my own includes with my own custom functions, so when I script a gamemode I just use #include as always, and then I just call those functions wherever I want to. The thing is, I want some of those functions to be called only in some specific callbacks and nowhere else. Is there any way I can write the include so those functions will be called automatically in the callback I want, without having to manually add a line in that callback to call the function? For example, imagine that I have an include named "my_include", which has a function named "MyFunction". Now imagine that I want that function to be called in OnPlayerSpawn, and in no other callback than that. What I'm currently doing is writing #include <my_include> in my gamemode, and then adding MyFunction(playerid); in OnPlayerSpawn. How can I make it so just writing #include <my_include> will be enough?
Reply
#2

ALS callback hooking. Search for that.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
ALS callback hooking. Search for that.
Thank you.
I have just found this: https://sampforum.blast.hk/showthread.php?tid=85907 but seems a bit hard, doesn't it?
Reply
#4

I think I have already solved it, thank you Vince, +1 rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)