[Help]How to get the last vehicle id that player sit in

Please help. i wanna know how to get the id of the lastest vehicle that player sit in. when player is on-foot

What are you trying to do with the last vehicle?

have permission to lock/unlock them

GET_VEHICLE_PED_IS_IN(Any p0, Any p1)

GetVehiclePedIsIn (GetPlayerPed (-1), true)

I thinks that’s what it is.

Where it says true I think that’s a boolean for getPlayerLastVehicle - true or false

Is this work only when player [On] vehicle?

Should work if the player sits in a vehicle and gets out yes.

1 Like

Okay i’ll try ty sir :D;

1 Like

Actually you should use this:

local ped = GetPlayerPed(-1)
GetLastDrivenVehicle(ped)

This will grab the last vehicle the player was in

1 Like