Vielleicht kann mir hier jemand helfen
An bestimmten Orten auf meiner Karte stehen Telefonzellen, bei denen man mittels addaction n HALO bestellen kann. Ziemlich simpel.
Nun möchte ich dort n cooldown einbauen, inkusive eines hints, wie lange dieser cooldown noch läuft.
Das ist aktuell in der init der Telefonbox:
Das hier habe ich zwar gefunden, aber irgendwie/-was funktioniert da/s nicht
Code
- this addAction [
- "<t color='#37A9E7'><img image='Pictures\phone.paa'/> Call H.A.L.O.</t>",
- {
- if (diag_tickTime < (uiNamespace getVariable ['tag_cooldown',-1])) exitWith {
- hint (format ['Too soon! Please wait %1 more seconds.',(round ((uiNamespace getVariable ['tag_cooldown',-1]) - diag_tickTime))]);
- };
- _cooldown = 300; // cooldown duration in seconds
- uiNamespace setVariable ['tag_cooldown',(diag_tickTime + _cooldown)];
- [] execVM "ATM_airdrop\atm_airdrop.sqf";
- },
- [],
- 1,
- false,
- true,
- "",
- "_this distance _target < 2"
- ];
[] execVM "ATM_airdrop\atm_airdrop.sqf"; habe ich hier jetzt auch nicht verändert, da die execVM aus der Telefonbox ja [player] execVM 'scripts\halo.sqf lautet.
Oder sollte man das eher über das halo script machen?
Code
- //Uncomment following line if used as function
- //_unit = param[0];
- //Uncomment following line if used as script
- _unit = _this select 0;
- _haloAltitude = 1000;
- //Opening map and handling click
- openMap true;
- mapclick = false;
- onMapSingleClick "clickpos = _pos; mapclick = true; onMapSingleClick """";true;";
- waituntil {mapclick};
- _haloLocation = clickpos;
- _unitLoadout = getUnitLoadout _unit;
- playsound "flyby";
- cutText ["H.A.L.O. in progress...", "BLACK OUT", 1];
- sleep 1;
- openMap false;
- _unit setPos _haloLocation;
- _unit addBackpack "B_Parachute";
- //Halo
- [_unit, _haloAltitude] call bis_fnc_halo;
- sleep 2;
- cutText ["", "BLACK IN", 1];
- waitUntil {(getpos _unit select 2) < 2};
- //Giving loadout back
- sleep 1;
- _unit setUnitLoadout _unitLoadout;