cardboardbox1230 Posted May 3, 2017 Share Posted May 3, 2017 (edited) Hello guys. gtav_clover here. I have a huge problem. Whenever I write code for a script, the game crashesafter the loading screen. Rarely my scripts work.The following code works, it is from my flashlight mod: // This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database/) on 29.4.2017 {$CLEO .cs}//-------------MAIN---------------THREAD 'CHELO'WAIT 0ENABLE_THREAD_SAVINGWAIT 0:CHELO_21WAIT 100IFPlayer.Defined($PLAYER_CHAR)ELSE_GOTO @CHELO_21IF and8965: not actor $PLAYER_ACTOR swimming09E7: player $PLAYER_CHAR not_frozenActor.HasWeapon($PLAYER_ACTOR, 13)KEY_PRESSED 49ELSE_GOTO @CHELO_210390: load_txd_dictionary "LIGHT"038F: load_texture "LIGHT_1" as 1 // Load dictionary with 0390 first038D: draw_texture 1 position 333.0 170.0 size 384.0 384.0 RGBA 255 255 255 25503E5: show_text_box 'ON':CHELO_142WAIT 100IFKEY_PRESSED 49ELSE_GOTO @CHELO_142JUMP @CHELO_168:CHELO_168WAIT 003E5: show_text_box 'OFF'WAIT 0ENABLE_TEXT_DRAW 0WAIT 00391: release_texturesWAIT 0JUMP @CHELO_21 The following code however, does not work: // This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database/) on 29.4.2017{$CLEO .cs}//-------------MAIN---------------THREAD 'NONAME':NONAME_11WAIT 0IFPlayer.Defined($PLAYER_CHAR)ELSE_GOTO @NONAME_11:NONAME_31IF0AD2: $actor = player $PLAYER_CHAR targeted_actor //IF and SETELSE_GOTO @NONAME_31$heal = Actor.Health($actor)IF051A: actor $actor damaged_by_actor $PLAYER_ACTORELSE_GOTO @NONAME_31$heal2 = Actor.Health($actor)0063: $heal2 -= $heal // (float)$healp = Actor.Health($PLAYER_CHAR)0058: $healp += $heal2 // (int)Actor.Health($PLAYER_ACTOR) = $healpJUMP @NONAME_11 Just checked. Even this code does not work: // This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database/) on 29.4.2017 {$CLEO .cs}//-------------MAIN---------------THREAD 'NONAME':NONAME_11WAIT 0IFPlayer.Defined($PLAYER_CHAR)ELSE_GOTO @NONAME_11:NONAME_31IF0AB0: key_pressed 49ELSE_GOTO @NONAME_3104C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_CHAR with_offset 0.0 0.0 0.002AB: set_actor $PLAYER_CHAR immunities BP 1 FP 1 EP 1 CP 1 MP 10565: create_soundless_explosion_at [email protected] [email protected] [email protected] type 7wait 100002AB: set_actor $PLAYER_CHAR immunities BP 0 FP 0 EP 0 CP 0 MP 0JUMP @NONAME_11 I have to edit others' scripts and most times even that does not work. Is it a syntax error? I don't know. Please help me! When I write a cleo script and the game crashes, I get really bummed out. If you do correct the code, please post the correct code and also explain so future mistakes are prevented. Thank you. Edited May 3, 2017 by gtav_clover Link to comment Share on other sites More sharing options...
madleg Posted May 3, 2017 Share Posted May 3, 2017 infinite loop in NONAME_31, add wait 0 right after label cardboardbox1230 1 Link to comment Share on other sites More sharing options...
cardboardbox1230 Posted May 3, 2017 Author Share Posted May 3, 2017 Thank you very much sir! You saved me! The game still crashes, but it's easier to debug 'cause the crash is after the script activates. I thought wait 0 wasn't important? Anyway, thanks again. 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