starlone Posted May 4, 2018 Share Posted May 4, 2018 I've been looking at some other speedometer mods but almost all of them disabled if on mission (using the conditional $ONMISSION == 0 ). I want to enable it on missions too, so i did not include this line. However the speedometer is now still displayed during cutscenes (if CJ is on vehicle), even though the HUDs and radar is already hidden. It becomes ugly since there is no radar and overlapping with the cutscene's black bar and subtitle text. can anyone please correct this CLEO code? I just want to disable that speedometer during cutscenes, but still enabled on missions. here's the code (the first half of the code I took from Wesser's ZoneText mod): {$CLEO .cs}const WIDESCREEN_STATUS = [email protected] IS_IN_WIDESCREEN = [email protected] IS_IN_CUTSCENE = [email protected] RADAR_MODE = [email protected] RADAR_ENABLED = [email protected] IS_RADAR_ONSCREEN = [email protected]//-------------MAIN--------------- IS_IN_WIDESCREEN = FALSE IS_IN_CUTSCENE = FALSE IS_RADAR_ONSCREEN = TRUE0000: Starting code...while true wait 0 gosub @WideScreenCheck gosub @CutsceneCheck gosub @GetRadarOnScreen if or IS_IN_WIDESCREEN == TRUE IS_IN_CUTSCENE == TRUE IS_RADAR_ONSCREEN == FALSE then gosub @ENDING else gosub @LOAD endend :WideScreenCheck0A8D: WIDESCREEN_STATUS = read_memory 0xB6F065 size 4 virtual_protect 0 if WIDESCREEN_STATUS == 1 then IS_IN_WIDESCREEN = TRUE else IS_IN_WIDESCREEN = FALSE endreturn:CutsceneCheckif 06B9: cutscene_data_loaded then if 82E9: not cutscene_reached_end then IS_IN_CUTSCENE = TRUE endelse IS_IN_CUTSCENE = FALSE endreturn:GetRadarOnScreen0A8D: RADAR_MODE = read_memory 0xBA676C size 4 virtual_protect 0 0A8D: RADAR_ENABLED = read_memory 0xBAA3FB size 4 virtual_protect 0 if and RADAR_MODE == 2 RADAR_ENABLED == 0 then IS_RADAR_ONSCREEN = FALSE else IS_RADAR_ONSCREEN = TRUE endreturn:LOADwait 0if and Player.Defined($PLAYER_CHAR) Actor.Driving($PLAYER_ACTOR)jf @ENDING $12410 = Actor.CurrentCar($PLAYER_ACTOR) 0390: load_txd_dictionary "SPEEDOM" 038F: load_texture "STRELK" as 1 // Load dictionary with 0390 first 038F: load_texture "SPEEDO1" as 2 // Load dictionary with 0390 first jump @SPEEDO:SPEEDOwait 0 056E: car $12410 defined not Car.Wrecked($12410) not Actor.Dead($PLAYER_ACTOR) 8965: not actor $PLAYER_ACTOR swimming Actor.Driving($PLAYER_ACTOR)jf @ENDINGif and IS_IN_WIDESCREEN == FALSE IS_IN_CUTSCENE == FALSE IS_RADAR_ONSCREEN == TRUEthen 02E3: $12412 = car $12410 speed $12412 *= 2.4 02E3: $12413 = car $12410 speed $12413 *= 2.67 008C: $12413 = float $12413 to_integer 0227: [email protected] = car $12410 health [email protected] /= 10.0 03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 2 position 102.2 365.0 size 220.0 220.0 RGBA 255 255 255 255 03E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 1 position 102.2 361.0 scale 220.0 220.0 angle $12412 RGBA 255 255 255 255 03F0: enable_text_draw 1 0349: set_text_draw_font 2 03E4: set_text_draw_align_right 1 060D: draw_text_shadow 0 rgba 225 225 225 225 0340: set_text_draw_RGBA 225 225 225 255 033F: set_text_draw_letter_size 0.5 1.9 045A: draw_text_1number 195.0 372.0 GXT 'MTR_1' number $12413 03E4: set_text_draw_align_right 1 060D: draw_text_shadow 0 rgba 225 225 225 225 033E: set_draw_text_position 195.0 387.0 GXT 'MTR_2' 0349: set_text_draw_font 2 033F: set_text_draw_letter_size 0.3 1.6 03E4: set_text_draw_align_right 1 060D: draw_text_shadow 0 rgba 225 225 225 225 0340: set_text_draw_RGBA 225 225 225 255 045A: draw_text_1number 170.0 410.0 GXT 'MTR_3' number [email protected] jump @SPEEDOelse jump @ENDINGend:ENDINGCar.RemoveReferences($12410)0391: release_textures return I don't have much knowledge about CLEO coding (or any coding at all) but really interested with GTA modding, particularly San Andreas. I only know about basic stuff, that's why I can only copy other's code and then modify it. so I hope anyone can correct the mistakes in this code or give me a better/simpler code for this issue. Thanks. Link to comment Share on other sites More sharing options...
Sloth- Posted May 4, 2018 Share Posted May 4, 2018 When your code jumps to label @SPEEDO you are entering in a new loop. So you are not checking the Widescreen/Radar/Cutscenes conditions in your previous loop. Just add those checkings in your new loop: :SPEEDOwait 0 056E: car $12410 defined not Car.Wrecked($12410) not Actor.Dead($PLAYER_ACTOR) 8965: not actor $PLAYER_ACTOR swimming Actor.Driving($PLAYER_ACTOR)jf @ENDINGgosub @WideScreenCheckgosub @CutsceneCheckgosub @GetRadarOnScreenif and IS_IN_WIDESCREEN == FALSE IS_IN_CUTSCENE == FALSE IS_RADAR_ONSCREEN == TRUEthen // .... Link to comment Share on other sites More sharing options...
starlone Posted May 4, 2018 Author Share Posted May 4, 2018 (edited) thanks, i will try. ---- edit: It works! thank you very much Edited May 4, 2018 by starlone 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