FIXED bus system working OwO

This commit is contained in:
Benjamin Kyd
2019-05-13 00:34:58 +01:00
parent 6cb5cbef32
commit f99826571a
5 changed files with 18 additions and 9 deletions

View File

@@ -10,6 +10,6 @@ params [
["_distance", 0, [0]]
];
private _fare = _distance * 3;
private _fare = floor _distance * 3;
_fare;

View File

@@ -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;

View File

@@ -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;

View File

@@ -9,4 +9,4 @@ params [
["_target", [], [[]]]
];
player setPos (target);
player setPos _target;

View File

@@ -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;