I found that if you create another array that is of Float32Array, it will output the correct floats for the mix values.

At the end of the day, like you said, it will be easier and cleaner to use C#, however this method does work if you purely want a JS version.

function Export_GetPedHeadBlendData() {
    var arrForShape = new Uint32Array(new ArrayBuffer(10 * 8)); 
    var arrForMix = new Float32Array(new ArrayBuffer(10 * 8));

    Citizen.invokeNative("0x2746BD9D88C5C5D0", GetPlayerPed(-1), arrForShape);
    Citizen.invokeNative("0x2746BD9D88C5C5D0", GetPlayerPed(-1), arrForMix);

    return [arrForShape, arrForMix];
}

RegisterNetEvent("getHeadBlendDataJS")
on('getHeadBlendDataJS', (cb) => {
	var result = Export_GetPedHeadBlendData()
	console.log(result[0][0] + ", " + result[0][2] + ", " + result[0][4] + ", " + result[0][6] + ", " + result[0][8] + ", " + result[0][10]);
	console.log(result[1][12].toFixed(2) + ", " + result[1][14].toFixed(2) + ", " + result[1][16].toFixed(2));
})
1 Like