Hey guys, thanks for having a look.
I'm trying to write a code that will display the speed difference between the car speed, and pit road speed.
I have gotten to the point that it always gives me the same error,
Admittedly, Im not as schooled on Java as I would like to be, I'm not trying to make it a profession, I just want this code to work.
Any help would be greatly appreciated.
Here's the code I have:
var speed = $prop('SpeedKmh');
var pit = $prop('GameRawData.SessionData.WeekendInfo.TrackPitSpeedLimit');
var difference = function (pit, speed){
Math.abs(pit-speed);
}
return (difference)
output: System.Func`3[Jint.Native.JsValue,Jint.Native.JsValue[],Jint.Native.JsValue]
60fps club
I figured it out, the "kph" on the end of pit road speed was screwing everything us, I parsed it.
Its working properly now.
var speed = $prop('SpeedKmh');
var pit = parseInt($prop('GameRawData.SessionData.WeekendInfo.TrackPitSpeedLimit'));
if(speed<pit) {
return (pit-speed);
} else if(speed=pit) {
return (pit);
} else if(speed>pit) {
return (speed-pit)
}