Code:
:SAMPGetVehicleIDbyCarHandle // if 0AB1: @SAMPGetVehicleIDbyCarHandle 1 _OfCarHandle 0@ _StoreVehicleID 29@
if 0AA2: 31@ = load_dynamic_library "samp.dll" // pSAMPBase // no need to Free Memory
then
31@ += 0x21A0F8
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stSAMPInfo
if 31@ > 0
then
31@ += 0x3CD
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stSAMPPools
if 31@ > 0
then
31@ += 0x1C
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stVehiclePool
if 31@ > 0
then
0A97: 30@ = vehicle 0@ struct
for 29@ = 0 to 8000 step 4 // vehicle index = max vehicle * 4 = 2000 * 4
0A8E: 28@ = 29@ + 31@
0A8E: 27@ = 28@ + 0x3074
0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // iIsListed
if 27@ > 0
then
0A8E: 27@ = 28@ + 0x1134
0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // pSAMP_Vehicle
if 27@ > 0
then
27@ += 0x4C
0A8D: 26@ = read_memory 27@ size 4 virtual_protect 0 // pGTA_Vehicle
if 003B: 26@ == 30@ // our vehicle matched
then
29@ /= 4
0485: return_true
ret 1 29@ // I now Got the Vehicle ID
end
end
end
end
end
end
end
end
059A: return_false
ret 1 -1 // null Vehicle ID
Code:
{$CLEO}
0000:
while true
wait 0
if 0449: actor $PLAYER_ACTOR in_a_car
then
03C0: 0@ = actor $PLAYER_ACTOR car
if 0AB1: @SAMPGetVehicleIDbyCarHandle 1 _OfCarHandle 0@ _StoreVehicleID 31@
then 0AD1: show_formatted_text_highpriority "Your Vehicle's SAMP ID is %d" time 100 31@
else 0ACD: show_text_highpriority "Your Vehicle have no SAMP ID" time 100
end
end
end