Mind showing us some snippets to your code. Especially where it states that there is an error.
|
public OnPlayerConnect(playerid) { ResetData(playerid); return 1; } public ResetData(playerid) { Character[playerid] = resetCData; //sets all the value to 0. User[playerid] = resetUData; //sets all the value to 0. }
hook ResetData(playerid) { //reset data }
Just curious. In the modular script since you're re-defining ResetData(). Are you adding new functions to it. Or is it the same as the public one?
|
#include <a_samp> #include <mysql> #include <zcmd> #include <foreach> #include <YSI\y_timers> #include <YSI\y_hooks> public OnGameModeInit() { OnGameModeInitEx(); #if defined main_OnGameModeInit return main_OnGameModeInit(); #else return 1; #endif } #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit main_OnGameModeInit #if defined main_OnGameModeInit forward main_OnGameModeInit(); #endif main(){} /*====================================================================================================== [Modules] =======================================================================================================*/ //Player #include "core/player/data.pwn" //Vehicles #include "core/vehicles/data.pwn" /*====================================================================================================== [Main] ======================================================================================================*/ OnGameModeInitEx() { } main_OnGameModeInit() { ResetDataTest(); return 1; } public OnGameModeExit() { return 1; } Public:ResetDataTest() { printf("test1"); return 1; }
==========core/vehicles/data.pwn file=========== #include <YSI\y_hooks> hook OnGameModeInit() { print("core/vehicles/data.pwn loaded"); } hook ResetDataTest(){ printf("Data vehicles"); } ==========core/player/data.pwn file=========== #include <YSI\y_hooks> hook OnGameModeInit() { print("core/player/data.pwn loaded"); } hook ResetDataTest(){ printf("Data players"); }