inadequate Posted August 6, 2017 Share Posted August 6, 2017 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 More sharing options...
MKKJ Posted August 7, 2017 Share Posted August 7, 2017 (edited) 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 August 7, 2017 by MKKJ inadequate 1 Link to comment Share on other sites More sharing options...
DK22Pac Posted August 7, 2017 Share Posted August 7, 2017 (edited) Ā {$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 endendC++/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 August 7, 2017 by DK22Pac RyanDri3957V 1 Link to comment Share on other sites More sharing options...
inadequate Posted August 7, 2017 Author Share Posted August 7, 2017 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 More sharing options...
OrionSR Posted May 13, 2022 Share Posted May 13, 2022 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 Ā Wesser 1 Link to comment Share on other sites More sharing options...