Jump to content
AmaZiinG

Traffic light script for the e76 traffic lights

Recommended Posts

Author: Unknown

 

ALL STEP FOR THE LIFE_SERVER 

1. Creat a new .sqf file and named it "trafficLights.sqf" and copy following in the file:

/*
 File: trafficLights.sqf
*/

_1a1 = nearestObject [[8538.83,6580.55,0.0999994], "Land_E76_trafficlight02a"];
_1a2 = nearestObject [[8564.94,6599.19,0.0999994], "Land_E76_trafficlight02a"];
_1b1 = nearestObject [[8560.69,6576.75,0.0999994], "Land_E76_trafficlight02a"];
_1b2 = nearestObject [[8542.31,6603.25,0.0999994], "Land_E76_trafficlight02a"];

_2a1 = nearestObject [[8559.91,6702.75,0.0999994], "Land_E76_trafficlight02a"];
_2a2 = nearestObject [[8584.66,6711.34,0.0999994], "Land_E76_trafficlight02a"];
_2b1 = nearestObject [[8582.81,6698.59,0.0999994], "Land_E76_trafficlight03a"];
_2b2 = nearestObject [[8561.75,6715.16,0.0999994], "Land_E76_trafficlight03a"];

_3a1 = nearestObject [[8633.36,6689.42,0.0999994], "Land_E76_trafficlight02a"];
_3a2 = nearestObject [[8658.5,6698.38,0.0999994], "Land_E76_trafficlight02a"];
_3b1 = nearestObject [[8635.84,6702.06,0.0999994], "Land_E76_trafficlight03a"];
_3b2 = nearestObject [[8656.66,6685.59,0.0999994], "Land_E76_trafficlight03a"];

_4a1 = nearestObject [[8654.06,6808.72,0.0999994], "Land_E76_trafficlight02a"];
_4a2 = nearestObject [[8681.03,6826.94,0.0999994], "Land_E76_trafficlight02a"];
_4b1 = nearestObject [[8677.22,6803.5,0.0999994], "Land_E76_trafficlight02a"];
_4b2 = nearestObject [[8659.03,6830.69,0.0999994], "Land_E76_trafficlight02a"];

_5a1 = nearestObject [[3566.718,7536.303,0.0999994], "Land_E76_trafficlight02a"];
_5a2 = nearestObject [[3549.829,7560.835,0.0999994], "Land_E76_trafficlight02a"];
_5b1 = nearestObject [[3566.718,7536.303,0.0999994], "Land_E76_trafficlight02a"];
_5b2 = nearestObject [[3549.829,7560.835,0.0999994], "Land_E76_trafficlight02a"];

_6a1 = nearestObject [[3474.609,7607.043,0.0999994], "Land_E76_trafficlight02a"];
_6a2 = nearestObject [[3466.915,7628.361,0.0999994], "Land_E76_trafficlight02a"];
_6b1 = nearestObject [[3479.372,7630.38,0.0999994], "Land_E76_trafficlight02a"];
_6b2 = nearestObject [[3459.278,7609.513,0.0999994], "Land_E76_trafficlight02a"];

_7a1 = nearestObject [[8300.073,6360.755,0.0999994], "Land_E76_trafficlight02a"];
_7a2 = nearestObject [[8320.945,6368.557,0.0999994], "Land_E76_trafficlight02a"];
_7b1 = nearestObject [[8315.313,6356.344,0.0999994], "Land_E76_trafficlight02a"];
_7b2 = nearestObject [[8306.522,6375.654,0.0999994], "Land_E76_trafficlight02a"];

as = [_1a1,_1a2,_2a1,_2a2,_3a1,_3a2,_4a1,_4a2,_5a1,_5a2,_6a1,_6a2,_7a1,_7a2];//as on same
bs = [_1b1,_1b2,_2b1,_2b2,_3b1,_3b2,_4b1,_4b2,_5b1,_5b2,_6b1,_6b2,_7b1,_7b2];//bs on same

//beim start auf rot setzen bs
{
 _x animate ["switchred",0];
} foreach bs;

active = as;
lightSwitch = true;
counter = 0;

_lightLoop = {
 
 if(counter == 0) exitWith {
 {
 _x animate ["switchgreen",0];
 } foreach active;
 
 {
 _x animate ["switchred",1];
 } foreach active;
 counter = 3;
 };
 if(counter < 17 && {counter > 0}) exitWith {
 counter = counter + 3;
 };
 if(counter == 18) exitWith {
 {
 _x animate ["switchgreen",1];
 } foreach active;
 
 {
 _x animate ["switchyellow",0];
 } foreach active;
 counter = 21;
 };
 if(counter < 23 && {counter > 17}) exitWith {
 counter = counter + 3;
 };
 if(counter == 24) exitWith {
 {
 _x animate ["switchyellow",1];
 } foreach active;
 
 {
 _x animate ["switchred",0];
 } foreach active;
 counter = 27;
 };
 
 if(lightSwitch) then {
 active = bs;
 lightSwitch = false;
 } else {
 active = as;
 lightSwitch = true;
 };
 
 if(counter == 27) then {
 counter = 0;
 };
 
 if(isServer && {life_loopExit}) exitWith {
 [_this select 1] call CBA_fnc_removePerFrameHandler;
 as = nil;
 bs = nil;
 active = nil;
 lightSwitch = nil;
 counter = nil;
 [] remoteExecCall ["TON_fnc_trafficLights",hc_1];
 };
 if(isServer && {!isNil "hc_1"} && {!isNil "life_HC_isActive"} && {life_HC_isActive}) exitWith {
 [_this select 1] call CBA_fnc_removePerFrameHandler;
 life_loopExit = true;
 as = nil;
 bs = nil;
 active = nil;
 lightSwitch = nil;
 counter = nil;
 [] remoteExecCall ["TON_fnc_trafficLights",hc_1];
 };
};

[_lightLoop, 3, []] call CBA_fnc_addPerFrameHandler;

2. Now open the init.sqf and past on the bottom of the file following:

[] execVM "\life_server\trafficLights.sqf";

Finish !

  • Like 3

Share this post


Link to post
Share on other sites
2 hours ago, ❃ AlaskaMaska ❃ said:

Where can I get the e76 traffic lights?

This script is from A3L. So you would have to use the A3L map or Kelleys Island.

  • Confused 1

Share this post


Link to post
Share on other sites

It isnt from A3L. You must download the E76 Roads. If you have a another Map you must change the corridates.

  • Like 2

Share this post


Link to post
Share on other sites
On 5/9/2018 at 8:12 AM, AmaZiinG said:

It isnt from A3L. You must download the E76 Roads. If you have a another Map you must change the corridates.

mhhmm what ever you say.

Share this post


Link to post
Share on other sites
On 5/11/2018 at 10:20 AM, Deadlesszombie said:

You are stupid

Sir you forgot to close your statement. And they made you a mod? Must be seeking low level of intelligence to have you on the team.

Edited by GraveYard

Share this post


Link to post
Share on other sites
On 12/05/2018 at 2:35 PM, GraveYard said:

Sir you forgot to close your statement. And they made you a mod? Must be seeking low level of intelligence to have you on the team.

Who are you? You clearly don't know what you are talking about.

Share this post


Link to post
Share on other sites

@GraveYard Deadlesszombie is a very intelligent man. 

On 5/10/2018 at 12:17 AM, GraveYard said:

This script is from A3L. So you would have to use the A3L map or Kelleys Island.

On the other hand you don't seem very intelligent my kind sir.

  • Like 1

Share this post


Link to post
Share on other sites
On 5/9/2018 at 11:12 AM, AmaZiinG said:

It isnt from A3L. You must download the E76 Roads. If you have a another Map you must change the corridates.

Brain Cell Lose

 

Share this post


Link to post
Share on other sites
On 5/9/2018 at 10:47 AM, GraveYard said:

This script is from A3L. So you would have to use the A3L map or Kelleys Island.

Fifty Shades of Lost Brain Cells

Did you buy that brain

Edited by Gavin

Share this post


Link to post
Share on other sites
Guest
2 hours ago, Gavin said:

Fifty Shades of Lost Brain Cells

Did you buy that brain

What a worstless comment 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×