diff --git a/SQF/Bus%20System.Altis/RR_functions/fn_busFare.sqf b/SQF/Bus%20System.Altis/RR_functions/fn_busFare.sqf index 4ac9ffe..bff7d88 100644 --- a/SQF/Bus%20System.Altis/RR_functions/fn_busFare.sqf +++ b/SQF/Bus%20System.Altis/RR_functions/fn_busFare.sqf @@ -10,6 +10,6 @@ params [ ["_distance", 0, [0]] ]; -private _fare = _distance * 3; +private _fare = floor _distance * 3; _fare; diff --git a/SQF/Bus%20System.Altis/RR_functions/fn_distance3D.sqf b/SQF/Bus%20System.Altis/RR_functions/fn_distance3D.sqf index 3f44c99..d7fda8d 100644 --- a/SQF/Bus%20System.Altis/RR_functions/fn_distance3D.sqf +++ b/SQF/Bus%20System.Altis/RR_functions/fn_distance3D.sqf @@ -13,10 +13,18 @@ params [ private _result = 0; -_xD = (_x select 0) - (_y select 0); -_yD = (_x select 1) - (_y select 1); -_zD = (_x select 2) - (_y select 2); +_xD = (_y select 0) - (_x select 0); +_yD = (_y select 1) - (_x select 1); +_zD = (_y select 2) - (_x select 2); -_result = sqrt [_xD + _yD + _zD]; +_xD = _xD * _xD; +_yD = _yD * _yD; +_zD = _zD * _zD; + +private _d = _xD + _yD + _zD; + +if (!(_d isEqualTo 0)) then { + _result = sqrt _d; +}; _result; diff --git a/SQF/Bus%20System.Altis/RR_functions/fn_doSignPressed.sqf b/SQF/Bus%20System.Altis/RR_functions/fn_doSignPressed.sqf index adb41ba..dda20b4 100644 --- a/SQF/Bus%20System.Altis/RR_functions/fn_doSignPressed.sqf +++ b/SQF/Bus%20System.Altis/RR_functions/fn_doSignPressed.sqf @@ -34,6 +34,7 @@ private _i = 0; hint "Your bus will arrive in 10 seconds"; uiSleep 10; hint "All aboard!"; +uiSleep 1; [(_locations select _positionInStops)] call RR_fnc_doTeleport; diff --git a/SQF/Bus%20System.Altis/RR_functions/fn_doTeleport.sqf b/SQF/Bus%20System.Altis/RR_functions/fn_doTeleport.sqf index 5600065..bafdc94 100644 --- a/SQF/Bus%20System.Altis/RR_functions/fn_doTeleport.sqf +++ b/SQF/Bus%20System.Altis/RR_functions/fn_doTeleport.sqf @@ -9,4 +9,4 @@ params [ ["_target", [], [[]]] ]; -player setPos (target); +player setPos _target; diff --git a/SQF/Bus%20System.Altis/RR_functions/fn_setupSigns.sqf b/SQF/Bus%20System.Altis/RR_functions/fn_setupSigns.sqf index 964b18f..4430089 100644 --- a/SQF/Bus%20System.Altis/RR_functions/fn_setupSigns.sqf +++ b/SQF/Bus%20System.Altis/RR_functions/fn_setupSigns.sqf @@ -25,12 +25,12 @@ private _i = 0; private _destLocation = _locations select _j; private _distance = [_location, _destLocation] call RR_fnc_distance3D; - private _price = [parseNumber [_distance]] call RR_fnc_busFare; + private _price = [_distance] call RR_fnc_busFare; - private _signName = format ["%1 - £%2", _x, _price]; + private _signName = format ["%1 £%2", _x, _price]; _sign addAction [ - _x, RR_fnc_doSignPressed, [_x, _price] + _signName, RR_fnc_doSignPressed, [_x, _price] ]; _j = _j + 1; } forEach _stops;