forked from LexTheGreat/TLX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoppatrol.sqf
85 lines (60 loc) · 2.24 KB
/
coppatrol.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
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
// script by eddiev223 and cobra//additions by Gman
_selection = ((_this select 3)select 0);
_moneyearned = 0;
_distance = 0;
if (_selection == "start") then
{
pmissionactive = true;
deleteMarkerLocal "patrolmarker";
_newmarker = (floor(random(count coppatrolarray)));
_markerlocation = (coppatrolarray select _newmarker);
_markerobj = createmarkerlocal ["patrolmarker",[0,0]];
_markername = "patrolmarker";
_markerobj setmarkershapelocal "Icon";
//"patrolmarker" setMarkerBrushLocal "solid";
"patrolmarker" setmarkertypelocal "warning";
"patrolmarker" setmarkercolorlocal "coloryellow";
"patrolmarker" setmarkersizelocal [1, 1];
"patrolmarker" setmarkertextlocal "Patrol point";
_markername Setmarkerposlocal _markerlocation;
player sidechat "Your patrol mission will be available shortly, simply get to the patrol point, time is not a factor in how large the payment is.";
sleep 2;
_plocation = getpos player;
_distance = _plocation distance _markerlocation;
while {pmissionactive} do {
if (player distance _markerlocation <= 30) then
{
deleteMarkerLocal "patrolmarker";
_moneyearned = (ceil(_distance * patrolmoneyperkm));
[player, _moneyearned] call transaction_bank;
player sidechat format["You earned $%1 for patroling", _moneyearned];
player sidechat "please wait a moment for a new patrol point";
sleep 5;
_newmarker = (floor(random(count coppatrolarray)));
_markerlocation = (coppatrolarray select _newmarker);
_markerobj = createmarkerlocal ["patrolmarker",[0,0]];
_markername = "patrolmarker";
_markerojb setmarkershapelocal "icon";
//"patrolmarker" setMarkerBrushLocal "solid";
"patrolmarker" setmarkertypelocal "warning";
"patrolmarker" setmarkercolorlocal "coloryellow";
"patrolmarker" setmarkersizelocal [1, 1];
"patrolmarker" setmarkertextlocal "Patrol point";
_markername Setmarkerposlocal _markerlocation;
player sidechat "New Patrol point added";
_plocation = getpos player;
_distance = _plocation distance _markerlocation;
};
sleep 5;
};
deleteMarkerLocal "patrolmarker";
};
if (_selection == "end") then
{
pmissionactive = false;
deleteMarkerLocal "patrolmarker";
player sidechat "Patrol mission ended you must wait 60s to get a new one";
patrolwaittime = true;
sleep 60;
patrolwaittime = false;
};