CLEO Help 0B2C w/o SAMPFUNCS

CLEO related
Status
Not open for further replies.

mpol77

Active member
Joined
Oct 24, 2018
Messages
66
Reaction score
6
Title says pretty much everything, been tryna use Car.Id() but it's not what I'm looking for and it's not really working either way

On 0.3.7 w/ sampfuncs we had:
0B2C: samp 1@ = get_vehicle_id_by_car_handle 0@

What's the equivalent now?
 

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
97
Reaction score
21
Title says pretty much everything, been tryna use Car.Id() but it's not what I'm looking for and it's not really working either way

On 0.3.7 w/ sampfuncs we had:
0B2C: samp 1@ = get_vehicle_id_by_car_handle 0@

What's the equivalent now?
U can use this func from SAMP-UDF
source
Code:
GetVehiclePointerById(dwId) {
    if(!dwId)
        return 0
    if(!checkHandles())
        return 0
 
    dwPed_By_Id := GetPedById(dwId)
 
    dwAddress := readDWORD(hGTA, dwPed_By_Id + 0x58C)
    if(ErrorLevel) {
        ErrorLevel := ERROR_READ_MEMORY
        return 0
    }
    ErrorLevel := ERROR_OK
    return dwAddress
}

You need to do a loop for all vehicles and get handle of your current car with 00D9: 0@ = actor $PLAYER_ACTOR car . And if handle from ID loop is equal to yours, then u got current ID.

E.A.S.Y.
 
Status
Not open for further replies.
Top