02.07.2012, 22:10
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?