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. Forum Support

    3. Suggestions

[SA] Area name text style with CLEO


inadequate
 Share

Recommended Posts

Is there a way to make to appear a custom text using the area name style text as SA uses with zones and interiors? I tried with 0A19 after pressing a key like a test but nothing appeared.

Link to comment
Share on other sites

Do you want to simply display area name itself or display texts that looks like area name?

If the latter, you should use text_draw opcodes.

{$CLEO .cs}0000:03F0: enable_text_draw 1    //  Set this early in script, before loop:Loopwait 0           if0AB0:   key_pressed 0x73jf @Loop0349: set_text_draw_font 0      //  0 : Zone name | 1 : Car name/Radio | 2 : Normal Text | 3 : Mission title033F: set_text_draw_letter_size 1.3 3.36    081C: draw_text_outline 1 RGBA 0 0 0 255 03E4: set_text_draw_align_right 10348: enable_text_draw_proportional 1       // If not set, usually spaces between characters are mess0340: set_text_draw_RGBA 180 180 180 255033E: set_draw_text_position 600.0 380.0 GXT 'MARKS'  // Saint Marksjump @Loop
Edited by MKKJ
Link to comment
Share on other sites

Ā 

{$CLEO}// GTA SA SCR mode// CLEO4// 1.0 US game0000:while true    0001: wait 0    if        0AB0: is_key_pressed 9 // VK_TAB    then        0AA5: call_function 0x718660 num_params 2 pop 2 params "My custom text" [email protected] // strcpy(&v2, "My custom text");        0A8D: read_memory 0xBAB1D8 size 4 vp 0 store_to [email protected] // v0 = CHud::m_pZoneName        if            [email protected] == 0 // if (v0 == nullptr)        then            0AA5: call_function 0x588BB0 num_params 2 pop 2 params 1 [email protected] // CHud::SetZoneName(&v2, true);        else            0AC7: get_var_pointer [email protected] store_to [email protected]           // v0 = &v2;            0A8C: write_memory 0xBAB1D0 size 4 val [email protected] vp 0 // CHud::m_pZoneToPrint = v0;            0A8C: write_memory 0xBAA938 size 4 val 0 vp 0  // CHud::m_ZoneNameTimer = 0;            0A8C: write_memory 0xBAA934 size 4 val 0 vp 0  // CHud::m_ZoneFadeTimer = 0;            0AA8: call_method_return 0x50ADE0 struct 0xB6F028 num_params 0 pop 0 store_to [email protected] // v0 = TheCamera.GetFading();            0AA8: call_method_return 0x50AE20 struct 0xB6F028 num_params 0 pop 0 store_to [email protected] // v1 = TheCamera.GetScreenFadeStatus();            if or // if (v0 != 0 || v1 == 2)                [email protected] <> 0                [email protected] == 2            then                0A8C: write_memory 0xBAA930 size 4 val 1 vp 0  // CHud::m_ZoneState = ZONE_DISPLAY;            else                0A8C: write_memory 0xBAA930 size 4 val 2 vp 0  // CHud::m_ZoneState = ZONE_FADE_IN;            end        end    endend
C++/plugin-sdk code

Ā 

#include "plugin.h"#include "game_sa\CHud.h"using namespace plugin;class MyCustomAreaText {public:    MyCustomAreaText() {        Events::processScriptsEvent += [] {            if (KeyPressed(VK_TAB)) {                char *text = "My custom text";                if (!CHud::m_pZoneName)                    CHud::SetZoneName(text, true);                else {                    patch::SetPointer(0xBAB1D0, text, false);                    CHud::m_ZoneNameTimer = 0;                    CHud::m_ZoneFadeTimer = 0;                    if (CallMethodAndReturn<unsigned char, 0x50ADE0>(0xB6F028) || CallMethodAndReturn<int, 0x50AE20>(0xB6F028) == 2)                        CHud::m_ZoneState = 1;                    else                        CHud::m_ZoneState = 2;                }            }        };    }} myPlugin;
Edited by DK22Pac
  • Like 1
Link to comment
Share on other sites

Thanks to both for his help. I'll go with DK's answer, it even includes the code for his SDK. :^:

Link to comment
Share on other sites

  • 4 years later...

Reposting an untested version of DK22Pac's cleo script with code tags repaired.

{$CLEO}
// GTA SA SCR mode
// CLEO4
// 1.0 US game

0000:

while true    
0001: wait 0
    if
        0AB0: is_key_pressed 9 // VK_TAB
    then
        0AA5: call_function 0x718660 num_params 2 pop 2 params "My custom text" [email protected] // strcpy(&v2, "My custom text");
        0A8D: read_memory 0xBAB1D8 size 4 vp 0 store_to [email protected] // v0 = CHud::m_pZoneName
        if
            [email protected] == 0 // if (v0 == nullptr)
        then
            0AA5: call_function 0x588BB0 num_params 2 pop 2 params 1 [email protected] // CHud::SetZoneName(&v2, true);
        else
            0AC7: get_var_pointer [email protected] store_to [email protected]           // v0 = &v2;
            0A8C: write_memory 0xBAB1D0 size 4 val [email protected] vp 0 // CHud::m_pZoneToPrint = v0;
            0A8C: write_memory 0xBAA938 size 4 val 0 vp 0  // CHud::m_ZoneNameTimer = 0;
            0A8C: write_memory 0xBAA934 size 4 val 0 vp 0  // CHud::m_ZoneFadeTimer = 0;
            0AA8: call_method_return 0x50ADE0 struct 0xB6F028 num_params 0 pop 0 store_to [email protected] // v0 = TheCamera.GetFading();
            0AA8: call_method_return 0x50AE20 struct 0xB6F028 num_params 0 pop 0 store_to [email protected] // v1 = TheCamera.GetScreenFadeStatus();

            if or // if (v0 != 0 || v1 == 2)
                [email protected] <> 0
                [email protected] == 2
            then
                0A8C: write_memory 0xBAA930 size 4 val 1 vp 0  // CHud::m_ZoneState = ZONE_DISPLAY;
            else
                0A8C: write_memory 0xBAA930 size 4 val 2 vp 0  // CHud::m_ZoneState = ZONE_FADE_IN;
            end
        end
    end
end

Ā 

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.