My method to finding why your script freezes if there is a better method than this I would like to know! but this one seems pretty good for now
what you need:
below is the code I use currently that displays a message "break" for every line I put it on and also displays a message to press X to continue the loading process.
Now what I do is in every line from top to bottom (when I get a freeze) I insert DebugBreak("Name_To_display"); on top of the native or code being executedCode:#define DEBUG // If you have this at the top it will allow debug message to show , if you remove it they will be hidden/non function. void DebugBreak(char *sMessage){ #ifdef DEBUG PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", sMessage , 5000, 1); WAIT(800); PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", "DEBUG BREAK , PRESS X TO CONT" , 5000, 1); while(!IS_BUTTON_JUST_PRESSED(0,X)) WAIT(0); #endif }
like this:
Code:example void CheckPlayer(void){ DebugBreak("DOES_CHAR_EXIST"); if(DOES_CHAR_EXIST(GetPlayerPed())){ DebugBreak("IS_CHAR_DEAD"); if (IS_CHAR_DEAD(GetPlayerPed())){ DebugBreak("DOES_CHAR_EXIST "); if(DOES_CHAR_EXIST(GamePed)){ DebugBreak("etc "); EXPLODE_CHAR_HEAD(GamePed); DebugBreak("etc "); TASK_DIE(GamePed); DebugBreak("etc "); if(DOES_BLIP_EXIST(GamePedBlip)) DebugBreak("etc ");REMOVE_BLIP(GamePedBlip); if(DOES_BLIP_EXIST(Base)) DebugBreak("etc ");REMOVE_BLIP(Base); GameSwitch = 0; } } } }
thats pretty much it , compile it / run it / press x when it says and pay attention to the key words you picked to pinpoint you to the exact moments you freeze!


11Likes
LinkBack URL
About LinkBacks





