CLEO Help Question about changing cleos from one id at a time to all

CLEO related
Status
Not open for further replies.

WoopWoop

Member
Joined
Jul 20, 2016
Messages
15
Reaction score
0
So im not much of a cleo coder 
Anyway there are so many cleos that only do one player at a time (specially trolling cleos) Now i am guessing its not possible but is there a way/code i can edit in to allow for all streamed players ofc its not gonna be that simple and different adjustments may be for different cleos but broadly speaking is there code which can be adjusted to different cleos to allow all streamed players then one
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
@WoopWoop
understanding of the code would be necessary for that I think and I'd say that sometimes it would be easier to write your own mod from scratch rather than to understand code written by someone else especially if it doesn't include comments. Once you understand what does what and find the place within the code which affects the car/player using single ID then you could try to apply a function containing one of the following snippets:
http://ugbase.eu/Thread-SNIPPET-ForAllCars
http://ugbase.eu/Thread-SNIPPET-For-All-Peds

let's say you have a mod which teleports a car and it uses:
Code:
00AB: put_car 0@ at 1000.0 1000.0 40.0
you could delete that and put something like this instead:
Code:
0AB1: call_scm_func @TeleportAllCarsToGivenXYZposition 3  1000.0 1000.0 40.0
and include the definition of that function at the end of the code (using the snippet posted by Opcode.eXe) like:
Code:
:TeleportAllCarsToGivenXYZposition
0A8D: 29@ = read_memory 0xB74494 size 4 virtual_protect 0
29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 27904 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
    000A: 29@ += 0x1
    if and
        0029: 31@ >= 0x00
        001B: 0x80 > 31@
    then
        005A: 31@ += 30@
        // GOT THE CAR.
        00AB: put_car 31@ at 0@ 1@ 2@
    end
end
ret 0
notice that 1000.0 1000.0 40.0 coordinates became 0@ 1@ 2@ within the function (http://ugbase.eu/Thread-Tutorial-0AB1-call-scm-function)
 
Status
Not open for further replies.
Top