|
1 | 1 | /** |
2 | 2 | * Description: |
3 | | -* Stellt Haftladungen zur verfügung |
| 3 | +* Stellt Haftladungen zur Verfügung |
4 | 4 | * |
5 | 5 | * Author: Lord-MDB |
6 | 6 | * |
@@ -34,38 +34,38 @@ private _pic = "A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; |
34 | 34 | _veh = (nearestObjects[_unit,["car","truck","tank","wheeled_apc"],8]) select 0; |
35 | 35 | _bomb = (nearestObject [_unit, 'PipeBombBase']); |
36 | 36 |
|
37 | | -//check ob Beide nötigen Dinge vorhanden sind |
38 | | -if (isNull _veh) exitWith {Hint format["%1",MLOC(HAFTLADUNGNOVEH)];}; |
39 | | -if (isNull _bomb) exitWith {Hint format["%1",MLOC(HAFTLADUNGNOBOMBE)];}; |
| 37 | +// Check ob Beide nötigen Dinge vorhanden sind |
| 38 | +if (isNull _veh) exitWith {hint format["%1",MLOC(HAFTLADUNGNOVEH)];}; |
| 39 | +if (isNull _bomb) exitWith {hint format["%1",MLOC(HAFTLADUNGNOBOMBE)];}; |
40 | 40 |
|
41 | | -if ((_bomb distance _veh) > 8) exitWith {Hint format["%1",MLOC(HAFTLADUNGNOBOMBE)];}; |
| 41 | +if ((_bomb distance _veh) > 8) exitWith {hint format["%1",MLOC(HAFTLADUNGNOBOMBE)];}; |
42 | 42 |
|
43 | | -//Roherfassung Objekt |
44 | | -private _start = AGLToASL positionCameraToWorld [0,0,0]; |
45 | | -private _end = AGLToASL positionCameraToWorld [0,0,10]; |
| 43 | +// Roherfassung Objekt |
| 44 | +private _start = AGLToASL positionCameraToWorld [0, 0, 0]; |
| 45 | +private _end = AGLToASL positionCameraToWorld [0, 0, 10]; |
46 | 46 | private _lis = lineIntersectsSurfaces [_start, _end, _unit, objNull, true, -1]; |
47 | 47 | private _intersection = _lis param [0, []] select 0; |
48 | 48 |
|
49 | | -//Check Fahrzeug gefunden wurde |
50 | | -if (isNil "_intersection") exitWith {Hint format["%1",MLOC(HAFTLADUNGNOVEH)];}; |
51 | | -if (_intersection isEqualTo []) exitWith {Hint format["%1",MLOC(HAFTLADUNGNOVEH)];}; |
| 49 | +// Check ob Fahrzeug gefunden wurde |
| 50 | +if (isNil "_intersection") exitWith {hint format["%1",MLOC(HAFTLADUNGNOVEH)];}; |
| 51 | +if (_intersection isEqualTo []) exitWith {hint format["%1",MLOC(HAFTLADUNGNOVEH)];}; |
52 | 52 |
|
53 | | -//Netto Position des Fahrzeugs |
| 53 | +// Netto Position des Fahrzeugs |
54 | 54 | private _vDir = _start vectorFromTo _end; |
55 | | -private _position = _intersection vectorAdd (_vDir vectorMultiply +(0.9 * abs(cos (getDir _veh + 90)))); //90cm abstand |
| 55 | +private _position = _intersection vectorAdd (_vDir vectorMultiply + (0.9 * abs(cos(getDir _veh + 90)))); // 90 cm abstand |
56 | 56 | private _offset = _veh worldToModel ASLToAGL _position; |
57 | 57 |
|
58 | | -private _xoffset = (_offset select 0); |
59 | | -private _yoffset = (_offset select 1); |
| 58 | +private _xoffset = _offset select 0; |
| 59 | +private _yoffset = _offset select 1; |
60 | 60 | private _zoffset = _offset select 2; |
61 | 61 |
|
62 | 62 | // Anheften der Sprengladung mit Offset |
63 | | -_bomb attachTo [_veh, [_xoffset,_yoffset,_zoffset]]; |
| 63 | +_bomb attachTo [_veh, [_xoffset, _yoffset, _zoffset]]; |
64 | 64 |
|
65 | | -//Ausrichten der Sprengladung |
| 65 | +// Ausrichten der Sprengladung |
66 | 66 | private _unitdir = getDir _unit; |
67 | | -_bomb setVectorDirAndUp [[0,(cos (getDir _veh + 90)),0],[(cos (getDir _veh - 90 +_unitdir)),(cos (getDir _veh + 90 + _unitdir)),0]]; |
| 67 | +_bomb setVectorDirAndUp [[0, (cos(getDir _veh + 90)), 0], [(cos(getDir _veh - 90 + _unitdir)), (cos(getDir _veh + 90 + _unitdir)), 0]]; |
68 | 68 |
|
69 | | -//Ausgabe an den Spieler |
| 69 | +// Ausgabe an den Spieler |
70 | 70 | _pic = "A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; |
71 | 71 | hint composeText [parseText format ["<t align='left' size='%4'><img image='%3'></t>" +"<t align='center' size='1.25' shadow='true'>%1</t><t align='right' size='%4'><img image='%3'></t>" +"<br/>" +"<t align='center' size='1.0' shadow='true'>%2</t>","C4",MLOC(HAFTLADUNGATTACH),_pic,3.0]]; |
0 commit comments