Before initial 2372 build preview release into canary I created few features in my resource utilizing GetVehiclePedIsIn
in server side. It was working until I switched to 2372 and spotted that some parts of code was not functioning. After some time I figured out that the native in every case returns value 0
. Switched back to 2189 and it was working perfectly. P.S this native on client side works correctly on both builds.
1. Client (production/canary) and FXServer version
Client canary
FXServer 4267
2. What you expected to happen
RPC Native GetVehiclePedIsIn
to return a value which represents in which vehicle ped is in
3. What actually happens
In any case, returned value is 0
4. Category of bug (eg. client, server, weapons, peds, native)
RPC Native
5. Reproducible steps, preferably with example script(s)
RegisterCommand('pedvehicle', (source, args) => {
const ped = GetPlayerPed(source)
const vehicle = GetVehiclePedIsIn(ped, false)
console.log(`PED ID: ${ped}, VEHICLE ID: ${vehicle}`)
//trying with last vehicle param
const vehicle_2 = GetVehiclePedIsIn(ped, true)
console.log(`VEHICLE ID: ${vehicle_2}`)
}, false)
Place this code in server side of resource and dispatch command from client.