Forum Jump :

Author Message


Posts: 1
Rank:


Level: Member

Country: au
Location:
Occupation:
Age:
In-game name:

 
#16 Posted at 2019-12-11 16:44        
     
# Myke : Duh...how could i overlook this one here. Geeze, sure your siren will never stop because your while do loop has no exit condition.

while {true} do
TRUE is always TRUE, it will never be FALSE, therefor the while loop will never end (at least as long it doesn't hit the 10000 loops limit).

In the sirenon.sqf you have to insert this:
_car = _this select 0;

this removeaction SirenOn;
SirenOff = this addaction ["Siren Off", "SirenOff.sqf"];
DCV_siren = true;
While {DCV_siren} do
{
0 fadesound 1; _car say "SirenPolice";
sleep 5;
};
and in the sirenoff.sqf you add this:
_car = _this select 0;

DCV_siren = false;
0 fadesound 1; _car say "SirenOff";

this removeaction SirenOff;
SirenOn = _car addaction ["Siren On", "SirenOn.sqf"];

Thanks for the info. Helped me a lot.