Jump to content

Checking HUD


Dingleman

Recommended Posts

I have a script that adds a piece to the HUD in San Andreas. Thing is though, I would like to make it not appear when the Hud Mode in the options is set to off. I was wondering if there was any opcode that might check if the HUD is enabled so I could perhaps make an if statement at the beginning of the script such as "if, hud_enabled = 1, else_jump (Start of thread)" so it aborts the thread until the hud is actually enabled. If not, might there be a way around this that will achieve the same results?

 

Thanks in advance smile.gif

Link to comment
Share on other sites

 

 

:HudEnabledCheck0A8D: HUD_MODE = read_memory 0xBA6769 size 1 virtual_protect 0 if    HUD_MODE == 0 then   IS_HUD_ENABLED = FALSE else   IS_HUD_ENABLED = TRUE endreturn

 

 

so:

 

 

0A8D: 0@ = read_memory 0xBA6769 size 1 virtual_protect 0 if    0@ == 0 // hud turned offjf@whatsoeverjump@whereever 

 

 

if

0@ == 0 >>> hud turned off

0@ == 1 >>> hud turned on

 

thanks to Wesser (address and interpretatio taken from Windshield GUI sourcecode)

Edited by The_Siggi
Link to comment
Share on other sites

Wait, Wesser commited a little mistake here. It's a boolean, so you should read only 1 byte, not 4.

 

 

0A8D: 0@ = read_memory 0xBA6769 size 1 virtual_protect 0   

 

Link to comment
Share on other sites

That would explain why when I set it to check if "0@ == 1" it didn't work. I had it on "not 0@ == 0" instead tounge.gif

Link to comment
Share on other sites

Thanks for correcting that little mistake. Windshield GUI's source has to be reviewed a lil' but. tounge2.gif

Link to comment
Share on other sites

 

Thanks for correcting that little mistake. Windshield GUI's source has to be reviewed a lil' but. tounge2.gif

Oh yeah, also you'd use bits for these booleans, as I did in VCS HUD mod. Saves tons of space and global variables.

Link to comment
Share on other sites

The source code is dated 2 years ago, when I didn't know the use of bit-opcodes. wink.gif

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.