-
Notifications
You must be signed in to change notification settings - Fork 4
/
SpeedCams.sqf
50 lines (42 loc) · 1.67 KB
/
SpeedCams.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
private ["_penalty"];
while {isciv} do
{
if (!ismedic) then {
_car = vehicle player;
_speed = speed _car;
_type = typeof _car;
{
if ((player == driver _car) and (_car distance _x < 30) and (_speed >= 95) and !(_car iskindof "Air")) then {
_infos = _type call INV_getitemArray;
_license = (_infos select 4) select 1;
titleCut [" ","white in",1];
if(_speed >= 95 and _speed < 110) then {_penalty = 1};
if(_speed >= 110 and _speed < 120) then {_penalty = 2};
if(_speed >= 120 and _speed < 130) then {_penalty = 3};
if(_speed >= 130) then {_penalty = 4};
hintSilent format["You have just been caught speeding! (Limit: 90, Speed: %1)", round _speed];
sleep 2;
if (_car isKindOf "truck") then {
if(truckDemerits == 0 || !("truck" call INV_HasLicense)) exitWith {};
truckDemerits = truckDemerits - _penalty;
if(truckDemerits <= 0) then {
truckDemerits = 0;
["addWarrant",player,"Driving Without a License",250] execVM "warrant.sqf";
INV_LizenzOwner = INV_LizenzOwner - ["truck"];
};
hintSilent format["Truck Demerit points lost: %1. Truck Demerit points remaining: %2", _penalty, truckDemerits];
} else {
if(demerits == 0 || !("car" call INV_HasLicense)) exitWith {};
demerits = demerits - _penalty;
if(demerits <= 0) then {
demerits = 0;
["addWarrant",player,"Driving Without a License",200] execVM "warrant.sqf";
INV_LizenzOwner = INV_LizenzOwner - ["car"];
};
hintSilent format["Demerit points lost: %1. Demerit points remaining: %2", _penalty, demerits];
};
};
} foreach speedcamarray;
};
sleep 0.5;
};