Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[SA] help attach text to player


zag40
 Share

Recommended Posts

Can anyone help me? I tried to attach text to player actor, like making the text move around with the actor with coords but the text didn't show up. Any idea how to do it? Here's what i'm working on

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.8 0.8 [email protected] = Actor.Health($PLAYER_ACTOR)03E4: set_text_draw_align_right 10340: set_text_draw_RGBA 0 128 64 255 033F: set_text_draw_letter_size 0.35 0.8081C: draw_text_outline 1 RGBA 0 128 64 400349: set_text_draw_font 103E0: draw_text_behind_textures 1  045A: draw_text_1number [email protected] [email protected] GXT 'NUMBER' number [email protected]

Thank you.

Link to comment
Share on other sites

Put this inside your thread:

0000: NOP03F0: enable_text_draw 1 while true wait 0  04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1.0  //0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ [email protected] [email protected] [email protected] store_to [email protected] [email protected]  //0AB1: call_scm_func @get3DCoordsFromScreenXY 3 coords_XY [email protected] [email protected] distance 1.0 store_camera_to [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected]  0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ [email protected] [email protected] [email protected] store_to [email protected] [email protected]  054C: use_GXT_table 'SWEET6'  0341: unknown_text_draw_flag 0  0342: enable_text_draw_centered 1  033E: set_draw_text_position [email protected] [email protected] GXT 'SWE6B34' end


And this outside your thread:

 

:getScreenXYFrom3DCoords{ Parameters:   Passed:     [email protected] - position X     [email protected] - position Y     [email protected] - position Z   Result:     [email protected] - screen X     [email protected] - screen Y Example:   0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 2488.562 -1666.865 12.8757 store_to [email protected] [email protected] }0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 3 store_to [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 5 store_to [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 6 store_to [email protected] 0AA5: call 0x70CE30 num_params 6 pop 6 bFarClip 0 bNearClip 0 pMultY [email protected] pMultX [email protected] pScreen [email protected] pCoords [email protected] 0AB1: call_scm_func @getScreenXY 2 coords_XY [email protected] [email protected] store_to [email protected] [email protected] 0AB2: ret 2 [email protected] [email protected] :get3DCoordsFromScreenXY{ Parameters:   Passed:     [email protected] - screen X     [email protected] - screen Y     [email protected] - distance   Result:     [email protected] - camera X     [email protected] - camera Y     [email protected] - camera Z     [email protected] - position X     [email protected] - position Y     [email protected] - position Z Example:   0AB1: call_scm_func @get3DCoordsFromScreenXY 3 coords_XY 320.0 224.0 distance 1.0 store_camera_to [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected] }0A8D: [email protected] = read_memory 0x8D5038 size 4 virtual_protect 0 // field of [email protected] *= 0.5 02F6: [email protected] = sine [email protected] 02F7: [email protected] = cosine [email protected] 0073: [email protected] /= [email protected] // tangent line0A8D: [email protected] = read_memory 0x865394 size 4 virtual_protect 0 // half screen X scale006B: [email protected] *= [email protected] [email protected] -= 1.0 0097: make [email protected] absolute_float006B: [email protected] *= [email protected] 0A8D: [email protected] = read_memory 0x865398 size 4 virtual_protect 0 // half screen Y scale006B: [email protected] *= [email protected] [email protected] -= 1.0 0097: make [email protected] absolute_float006B: [email protected] *= [email protected] 0A8D: [email protected] = read_memory 0xC3EFA4 size 4 virtual_protect 0 // screen aspect ratio0073: [email protected] /= [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 9 store_to [email protected] 0A8D: [email protected] = read_memory 0xB6F03C size 4 virtual_protect 0 // camera matrix0AA5: call 0x59C890 num_params 3 pop 3 pOffsets [email protected] pMatrix [email protected] pPoint [email protected] // CPlaceable__transformPoint006B: [email protected] *= [email protected] 006B: [email protected] *= [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0087: [email protected] = [email protected] 0AB1: call_scm_func @getLocalVarOffset 1 var 14 store_to [email protected] 0AA5: call 0x59C890 num_params 3 pop 3 pOffsets [email protected] pMatrix [email protected] pPoint [email protected] // CPlaceable__transformPoint0AB2: ret 6 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] :getScreenXY{ Parameters:   Passed:     [email protected] - full screen X     [email protected] - full screen Y   Result:     [email protected] - screen X     [email protected] - screen Y Example:   0AB1: call_scm_func @getScreenXY 2 coords_XY 512.0 384.0 store_to [email protected] [email protected] }0A8D: [email protected] = read_memory 0xC17044 size 4 virtual_protect 0 // full screen X0A8D: [email protected] = read_memory 0x859520 size 4 virtual_protect 0 // screen X scale0093: [email protected] = integer [email protected] to_float006B: [email protected] *= [email protected] 0073: [email protected] /= [email protected] 0A8D: [email protected] = read_memory 0xC17048 size 4 virtual_protect 0 // full screen Y0A8D: [email protected] = read_memory 0x859524 size 4 virtual_protect 0 // screen Y scale0093: [email protected] = integer [email protected] to_float006B: [email protected] *= [email protected] 0073: [email protected] /= [email protected] 0AB2: ret 2 [email protected] [email protected] :getLocalVarOffset{ Parameters:   Passed:     [email protected] - var number   Result:     [email protected] - var pointer Example:   0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to [email protected] }[email protected] *= 0x4 0A9F: [email protected] = current_thread_pointer0A8E: [email protected] = [email protected] + 0xDC 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 // bMissionFlagif  [email protected] == 1 then [email protected] += 0xA48960 // pMissionLocalselse 005A: [email protected] += [email protected]  [email protected] += 0x3C // pThreadLocalsend0AB2: ret 1 [email protected] 

 


Do not thank me for this, all credits should go to @Wesser : Source

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
 Share

  • 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.