CLEO Help Find a certain pickup

CLEO related
Status
Not open for further replies.

Kelsi235

Active member
Joined
Jun 2, 2019
Messages
53
Reaction score
4
http://ugbase.eu/index.php?threads/release-pickup-finder.12473/

I found this but if someone could explain to me how exactly functions work in cleo?

:getPickupIdByModel
0BB9: samp 1@ = get_pickup_pool_ptr
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0 // PickupsCount
if 2@ > 0
then
0A8E: 2@ = 1@ + 0x4 // ul_GTA_PickupID
0A8E: 3@ = 1@ + 0xF004 // stPickup
for 4@ = 0 to 4095 step 1
0A90: 5@ = 4@ * 4
005A: 5@ += 2@
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
if 5@ <> 0
then
0A90: 5@ = 4@ * 20
005A: 5@ += 3@
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0 // pickupModel
if 003b: 5@ == 0@
then
0485: return_true
0AB2: ret 1 4@
end
end
end
end
059A: return_false
0AB2: ret 1 -1



what does this function return? and how do I call it?
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,719
Solutions
1
Reaction score
111
Code:
0AB1: call_scm_func @getPickupIdByModel 1 model 1@ id_to 2@
Source here
But this isn't what you need as all pickup models are the same right? So just use opcode 0B53.
C++:
0B53: samp 2@ = pickup_id_by_handle 1@
 
Last edited:

Kelsi235

Active member
Joined
Jun 2, 2019
Messages
53
Reaction score
4
Yeah but if you have 5 pickups of the same model next to each other which one does the script pick? Most likely will get the first one inside the pickup pool which might not be the pickup you're looking for.
server renders 6 pickups per map I believe, so having multiple in render shouldn't really be important. But just in case, I wrote this, I'm gonna test it out in a sec

0BB9: samp 1@ = get_pickup_pool_ptr
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0 // PickupsCount
if 2@ > 0
then
0A8E: 2@ = 1@ + 0x4 // ul_GTA_PickupID
0A8E: 3@ = 1@ + 0xF004 // stPickup
for 4@ = 0 to 4095 step 1
0A90: 5@ = 4@ * 4
005A: 5@ += 2@
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
if 5@ <> 0
then
0A90: 5@ = 4@ * 20
005A: 5@ += 3@
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0 // pickupModel
if 003b: 5@ == <mypickupmodelid>
// do something like drawing or output in chat as debug for start
end
end
end
end
 
Status
Not open for further replies.
Top