Andrew_Thiago Posted October 26, 2015 Share Posted October 26, 2015 (edited) Hi Sector! how are you? I have another great question to ask you, take a look at this: LEVELSTART phone1_mission1: ///Mission label // Mission begins here! SET mission1_failed = 0 //Doing that, i could restart the mission again setting the failed mission counter to zero isn't! DELAY_HERE (30) POINT_ARROW_AT ( ar1, phone01 ) DISPLAY_BRIEF (1019) ANSWER_PHONE ( boy , phone01 , 100 ) ///////////////////////////////////////////////////////////////////////////////////////////// WHILE_EXEC (onmission1 = 0) IF (CHECK_ANSWERED_PHONE(phone01)) truck1 = CREATE_CAR ( 84.7,149.8,2.0 ) 23 090 TRUKCAB2 TRUKTRNS END SET onmission1 = 2 STOP_PHONE ( phone01 ) DISPLAY_BRIEF (1020) DELAY_HERE (40) ++onmission1 ENDIF IF (CHECK_FAIL_PHONE_TIMER(phone01)) DISPLAY_BRIEF ( 1014 ) SET mission1_failed = 1 STOP_PHONE ( phone01 ) REMOVE_ARROW (ar1) RETURN // I can't make that command work properly! The script did not restart After not answer the phone. ENDIF ENDWHILE I just copied that script from another correct scripts, and then, i fixed some names etc.. But, even seeing how it works, if i failed to answer the phone, the script are not heading back to the mission label in the start. OBS: And, why we have to write for example: ++onmission1 in the middle of the script? If i take this out of my codes, the compile just don't compile my script. Thank you so much!, Andrew Thiago Edited October 26, 2015 by Andrew_Thiago Link to comment Share on other sites More sharing options...
Sektor Posted October 27, 2015 Share Posted October 27, 2015 (edited) ++onmission1 isn't needed and doesn't make any sense in that location. Not sure why that would stop you compiling, it didn't in my tests. I use mispad. RETURN won't do anything without GOSUB or a thread trigger. Instead of RETURN, you could try GOSUB phone1_mission1: Edited October 27, 2015 by Sektor Link to comment Share on other sites More sharing options...
Andrew_Thiago Posted October 27, 2015 Author Share Posted October 27, 2015 Yeah, but look: when i write GOSUB ... after the failed brief text, he points the phone again, but it creates a infinite loop that crash the game after 5 seconds. The same problem happens when i check if the vehicle is destroyed too. I created all the necesary counter, and his isn't the problem. Take at this: LEVELSTART ------------------------------------------------------------------------------------------------------------------------- mission1: //mission1 Label IF (mission1_failed = 1) //The the player failed the mission before. SET mission1_failed = 0 ENDIF ANSWER_PHONE ( boy , phone01 , 2000 ) POINT_ARROW_AT ( ar1, phone01 ) ENDIF WHILE_EXEC (onmission1 = 0) // He didn't answer the phone yet IF (CHECK_ANSWERED_PHONE(phone01)) //If he answer the phone REMOVE_ARROW (ar1) STOP_PHONE ( phone01 ) CLEAR_ALL_BRIEFS ( ) DISPLAY_BRIEF (1020) // Hello ..... SET onmission1 = 2 //This means he will be now doing that mission truck1 = CREATE_CAR ( 84.7,149.8,2.0 ) 23 090 TRUKCAB2 TRUKTRNS END //It's the truck who i must get in ENDIF IF ( ( CHECK_FAIL_PHONE_TIMER(phone01 )) //Did not answer the phone on the time AND ( mission1_failed = 0 )) SET mission1_failed = 1 STOP_PHONE ( phone01 ) REMOVE_ARROW (ar1) CLEAR_ALL_BRIEFS ( ) DISPLAY_MESSAGE ( 3730 )//You have failed the mission ... I learned yesterday that we must put the original failed brief text in the script to everything work properly. But now, the GOSUB aren't working right. GOSUB mission1: <----- //Is the " <---- GOSUB.." command on his right place in the end? Or must another problem? ENDWHILE <------------- ENDIF <----------- ///////////////////////////ANOTHER STUFFS.... OBS: If i fail to answer the phone or the mission vehicle is destroyed, the GOSUB really head back to the label in the beginning, but its creates a infinite loop, then crashing the game. That's the only problem that don't let me keep writing all the rest of the script that left for me to end Link to comment Share on other sites More sharing options...
Sektor Posted October 28, 2015 Share Posted October 28, 2015 PLAYER_PED boy = (82.10,148.3,2.0) 8 0 /////COUNTERS//// COUNTER onmission1 = 0 COUNTER inside_truck1 = 0 COUNTER mission1_completed = 0 COUNTER mission1_failed = 0 /////Vehicles/// CAR_DATA truck1 /////Phones//// OBJ_DATA phone01 = (82.7,148.25) 090 GREEN_PHONE ///Arrows// ARROW_DATA ar1 ARROW_DATA ar2 ARROW_DATA ar3 ARROW_DATA ar4 LEVELSTART // ------------------------------------------------------------------------------------------------------------------------- mission1: //mission1 Label IF (mission1_failed = 1) //The player failed the mission before. SET mission1_failed = 0 ENDIF ANSWER_PHONE ( boy , phone01 , 2000 ) POINT_ARROW_AT ( ar1, phone01 ) WHILE_EXEC (onmission1 = 0) // He didn't answer the phone yet IF (CHECK_ANSWERED_PHONE(phone01)) //If he answer the phone REMOVE_ARROW (ar1) STOP_PHONE ( phone01 ) CLEAR_ALL_BRIEFS ( ) DISPLAY_BRIEF (1020) // Hello ..... SET onmission1 = 2 //This means he will be now doing that mission truck1 = CREATE_CAR ( 84.7,149.8,2.0 ) 23 090 TRUKCAB2 TRUKTRNS END //It's the truck who i must get in ENDIF IF ( ( CHECK_FAIL_PHONE_TIMER(phone01 )) //Did not answer the phone on the time AND ( mission1_failed = 0 )) SET mission1_failed = 1 STOP_PHONE ( phone01 ) REMOVE_ARROW (ar1) CLEAR_ALL_BRIEFS ( ) DISPLAY_MESSAGE (3730)//You have failed the mission ... GOSUB mission1: ENDIF ENDWHILE LEVELEND Link to comment Share on other sites More sharing options...
Andrew_Thiago Posted October 28, 2015 Author Share Posted October 28, 2015 For GOD SAKE you're the man!! heh thank you so much!!! Now i guess i can go on!hehehe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now