aStiffSausage Posted June 30, 2011 Share Posted June 30, 2011 I added engine on/off display on speedometer, which worked fine. I tried to make engine on/off display as invidual script, so you can choose if you want it or not. But after I "ripped" the script to it's own script, it now crashes in few seconds after I get in. It works perfectly if I'm not using the engine-display... {$CLEO .cs}0000: NOP 0A95: enable_thread_saving :Check0001: wait 0 ms 00D6: if and00DF: actor $PLAYER_ACTOR driving 0038: $ACTIVE_INTERIOR == 0 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 84A7: not actor $PLAYER_ACTOR driving_boat 004D: jump_if_false @Check 0811: [email protected] = actor $PLAYER_ACTOR car // versionC 0390: load_txd_dictionary "SPEED1" 038F: load_texture "ENGOFF" as 20 // Load dictionary with 0390 first 038F: load_texture "ENGON" as 21 // Load dictionary with 0390 first 038F: load_texture "BACKTINY" as 22 // Load dictionary with 0390 first 038F: load_texture "BACKTINYN" as 23 // Load dictionary with 0390 first 0001: wait 0 ms 0002: jump @Day:Day0001: wait 0 ms 00D6: if and00DF: actor $PLAYER_ACTOR driving 0038: $ACTIVE_INTERIOR == 0 004D: jump_if_false @NotDriving 00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes 00D6: if and0029: [email protected] >= 6 001B: 20 > [email protected] 004D: jump_if_false @Night0227: [email protected] = car [email protected] health0017: [email protected] /= 3.9215687 0227: [email protected] = car [email protected] health 0017: [email protected] /= 3.92156870012: [email protected] *= -103E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 22 position 450.0 360.0 size 40.0 40.0 RGBA 255 255 255 255jump @EngineCheck :EngineCheckif0ABE: vehicle [email protected] engine_onelse_jump @EngineOffDay03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 21 position 450.0 360.0 size 40.0 40.0 RGBA [email protected] [email protected] 0 255 jump @NONAME_704:EngineOffDay03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 20 position 450.0 360.0 size 40.0 40.0 RGBA [email protected] [email protected] 0 255 jump @NONAME_704:NONAME_70400D6: if 03C9: car [email protected] damaged 004D: jump_if_false @Day0003: shake_camera 40 //03E3: set_texture_to_be_drawn_antialiased 1 //038D: draw_texture 19 position [email protected] [email protected] size 140.0 [email protected] RGBA 255 255 255 255 0002: jump @Day:Night0001: wait 0 ms 00D6: if and00DF: actor $PLAYER_ACTOR driving 0038: $ACTIVE_INTERIOR == 0 004D: jump_if_false @NotDriving00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes 00D6: if or0029: [email protected] >= 20 001B: 6 > [email protected]: jump_if_false @Day0227: [email protected] = car [email protected] health0017: [email protected] /= 3.9215687 0227: [email protected] = car [email protected] health 0017: [email protected] /= 3.92156870012: [email protected] *= -103E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 22 position 450.0 360.0 size 40.0 40.0 RGBA 255 255 255 255jump @EngineCheckNight :EngineCheckNightif0ABE: vehicle [email protected] engine_onelse_jump @EngineOffNight03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 21 position 450.0 360.0 size 40.0 40.0 RGBA [email protected] [email protected] 0 255jump @NightDamage:EngineOffNight03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 20 position 450.0 360.0 size 40.0 40.0 RGBA [email protected] [email protected] 0 255 jump @NightDamage:NightDamage00D6: if 03C9: car [email protected] damaged 004D: jump_if_false @Night0003: shake_camera 40 //03E3: set_texture_to_be_drawn_antialiased 1 //038D: draw_texture 19 position [email protected] [email protected] size 140.0 [email protected] RGBA 255 255 255 2550002: jump @Night:NotDriving0001: wait 0 ms 03F0: enable_text_draw 0 0002: jump @Check Link to comment Share on other sites More sharing options...
UNRATED69 Posted June 30, 2011 Share Posted June 30, 2011 You never enabled text draw. 03F0: enable_text_draw 1 Link to comment Share on other sites More sharing options...
aStiffSausage Posted June 30, 2011 Author Share Posted June 30, 2011 (edited) You never enabled text draw. 03F0: enable_text_draw 1 Ahhh, the basics... Thanks a lot, I wouldn't have noticed that one Btw, how can I check if HUD is enabled? Didn't find any opcodes for it... Would this work? $HUD == 1 And one more thing... How I can get current car's name and current area/location? I mean a bit like Wesser's Windshield GUI and ZoneText-mods, but without using he's scripts (too complex for me) Edited June 30, 2011 by oksa8 Link to comment Share on other sites More sharing options...
fastman92 Posted June 30, 2011 Share Posted June 30, 2011 Btw, how can I check if HUD is enabled? Didn't find any opcodes for it... 0A8D: [email protected] = read_memory 0xBA6769 size 1 virtual_protect 0 // Is HUD enabled in display options0A8D: [email protected] = read_memory 0xA444A0 size 1 virtual_protect 0 // Is HUD enabled by an opcode 0826// These memory addresses work on GTA San Andreas v1.0 [uS] HOODLUM No-CD Fixed EXEif [email protected] == [email protected] == trueelse_jump @disabled_hud // HUD is disabled.... Link to comment Share on other sites More sharing options...
aStiffSausage Posted June 30, 2011 Author Share Posted June 30, 2011 (edited) Btw, how can I check if HUD is enabled? Didn't find any opcodes for it... 0A8D: [email protected] = read_memory 0xBA6769 size 1 virtual_protect 0 // Is HUD enabled in display options0A8D: [email protected] = read_memory 0xA444A0 size 1 virtual_protect 0 // Is HUD enabled by an opcode 0826// These memory addresses work on GTA San Andreas v1.0 [uS] HOODLUM No-CD Fixed EXEif [email protected] == [email protected] == trueelse_jump @disabled_hud // HUD is disabled.... Thank you once again... Maybe I should also try GTAModding for answers? @fastman92 Some time ago you posted this little "script"... 0A97: [email protected] = car [email protected] struct [email protected] += 1412 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 No complaining, I've managed to got it to work, but instead of 1/0, what you told it to be, it seems to have multiple values depending on which lights are shown. For example, 0 means no lights visible, but it also happens when you've broken both front lamps and watch the vehicle from front. And if value is 15, you're watching the vehicle from back with all lights functioning, but if you change camera to the front, it will change to 3. Is there any other way to check if lights are on? Edited June 30, 2011 by oksa8 Link to comment Share on other sites More sharing options...
aStiffSausage Posted July 4, 2011 Author Share Posted July 4, 2011 (edited) Little bump... I'm still figuring out how I can check if car has lights enabled, which isn't functioning as wierdly as the code-snippet posted above... EDIT: Finally. After months of waiting, I got my speedlimit mod to work I still need help with it... How I can check if player is on a freeway (motorway, highway, what's it called?)? What are the names of "special" clothes received from girlfriends? Hopefully you can answer me soon Edited July 5, 2011 by oksa8 Link to comment Share on other sites More sharing options...
fastman92 Posted July 6, 2011 Share Posted July 6, 2011 0A97: [email protected] = car [email protected] [email protected] += 14120A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0{states:0: Default - off in day and off at night1: Off, no matter what time2: On, no matter what time} if or [email protected] == 0 // Lights default - off in day and off at night [email protected] == 1 // Lights off, no matter what time then 067F: set_car [email protected] lights 2 00BC: show_text_highpriority GXT 'LIGHTON' time long_comunique flag 1 else 067F: set_car [email protected] lights 1 00BC: show_text_highpriority GXT 'LIGHTOF' time long_comunique flag 1 end Part of Remote lock car 3.6 Link to comment Share on other sites More sharing options...
aStiffSausage Posted July 7, 2011 Author Share Posted July 7, 2011 Fastman92 0A97: [email protected] = car [email protected] [email protected] += 14120A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 If you display that on screen, you'll see values aren't 0/1/2, they depend from various things: If light is damaged, if camera is pointed from front, and each light has different value. If all lights are on and camera is pointed from behind, value is 15 If all lights are on, but camera is pointed from front, value is 3 And so on, but that isn't really suitable as a check if you need to display texture on-screen all the time, as if you spin camera and your headlights are broken, the texture would be changing... Is there any way to fix that camera-turning? Or to check if rear-lights aren't damaged? As those might help a lot 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