forked from LexTheGreat/TLX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassassination.sqf
More file actions
222 lines (190 loc) · 7.73 KB
/
assassination.sqf
File metadata and controls
222 lines (190 loc) · 7.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// new version of assassin mission with vip and guards armed, car, new spawn locations, bug fixes and more stability by Scripter Eddie Vedder
_secondcounter = 0;
_minutecounter = 0;
_art = (_this select 3) select 0;
if (isNil "workplacejob_assassin_serverarray") then {workplacejob_assassin_serverarray = []};
if (_art == "serverloop") then {
while {true} do {
_t1 = diag_tickTime;
private["_i"];
_i = 0;
while { _i < (count workplacejob_assassin_serverarray) } do {
if (isNull ((workplacejob_assassin_serverarray select _i) select 0)) then {
if (!(isNull ((workplacejob_assassin_serverarray select _i) select 1))) then {
deleteVehicle ((workplacejob_assassin_serverarray select _i) select 1);
deletemarker "targetmarker";
};
workplacejob_assassin_serverarray set [_i,""];
workplacejob_assassin_serverarray = workplacejob_assassin_serverarray - [""];
"if(isBlu)then{player sidechat ""The threat to the VIP has been removed""}" call broadcast;
[diag_tickTime - _t1, "ASSASSIN LOOP"] call fnc_fps_hi_log;
sleep ((workplacejob_assassin_break)*60);
workplacejob_assassin_active = false;
publicvariable "workplacejob_assassin_active";
};
_i = _i + 1;
};
sleep 10;
};
};
if (_art == "getajob_assassin") then {
if(workplacejob_assassin_active) exitWith {
player groupChat "There are currently no targets that require assassination.";
};
if(workplacejob_assassion_failed) exitWith {
player groupChat "You have failed an assassination recently, maybe you'll be hired again later.";
};
_array = [[VIPspawn1, 10], [VIPspawn2, 10], [VIPspawn3, 10], [VIPspawn4, 10], [VIPspawn5, 10]];
_city = (floor(random(count _array)));
_pos = (_array select _city) select 0;
_radius = (_array select _city) select 1;
_a1 = 0;
//delete any left overs from last time this ran
deletemarker "targetmarker";
deletevehicle VIPtarget;
deletevehicle assveh;
deletevehicle VIPbodyguard1;
deletevehicle VIPbodyguard2;
//creating VIP
_group = createGroup west;
//[format["%1 (%2, %3, %4) - assasination: group created %5", round(time), player, (name player), (getPlayerUID player), _group]] call l4a;
VIPtarget = _group createUnit ["Functionary1_EP1", _pos, [], _radius, "FORM"];
xorE=true;
VIPtarget setvehicleinit 'liafu = true;VIPtarget = this;this setVehicleVarName "VIPtarget";';
//give vip weapon and clips
VIPtarget addweapon "M9";
VIPtarget addmagazine "15Rnd_9x19_M9";
VIPtarget addmagazine "15Rnd_9x19_M9";
VIPtarget addmagazine "15Rnd_9x19_M9";
VIPtarget addmagazine "15Rnd_9x19_M9";
VIPtarget addmagazine "15Rnd_9x19_M9";
VIPtarget addmagazine "15Rnd_9x19_M9";
//creating body guards
VIPbodyguard1 = _group createUnit ["Functionary2_EP1", _pos, [], _radius, "FORM"];
xorE=true;
VIPbodyguard1 setvehicleinit 'liafu = true;VIPbodyguard1 = this;this setVehicleVarName "VIPbodyguard1";';
VIPbodyguard1 addweapon "m9";
VIPbodyguard1 addmagazine "15Rnd_9x19_M9";
VIPbodyguard1 addmagazine "15Rnd_9x19_M9";
VIPbodyguard1 addmagazine "15Rnd_9x19_M9";
VIPbodyguard1 addmagazine "15Rnd_9x19_M9";
VIPbodyguard2 = _group createUnit ["Functionary2_EP1", _pos, [], _radius, "FORM"];
xorE=true;
VIPbodyguard2 setvehicleinit 'liafu = true;VIPbodyguard2 = this;this setVehicleVarName "VIPbodyguard2";';
VIPbodyguard2 addweapon "m9";
VIPbodyguard2 addmagazine "15Rnd_9x19_M9";
VIPbodyguard2 addmagazine "15Rnd_9x19_M9";
VIPbodyguard2 addmagazine "15Rnd_9x19_M9";
VIPbodyguard2 addmagazine "15Rnd_9x19_M9";
processInitCommands;
// make viptargets car
assveh = createVehicle ["VolhaLimo_TK_CIV_EP1", _pos, [] , 3, "NONE"];
xorE=true;
assveh setVehicleInit
"
liafu = true;
assveh = this;
this setVehicleVarName ""assveh"";
this setVehicleLock ""locked"";
this setAmmoCargo 0;
";
publicvariable "assveh";
processInitCommands;
// put vip inside the car
if (not(VIPtarget in assveh) and (alive VIPtarget)) then{
VIPtarget moveInDriver assveh;
VIPbodyguard1 doFollow VIPtarget;
VIPbodyguard2 doFollow VIptarget;
//VIPtarget assignAsDriver assveh;
VIPbodyguard1 moveInCargo assveh;
//VIPbodyguard1 assignAsCargo assveh;
VIPbodyguard2 moveInCargo assveh;
//VIPbodyguard2 assignAsCargo assveh;
};
format["workplacejob_assassin_serverarray = workplacejob_assassin_serverarray + [[%1, VIPtarget]];", player] call broadcast;
_markerobj = createMarker ["targetmarker",[0,0]];
_markername = "targetmarker";
_markerobj setMarkerShape "ICON";
"targetmarker" setMarkerType "Marker";
"targetmarker" setMarkerColor "ColorRed";
"targetmarker" setMarkerText "Assassination target";
_markername SetMarkerPos getPosASL VIPtarget;
workplacejob_assassin_active = true; publicvariable "workplacejob_assassin_active";
player groupChat "The VIP target has been marked on the map. Kill him before the police can take him to safety.";
"if (isBlu) then {player sideChat ""Someone is trying to kill a government VIP. The target has been marked on the map. Rescue the target before its too late!""};" call broadcast;
player groupchat "The police are on to you and the VIP knows you are coming, hurry up!";
[player, "(assassin)", 100000] call player_update_warrants;
VIPtarget domove getmarkerpos "policebase";
while {true} do {
/* removed this so the mission keeps going even if assassin dies
if(!alive player)exitwith
{
deletevehicle VIPtarget;
deletemarker "targetmarker";
};
*/
"if(alive player and isCiv and player distance assveh <= 150)then{titleText [""The Government is operating in this area! Turn back or you will be shot!"", ""plain down""]};" call broadcast;
_markername setmarkerpos getPosASL VIPtarget;
if (_secondcounter >= 15) then {
_group setBehaviour "AWARE";
_group setSpeedMode "NORMAL";
VIPtarget domove getmarkerpos "policebase";
_secondcounter = 0;
};
if (_minutecounter >= 1200) exitWith {
"server globalchat ""Assassination mission not completed within 20mins the mission has ended."";" call broadcast;
sleep 3;
deletevehicle VIPtarget;
deletemarker "targetmarker";
deletevehicle assveh;
deletevehicle VIPbodyguard1;
deletevehicle VIPbodyguard2;
_minutecounter = 0;
};
if (!alive VIPtarget and alive player) exitWith {
[player, 200000] call transaction_bank;
player groupchat "Well done. Target elimated. $200000 has been transfered to your account.";
sleep 10;
"server globalchat ""The VIP target has been killed!"";" call broadcast;
[player, "(vip-assasination)", 100000] call player_update_warrants;
deletevehicle VIPtarget;
deletemarker "targetmarker";
deletevehicle assveh;
deletevehicle VIPbodyguard1;
deletevehicle VIPbodyguard2;
};
if (VIPtarget distance getmarkerpos "policebase" < 100) exitwith {
"
server globalchat ""The VIP target has been rescued!"";
_copplayernumber = playersNumber west;
_copbonus = 5000;
if (isBlu) then {[player, _copbonus] call transaction_bank; player sidechat format[""you received $%1 for the successful rescue of the VIP"", _copbonus];};
" call broadcast;
sleep 2;
player groupchat "The vip was rescued, mission failed!";
workplacejob_assassion_failed = true;
deletevehicle VIPtarget;
deletemarker "targetmarker";
deletevehicle assveh;
deletevehicle VIPbodyguard1;
deletevehicle VIPbodyguard2;
};
_minutecounter = _minutecounter + 1;
_secondcounter = _secondcounter + 1;
sleep 1;
};
deletevehicle VIPtarget;
deletemarker "targetmarker";
deletevehicle assveh;
deletevehicle VIPbodyguard1;
deletevehicle VIPbodyguard2;
sleep ((workplacejob_assassin_break)*60);
workplacejob_assassin_active = false;
publicvariable "workplacejob_assassin_active";
if (workplacejob_assassion_failed) then {
sleep ((workplacejob_assassin_break)*60);
workplacejob_assassion_failed = false;
};
};
liafu = format["%1", (name player)];
// written by eddie vedder