-
Notifications
You must be signed in to change notification settings - Fork 1
/
BDL_setOnFire.sqf
58 lines (53 loc) · 1.75 KB
/
BDL_setOnFire.sqf
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
/*
Author: BarboneDiLusso
steam : http://steamcommunity.com/id/barbonedilusso
gitHub : https://github.com/LucaM97/Arma3_BDL_Functions
Description:
Earthquake simulation
Parameter(s):
_this select 0: Obj - epicenter
_this select 1: INT - intensity {1,2,3,4}
_this select 2: bool - house destriction true/false
Example :
[player,10,true] spawn BDL_earthquake;
*/
BDL_setOnFire = {
_obj = _this select 0;
_fire_list = [];
_obj setdamage 0.1;
_fire = createVehicle ["test_EmptyObjectForFireBig",((getPos _obj) vectorAdd [0,0,1]),[],0,"CAN COLLIDE"];
_fire_list pushBack _fire;
_fire = createVehicle ["test_EmptyObjectForFireBig",((getPos _obj) vectorAdd [0,-3,1]),[],0,"CAN COLLIDE"];
_fire_list pushBack _fire;
_fire = createVehicle ["test_EmptyObjectForFireBig",((getPos _obj) vectorAdd [0,3,1]),[],0,"CAN COLLIDE"];
_fire_list pushBack _fire;
_obj setVariable ["BDL_fire_list",_fire_list];
_obj spawn {
_tmp_obj = _this;
while {getDammage _tmp_obj > 0 && getDammage _tmp_obj != 1 && ((count(_tmp_obj getVariable ["BDL_fire_list",[]])) > 0)} do {
sleep 1;
_tmp_obj setdamage (getDammage _tmp_obj + 0.005);
hintSilent format ["%1",getDammage _tmp_obj];
};
{
deleteVehicle _x;
_tmp_obj setVariable ["BDL_fire_list",[],true];
}foreach (_tmp_obj getVariable ["BDL_fire_list",[]]);
};
};
player addEventHandler ["fired",{
if ((typeOf(_this select 6)) == "SmokeShell") then {
if ((random 100) <= 5) then {
[]spawn{
call {
hint "spengo...";
sleep 5;
{
deleteVehicle _x;
cursorObject setVariable ["BDL_fire_list",[],true];
}foreach (cursorObject getVariable ["BDL_fire_list",[]]);
};
};
};
};
}];