Replace GetDistanceBetweenCoords() with #(dumpPos - pos) and replace GetPlayerPed(-1) with PlayerPedId() - both are much faster.