CLEO Help [HELP] Get opcode adress

CLEO related
Status
Not open for further replies.

Akatosh

New member
Joined
Jun 29, 2016
Messages
1
Reaction score
0
Hi!
I have opcode:

0B2C: samp 0@ = get_vehicle_id_by_car_handle 1@

[font=arial, sans-serif]How do you know which memory address uses the opcode to get this data? I really need this to convert cleo script into my AHK script
P.S. This is Vehicle SAMP-id, not Vehicle model-id (like 400 = landstalker)[/font]
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
It's basically 0x21A0F8 -> 0x3CD -> 0x1C -> points to a struct which contains an array of streamed vehicles.
see here https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L668

[shcode=cpp]
int iIsListed[SAMP_MAX_VEHICLES]; //does veh. exist/is streamed
struct vehicle_info *pGTA_Vehicle[SAMP_MAX_VEHICLES]; //GTA veh. class handles
[/shcode]

Loop through it, check if not null and compare with your handle. And the current iterator is your samp veh. id.
 
Status
Not open for further replies.
Top