Calculate road/travel distance between 2 locations

Preferably server side… I would like to calculate the road distance between two locations, the idea being is rewarding players doing jobs based on the distance they have driven.

I am happy with an approximation, and don’t want to “over-engineer the solution”. It is important however to calculate the travelled distance (or rather, the expected distance based on shortest route) so that players are not penalised for locations extremely close (for example if you were either side of the Marina in Vespucci - based on this map - on let’s say Shank Street and had to get to Rub Street, although the locations are extremely close you have to drive around the outside of the Marina).

I have considered using CalculateTravelDistanceBetweenPoints() but am conscious of the potential of client-side abuse, as well as it seems error prone with long distances?

I wonder what solutions people have come up with for this…

Maybe you can over 100000.0 just calculate the distance from Point A to Point B (End point)

local BufPoint = PointA - PointB 
local EndPoint = BufPoint + 100000.0 * MoneyEarned

About abuse maybe you can check if the player was in the vehicle every 5 seconds? I’m not an expert in this, hope someone can give you more advice

Thanks for the input, it’s an interesting idea, will have to toy with this a bit.

The main abuse I didn’t want is the idea of measuring how far a player were to travel, point being it’s subject to abuse if they were to drive like 3 laps of the island before collecting their pay. The important part to me is to track how far they “should” drive, not how far they “actually” drive.