18.05.2015, 08:59
Quote:
Код:
public OnPlayerConnect(playerid) { #if defined MyLib_OnPlayerConnect MyLib_OnPlayerConnect(playerid); #endif return 1; } #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect MyLib_OnPlayerConnect #if defined MyLib_OnPlayerConnect forward MyLib_OnPlayerConnect(playerid); #endif Код:
public OnPlayerConnect(playerid) { #if defined MyLib_OnPlayerConnect MyLib_OnPlayerConnect(playerid); #else return 1; #endif } #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect MyLib_OnPlayerConnect #if defined MyLib_OnPlayerConnect forward MyLib_OnPlayerConnect(playerid); #endif |
Код:
public OnPlayerConnect(playerid) { #if defined MyLib_OnPlayerConnect return MyLib_OnPlayerConnect(playerid); #else return 1; #endif } #if defined _ALS_OnPlayerConnect #undef OnPlayerConnect #else #define _ALS_OnPlayerConnect #endif #define OnPlayerConnect MyLib_OnPlayerConnect #if defined MyLib_OnPlayerConnect forward MyLib_OnPlayerConnect(playerid); #endif
Returning 1 will allow the callback to be called in other scripts.If you don't return anything, I don't know what will happen.I guess what ever was stored in pri just before returning will be returned.Or maybe pri is zeroed before returning.
Someone please let me know.