Anon123r Posted April 12, 2021 Share Posted April 12, 2021 Hello . The information I am looking for is: is it possible to change the time at which the next message 'Our hood is under atack' appears via a Cleo script? And one more thing: I'm looking for information on all gang zone codes (BLS: LSV: GSF). For example - Glen Park: GLN1, GL2A ... There are some codes that I can't find anywhere, but I need for a new script. Thanks for the help and attention: Anonymous. Link to comment Share on other sites More sharing options...
OrionSR Posted April 12, 2021 Share Posted April 12, 2021 float &CGangWars::TimeTillNextAttack = *reinterpret_cast<float *>(GLOBAL_ADDRESS_BY_VERSION(0x96AB48, 0, 0, 0, 0, 0)); Ref: link Ref: link Link to comment Share on other sites More sharing options...
Anon123r Posted April 13, 2021 Author Share Posted April 13, 2021 None of these scripts work. And the ones from git hub didn't even compile. I use Sanny Buid3. Before giving a script, test it first. Link to comment Share on other sites More sharing options...
OrionSR Posted April 13, 2021 Share Posted April 13, 2021 (edited) The github reference is to DK22pac's SA Plugin. These aren't cleo codes, but they provide the most official reference for field names and memory offsets. The link was included to make it easier to find other gangwar data in memory. The important info from the line I posted is; float: specifies the size (4 bytes) and type (floating point - includes a decimal point) of data. TimeTillNextAttack: most "official" name of this field to allow for consistent referencing. Probably not R* official though. 0x96AB48: offset of data. Use this address with memory read/write opcodes. //0A8C: write_memory 0x96ab48 size 4 value 25000.0 virtual_protect 0 // Set Next Attack Time 0A8C: write_memory 0x96ab48 size 4 value 0.0 virtual_protect 0 // Clear Next Attack Time These codes have been tested and work as expected on PC, but this is not a complete cleo script. You'll need to wrap this code in a larger script that decides when the code should activate. For example, execute only when the cheat string "ATTACK" has been typed. If these codes are giving you trouble then post your complete script. Also be sure to read the details in the last post of that topic in the second ref. Your results can vary based on factors like; CJ is on a mission, in an interior, driving an aircraft, or is not in Los Santos. Added: For information on how gangs are assigned to zones search for opcodes similar to this example in a decompiled main.scm. 076C: set_zone 'SUN1' gang 1 density_to 30 Edited April 13, 2021 by OrionSR Link to comment Share on other sites More sharing options...
Anon123r Posted April 14, 2021 Author Share Posted April 14, 2021 {$CLEO .csi} :DEMOTEXT 03A4: name_thread "DEMO" wait 1000 :DEMOTEXT_1 wait 0 if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @DEMOTEXT_1 0A8C: write_memory 0x96ab48 size 4 value 2500.0 virtual_protect 0 // Set Next Attack Time 0A8C: write_memory 0x96ab48 size 4 value 2500.0 virtual_protect 0 // Clear Next Attack Time 0A95: enable_thread_saving 0A93: end_custom_thread ________________ This is the script I tested. I changed the number to 0x96ab48 from small to large. Result: When activating the script, the time of the next attack by BLS and LSV did not change at all. I opened a save file, and tried to activate the script in order to: immediately receive an attack from other gangs (24-30 seconds is the time required to receive an attack message after leaving the internal space in a file in which an attack is already set). Result: Absolutely nothing happened, and I did not receive an attack within 24 seconds, but as usual - (Need to spend hours in Los Santos to receive the next attack message.) Well, is the error in the number 0x96ab48? Or is the script totally wrong? Test the script. When you manage to write a script to activate an attack from BLS :: LSV within 20-30 seconds after its inclusion in SA - write it here. On 4/12/2021 at 10:37 PM, OrionSR said: float &CGangWars::TimeTillNextAttack Link to comment Share on other sites More sharing options...
In45do Posted April 14, 2021 Share Posted April 14, 2021 OrionSR was providing the correct memory address to cycle the next gang attack. Here is my take to refresh the gang attack: {$CLEO .cs} thread 'gang_attack' :Start wait 0 if 0ADC: test_cheat "GANG" // Type GANG in the game, make sure your player is in the Los Santos area! jf @Start 0ACA: show_text_box "5 SECONDS" 0A8C: write_memory 0x96ab48 size 4 value 5000.0 virtual_protect 0 // Set Next Attack Time [email protected] = 0 :End wait 0 if [email protected] >= 5000 // wait for 5 seconds jf @End 0ACA: show_text_box "GANG ATTACK!" jump @Start OrionSR 1 Link to comment Share on other sites More sharing options...
OrionSR Posted April 14, 2021 Share Posted April 14, 2021 9 hours ago, Anon123r said: Result: When activating the script, the time of the next attack by BLS and LSV did not change at all. Nice try on your cleo script. It didn't work as hoped by served the purpose of giving helpers something to build on. A few comments: You set a next attack time of 2.5 seconds. I don't know why milliseconds are stored as a float here but, gotta work with what we've got. You probably loaded a save in an LS interior. The interior location would reset your value to 30 seconds until CJ was outside again. Thread saving was enabled and the script was ended. Cleo saves will remember the script has ended so it'll only work once. The assumptions are that the test save has gang wars enabled, and there is sufficient gang density in adjacent zones so that gang attacks occur normally if you just wait long enough. Also, CJ can't be standing in the only zone available for attack. In45do's script looks like a good test example that would be easy to adapt to your purpose. One issue, the 5 second delay for LS should take 83 seconds to count down if CJ is out of town. Link to comment Share on other sites More sharing options...
Anon123r Posted April 15, 2021 Author Share Posted April 15, 2021 (edited) All this scripts work only in PC version guys . And the commands are avilable only for pc cleo . When I go to Mobile Cleo , sb says , that this script is for pc not android . So is it possible to convert pc cleo to android . Or translate full script to android script ?(.cs to .csi/csa) Quote 0DD9: write_mem_addr 0x00510D60 value 800000.0 size 4 add_ib 1 protect 1 // Is this gonna work for Android Cleo folks ? Edited April 15, 2021 by Anon123r Link to comment Share on other sites More sharing options...
OrionSR Posted April 15, 2021 Share Posted April 15, 2021 On Android the process is a little trickier because hard coded offsets are version specific. There's an elaborate process for finding the correct address for any version. It's also a bit easier because the script can be launched from the Cleo Menu so a cheat string or keypress routine isn't necessary. The script can end and be relaunched as needed. This script has not been tested, but should trigger an immediate gang attack on Android when launched from the Cleo Menu under the correct conditions. A couple seconds later a Load Successful message is displayed and a sound will play to confirm that the script has executed; these "bells and whistles" are optional. I usually include them in all test scripts. {$CLEO .csi} //NextAttack.txt 03A4: name_thread 'Attack' 0001: wait 0 ms 0DD0: [email protected] = get_label_addr @_ZN9CGangWars18TimeTillNextAttackE 0DD1: [email protected] = get_func_addr_by_cstr_name [email protected] // TimeTillNextAttack 0DD9: write_memory [email protected] value 0.0 size 4 add_ib 0 protect 0 0001: wait 2000 ms 00BA: show_text_styled GXT 'FESZ_LS' time 2000 style 4 // Load Successful. 09F1: play_audio_at_actor $PLAYER_ACTOR event 1133 // SOUND_BUY_CAR_MOD 004E: end_thread :_ZN9CGangWars18TimeTillNextAttackE hex "_ZN9CGangWars18TimeTillNextAttackE" 00 end Link to comment Share on other sites More sharing options...
Anon123r Posted April 16, 2021 Author Share Posted April 16, 2021 Tested . Work 100 % . Bye for now Im movin' to new topic : https://gtaforums.com/topic/970800-the-truth-about-gsf-gang/ OrionSR 1 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