Skip to content

Commit eef871c

Browse files
authored
Gemeinsame Servermod für Livonia und Virolathi
Gemeinsame Servermod für Livonia und Virolathi
2 parents d50c05a + 38a1fe2 commit eef871c

File tree

6 files changed

+171
-153
lines changed

6 files changed

+171
-153
lines changed

addons/main/GELDZEIT/fn_clientInitcbaclassevents.sqf

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,22 @@
1414
*/
1515
#include "macros.hpp"
1616

17-
["LandVehicle", "init",
17+
// Haftladungen (aber nicht auf der Livonia-Karte!)
18+
if !("Enoch" isEqualTo worldName) then
1819
{
19-
params ["_vec"];
20-
21-
_vec addAction [
22-
format["<t color=""#f0f24e"">%1</t>", MLOC(HAFTLADUNG)],
23-
{[_this select 0] call FUNC(haftladungen)},
24-
[],
25-
-1,
26-
false,
27-
true,
28-
'',
29-
"_veh = vehicle _this; ((alive _target) and (speed _veh < 3) and (_veh distance _target) < 8 and vehicle player == player)"
30-
];
31-
32-
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
33-
20+
["LandVehicle", "init",
21+
{
22+
params ["_vec"];
3423

24+
_vec addAction [
25+
format["<t color=""#f0f24e"">%1</t>", MLOC(HAFTLADUNG)],
26+
{[_this select 0] call FUNC(haftladungen)},
27+
[],
28+
-1,
29+
false,
30+
true,
31+
'',
32+
"_veh = vehicle _this; ((alive _target) and (speed _veh < 3) and (_veh distance _target) < 8 and vehicle player == player)"
33+
];
34+
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
35+
};

addons/main/GELDZEIT/fn_haftladungen.sqf

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Description:
3-
* Stellt Haftladungen zur verfügung
3+
* Stellt Haftladungen zur Verfügung
44
*
55
* Author: Lord-MDB
66
*
@@ -34,38 +34,38 @@ private _pic = "A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa";
3434
_veh = (nearestObjects[_unit,["car","truck","tank","wheeled_apc"],8]) select 0;
3535
_bomb = (nearestObject [_unit, 'PipeBombBase']);
3636

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)];};
4040

41-
if ((_bomb distance _veh) > 8) exitWith {Hint format["%1",MLOC(HAFTLADUNGNOBOMBE)];};
41+
if ((_bomb distance _veh) > 8) exitWith {hint format["%1",MLOC(HAFTLADUNGNOBOMBE)];};
4242

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];
4646
private _lis = lineIntersectsSurfaces [_start, _end, _unit, objNull, true, -1];
4747
private _intersection = _lis param [0, []] select 0;
4848

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)];};
5252

53-
//Netto Position des Fahrzeugs
53+
// Netto Position des Fahrzeugs
5454
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
5656
private _offset = _veh worldToModel ASLToAGL _position;
5757

58-
private _xoffset = (_offset select 0);
59-
private _yoffset = (_offset select 1);
58+
private _xoffset = _offset select 0;
59+
private _yoffset = _offset select 1;
6060
private _zoffset = _offset select 2;
6161

6262
// Anheften der Sprengladung mit Offset
63-
_bomb attachTo [_veh, [_xoffset,_yoffset,_zoffset]];
63+
_bomb attachTo [_veh, [_xoffset, _yoffset, _zoffset]];
6464

65-
//Ausrichten der Sprengladung
65+
// Ausrichten der Sprengladung
6666
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]];
6868

69-
//Ausgabe an den Spieler
69+
// Ausgabe an den Spieler
7070
_pic = "A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa";
7171
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]];

addons/main/RULES/fn_clientInit.sqf

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
*/
2929
#include "macros.hpp"
3030

31-
// Spieler wird getötet wenn er sich zu nah an eine Feindbasis wagt
32-
#define MIN_DISTANCE_TO_ENEMYBASE 2000
33-
3431
// Wie oft (in Sekunden) wird die Spielerposition geprüft
3532
#define INTERVAL_DISTANCE_CHECK 15
3633

@@ -181,7 +178,7 @@
181178
case east:
182179
{
183180
[{
184-
if (((player distance2D getMarkerPos "AAF_T_Zone1") < MIN_DISTANCE_TO_ENEMYBASE) or ((player distance2D getMarkerPos "AAF_T_Zone2") < MIN_DISTANCE_TO_ENEMYBASE)) then
181+
if ((position player inArea "AAF_T_Zone1") or (position player inArea "AAF_T_Zone2")) then
185182
{
186183
player setDamage 1;
187184
[MLOC(BASE_DISTANCE)] remoteExecCall ["hint", -2];
@@ -192,7 +189,7 @@
192189
case independent:
193190
{
194191
[{
195-
if (((player distance2D getMarkerPos "CSAT_T_Zone1") < MIN_DISTANCE_TO_ENEMYBASE) or ((player distance2D getMarkerPos "CSAT_T_Zone2") < MIN_DISTANCE_TO_ENEMYBASE)) then
192+
if ((position player inArea "CSAT_T_Zone1") or (position player inArea "CSAT_T_Zone2")) then
196193
{
197194
player setDamage 1;
198195
[MLOC(BASE_DISTANCE)] remoteExecCall ["hint", -2];
@@ -209,7 +206,7 @@
209206
case east:
210207
{
211208
[{
212-
if (((player distance2D getMarkerPos "NATO_T_Zone1") < MIN_DISTANCE_TO_ENEMYBASE) or ((player distance2D getMarkerPos "NATO_T_Zone2") < MIN_DISTANCE_TO_ENEMYBASE)) then
209+
if ((position player inArea "NATO_T_Zone1") or (position player inArea "NATO_T_Zone2")) then
213210
{
214211
player setDamage 1;
215212
[MLOC(BASE_DISTANCE)] remoteExecCall ["hint", -2];
@@ -220,7 +217,7 @@
220217
case west:
221218
{
222219
[{
223-
if (((player distance2D getMarkerPos "CSAT_T_Zone1") < MIN_DISTANCE_TO_ENEMYBASE) or ((player distance2D getMarkerPos "CSAT_T_Zone2") < MIN_DISTANCE_TO_ENEMYBASE)) then
220+
if ((position player inArea "CSAT_T_Zone1") or (position player inArea "CSAT_T_Zone2")) then
224221
{
225222
player setDamage 1;
226223
[MLOC(BASE_DISTANCE)] remoteExecCall ["hint", -2];
@@ -237,7 +234,7 @@
237234
case independent:
238235
{
239236
[{
240-
if (((player distance2D getMarkerPos "NATO_T_Zone1") < MIN_DISTANCE_TO_ENEMYBASE) or ((player distance2D getMarkerPos "NATO_T_Zone2") < MIN_DISTANCE_TO_ENEMYBASE)) then
237+
if ((position player inArea "NATO_T_Zone1") or (position player inArea "NATO_T_Zone2")) then
241238
{
242239
player setDamage 1;
243240
[MLOC(BASE_DISTANCE)] remoteExecCall ["hint", -2];
@@ -248,7 +245,7 @@
248245
case west:
249246
{
250247
[{
251-
if (((player distance2D getMarkerPos "AAF_T_Zone1") < MIN_DISTANCE_TO_ENEMYBASE) or ((player distance2D getMarkerPos "AAF_T_Zone2") < MIN_DISTANCE_TO_ENEMYBASE)) then
248+
if ((position player inArea "AAF_T_Zone1") or (position player inArea "AAF_T_Zone2")) then
252249
{
253250
player setDamage 1;
254251
[MLOC(BASE_DISTANCE)] remoteExecCall ["hint", -2];

addons/main/SECTORCONTROL/fn_clientinitplayereh.sqf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,25 @@ if (GVAR(trainingon)) then
6363

6464
}] call BIS_fnc_addStackedEventHandler;
6565

66+
// Teleport funktion
6667
player addAction [("<t color=""#f0bfbfbf"">" + ("Teleport") + "</t>"), {[] call FUNC(teleport)}, [], 0, false, true, '', "alive _target"];
67-
player addAction ["<t color='#FF0000'>Virtual Arsenal</t>", {["Open", true] spawn BIS_fnc_arsenal;}, [], 5, false, true];
68+
69+
// Virtuelles Arsenal (aber nicht auf der Livonia-Karte!)
70+
if !("Enoch" isEqualTo worldName) then
71+
{
72+
player addAction ["<t color='#FF0000'>Virtual Arsenal</t>", {["Open", true] spawn BIS_fnc_arsenal;}, [], 5, false, true];
73+
};
6874

6975
["Respawn",
7076
{
77+
// Teleport funktion
7178
player addAction [("<t color=""#f0bfbfbf"">" + ("Teleport") + "</t>"), {[] call FUNC(teleport)}, [], 0, false, true, '', "alive _target"];
72-
player addAction ["<t color='#FF0000'>Virtual Arsenal</t>", {["Open", true] spawn BIS_fnc_arsenal;}, [], 5, false, true];
79+
80+
// Virtuelles Arsenal (aber nicht auf der Livonia-Karte!)
81+
if !("Enoch" isEqualTo worldName) then
82+
{
83+
player addAction ["<t color='#FF0000'>Virtual Arsenal</t>", {["Open", true] spawn BIS_fnc_arsenal;}, [], 5, false, true];
84+
};
7385
}] call CFUNC(addEventhandler);
7486
};
7587

0 commit comments

Comments
 (0)