BROKEN bus system with basic functionality - 2 commits missed somehow

This commit is contained in:
Benjamin Kyd
2019-05-13 00:20:50 +01:00
parent b9cda04514
commit 6cb5cbef32
9 changed files with 183 additions and 49 deletions

View File

@@ -0,0 +1,40 @@
/**
* Copyright© Benjamin Kyd 2019
* fn_doSignPressed.sqf
*
* Bus sign was pressed, prepair to teleport
* player and do other such tasks
*/
params [
["_target", objNull, [objNull]],
["_caller", objNull, [objNull]],
["_id", 0, [0]],
["_args", [], [[]]]
];
private _dest = _args select 0;
private _price = _args select 1;
private _stops = getArray (missionConfigFile >> "cfgBus" >> "stops" >> "names");
private _locations = getArray (missionConfigFile >> "cfgBus" >> "stops" >> "locations");
private _positionInStops = 0;
if (!(_dest in _stops)) exitWith { };
private _i = 0;
{
if (_x isEqualTo _dest) then { _positionInStops = _i; };
_i = _i + 1;
} forEach _stops;
// Take money from bank account
hint "Your bus will arrive in 10 seconds";
uiSleep 10;
hint "All aboard!";
[(_locations select _positionInStops)] call RR_fnc_doTeleport;
hint format ["You have arrived at %1! Enjoy your stay", _dest];