Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Please be aware that this is not a tutorial request forum! Use the appropriate topic for the effect.
Sanmodder

guide on how to use the call scm function and how to do something similar to thread and have the same additional variables

Recommended Posts

Sanmodder
guide on how to use the call scm function
and how to do something similar to thread and have the same additional variables
you know that in cleo you can use only 0 @ to 33 @ local variables in that 32 @ and 33 @ are dropping because they are not zero


what we need
several opcodes
see what

0AC6: 14 @ = label @label offset
0A8D: 9 @ = read_memory 14 @ size 4 virtual_protect 0
0A8C: write_memory 14 @ size 4 value 15 @ virtual_protect 0
0AB1: call_scm_func @neons 0
0AB2: ret 0
0AB3: var 199 = 28 @
0AB4: 3 @ = var 196

the first method
// ------------------------------------------------ --------------------------------
// 100% stable method
{
$ cleo .cs
}
0000:

: thread_1
while true
    wait 0
    // ....................
    // your script
    // ....................
    // now important you have to jump to the next script with a special opcodem
    0AB1: call_scm_func @ thread_2 0 // this opcode can send variables but now let's focus on other activities
end

: thread_2
// ....................
// your script // remember do not give a loop because it has to return to its place xd
// ....................
0AB2: ret 0 // this opcode can return variable values ??as you give eg 1 returns one eg 1 @
// but first you need to set 1 in the 0ab1 option:
end_thread

-------------------------------------------------- ---
now the second method
-------------------------------------------------- ---
####################################################
1 you need to create memory in the script to store values
you must first understand it
what is this opcode 0AC6 for:
@label is the label adress in the script
0 @ takes the offset of this label
0AC6: 0 @ = label @label offset
0 @ + = 0 // offset 0x0
0A8C: write_memory 0 @ size 4 value 0 virtual_protect 0
what is it all about? 0 @ + = 0 (0 @ to label offset: label) + 0 is offset memory 0x0
each offset must be added eg 4 + 4 = 8 true
now we have to put the values ??in memory to use them
remember that float is float and that integer integer you understand
to integer 0
to float 0.0
####################################################


you give it to the script
{
$ cleo .cs
}
0000:

// 100% stable method

0AC6: 0 @ = label @label offset
0 @ + = 0 // offset 0x0
0A8C: write_memory 0 @ size 4 value 0 virtual_protect 0
0 @ + = 4 // offset 0x4
0A8C: write_memory 0 @ size 4 value 0 virtual_protect 0
0 @ + = 4 // offset 0x4
0A8C: write_memory 0 @ size 4 value 0 virtual_protect 0

: thread_1
while true
    wait 0
    // ....................
    // your script
    // ....................
    // now important you have to jump to the next script with a special opcodem
    0AB1: call_scm_func @ thread_2 0 // this opcode can send variables but now let's focus on other activities
end

: thread_2
0AC6: 0 @ = label @label offset
0 @ + = 0 // offset 0x0
 0A8D: 1 @ = read_memory 0 @ size 4 virtual_protect 0
0 @ + = 4 // offset 0x4
 0A8D: 2 @ = read_memory 0 @ size 4 virtual_protect 0
0 @ + = 4 // offset 0x4
 0A8D: 3 @ = read_memory 0 @ size 4 virtual_protect 0
 
// ....................
// your script // remember do not give a loop because it has to return to its place xd
// ....................
what's the meaning of variables here, there is no way out
but this method is only for mass Scripts like me
how it works eg you have variables in use 4 @ 5 @ 6 @ then you can use additional ones loaded from memory
remember to return the same values ??to the memory for transmission

 
 

0AC6: 0 @ = label @label offset
0 @ + = 0 // offset 0x0
0A8C: write_memory 0 @ size 4 value 1 @ virtual_protect 0
0 @ + = 4 // offset 0x4
0A8C: write_memory 0 @ size 4 value 2 @ virtual_protect 0
0 @ + = 4 // offset 0x4
0A8C: write_memory 0 @ size 4 value 3 @ virtual_protect 0
0AB2: ret 0 // this opcode can return variable values ??as you give eg 1 returns one eg 1 @
// but first you need to set 1 in the 0ab1 option:
end_thread

// now we create memory for 3 variables
// for example 8 byte, make sure there is a reserve
// now we give the label: label
 
: label
hex
00 00 00 00
00 00 00 00
00 00 00 00
end



Be advised
you can create a counter, reduce the script
just remember that the meter was in the loop
 
while true
    wait 0
    for 0 @ = 0 to 80 step 4
    // ...............
    end
end

see
// adding value to the memory
for 0 @ = 0 to 4 step 4 /// to 8 byte 0 @> 4 = 8
    0AC6: 1 @ = label @label offset
    1 @ + = 0 @ // from 0 to 8
    0A8C: write_memory 1 @ size 4 value 2 @ virtual_protect 0
end

for 0 @ = 0 to 4 step 4 /// to 8 byte 0 @> 4 = 8
    // ...................
    // optionally for different variables, make a cassette by yes
    // ..................
    if 0 @ == 0 // counter value
    then 2 @ = 987654
    end
if 0 @ == 4 // counter value
    then 2 @ = 123456
    end
    if 0 @ == 8 // counter value
    then 2 @ = 564783
    end
    0AC6: 1 @ = label @label offset
    1 @ + = 0 @ // from 0 to 8
    0A8C: write_memory 1 @ size 4 value 2 @ virtual_protect 0
end

// loading from memory
for 0 @ = 0 to 4 step 4 /// to 8 byte 0 @> 4 = 8
    0AC6: 1 @ = label @label offset
    1 @ + = 0 @ // offset 0x0
    0A8D: 2 @ = read_memory 1 @ size 4 virtual_protect 0
    // ...................
 // your code
    // ...................
end

: label
hex
00 00 00 00
00 00 00 00
00 00 00 00
end

####################################################
using opcode 0ab1: you must know something
when I jump to the label I do not remember the previous values
that is why the restoration of them either from memory or
using these opcodes
how? see
####################################################

while true
    wait 0
    //...if use 3 @ var in scripts add
// your code
    0AB3: var 199 = 3 @
    0AB1: call_scm_func @ thread_2 0
end

: thread_2
0AB4: 3 @ = var 196
//...read var 3 @
// your code
// use 3 @ var
0AB2: ret 0
//end

####################################################
These opcodes have other unique advantages as well?
0AB4: 3 @ = var 196
0AB3: var 199 = 3 @
they can send values ??to other scripts
I'm not talking about the same script here
only about your other scripts in the cleo folder
for example, you want to control the actor in the second script
then you go
one script in the cleo folder
####################################################

Model.Load (# fam1)
038B: load_requested_models
             
04C4: store_coords_to 8 @ 9 @ 10 @ from_actor $ PLAYER_ACTOR with_offset 0.0 2.0 -1.0
1 @ = Actor.Create (Prostitute, # fam1, 8 @, 9 @, 10 @)
0AB3: var 199 = 1 @
end_thread


//--------------------------------------------------
the second script in the cleo folder

while true
wait 0
    0AB4: 1 @ = var 196
    if 056D: actor 1 @ defined
    then
        // ..............
    end
end

end of the guide
####################################################
note I forbid the plagiarization of my guide
tutorial only for private use
for making it reliable
script works
####################################################

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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