Jump to content
AmaZiinG

Attachable Lightbar [Police]

Recommended Posts

Autor: Blackfisch

How it looks like ingame:

 

1. Download the Folder form here: https://github.com/BlackFisch/AttachableLightbar

 Add the Fils in the right Folders !!!

2. Open your init.sqf and add:

emergLight_vehicles = [];
{
 emergLight_vehicles pushBack (configName _x);
} forEach ("true" configClasses (missionConfigFile >> "emergLightVehicles"));

2. Go in your description.ext and search:

#include "config\Config_Master.hpp"

add direct under:

#include "Config_EmergLights.hpp"

4. Open your CfgRemoteExec.hpp and add

F(bf_fnc_lightsOn,ANYONE)

5. Now go in your Functions.hpp and add over 

class Life_Client_Core

these:

class blackfisch_Functions {
 tag = "bf";

 class Scripts {
 file = "core\scripts";
 class lights {};
 class lightsOn {};
 };
};

6. Open your fn_keyHandler.sqf and search

case 38

replace :

case 38: {
 private _veh = vehicle player;
 if (_ctrlKey && {!_shift} && {!isNull objectParent player} && {(driver _veh) isEqualTo player} && {playerSide isEqualTo west}) then {
 call bf_fnc_lights;
 _handled = true;
 };
 if (_shift && {!_ctrlKey} && {!isNull objectParent player} && {(driver _veh) isEqualTo player} && {playerSide isEqualTo west}) then {
 if (!isNull (_veh getVariable ["lightObj",objNull])) then {
 if (_veh getVariable ["lights",false]) then {
 _veh setVariable ["lights",false,true];
 } else {
 _veh setVariable ["lights",true,true];
 [_veh] remoteExec ["bf_fnc_lightsOn",0];
 };
 } else {
 if ((typeOf _veh) in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"]) then {
 if (!isNil {_veh getVariable "lights"}) then {
 if (playerSide isEqualTo west) then {
 [_veh] call life_fnc_sirenLights;
 } else {
 [_veh] call life_fnc_medicSirenLights;
 };
 _handled = true;
 };
 };
 };
 _handled = true;
 };
 };

Finish !

Link to post
Share on other sites
18 hours ago, AmaZiinG said:

Autor: Blackfisch

How it looks like ingame:

 

1. Download the Folder form here: https://github.com/BlackFisch/AttachableLightbar

 Add the Fils in the right Folders !!!

2. Open your init.sqf and add:

emergLight_vehicles = [];
{
 emergLight_vehicles pushBack (configName _x);
} forEach ("true" configClasses (missionConfigFile >> "emergLightVehicles"));

2. Go in your description.ext and search:

#include "config\Config_Master.hpp"

add direct under:

#include "Config_EmergLights.hpp"

4. Open your CfgRemoteExec.hpp and add

F(bf_fnc_lightsOn,ANYONE)

5. Now go in your Functions.hpp and add over 

class Life_Client_Core

these:

class blackfisch_Functions {
 tag = "bf";

 class Scripts {
 file = "core\scripts";
 class lights {};
 class lightsOn {};
 };
};

6. Open your fn_keyHandler.sqf and search

case 38

replace :

case 38: {
 private _veh = vehicle player;
 if (_ctrlKey && {!_shift} && {!isNull objectParent player} && {(driver _veh) isEqualTo player} && {playerSide isEqualTo west}) then {
 call bf_fnc_lights;
 _handled = true;
 };
 if (_shift && {!_ctrlKey} && {!isNull objectParent player} && {(driver _veh) isEqualTo player} && {playerSide isEqualTo west}) then {
 if (!isNull (_veh getVariable ["lightObj",objNull])) then {
 if (_veh getVariable ["lights",false]) then {
 _veh setVariable ["lights",false,true];
 } else {
 _veh setVariable ["lights",true,true];
 [_veh] remoteExec ["bf_fnc_lightsOn",0];
 };
 } else {
 if ((typeOf _veh) in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"]) then {
 if (!isNil {_veh getVariable "lights"}) then {
 if (playerSide isEqualTo west) then {
 [_veh] call life_fnc_sirenLights;
 } else {
 [_veh] call life_fnc_medicSirenLights;
 };
 _handled = true;
 };
 };
 };
 _handled = true;
 };
 };

Finish !

init.sqf in core or in main root?

Link to post
Share on other sites

Getting this error and then KeyHandler stops working

Quote

Error in expression <c ["life_fnc_say3D",0 ];
};
};
};
};
};
};

_handled;>
  Error position: <};

_handled;>
  Error Missing {
File core\functions\fn_keyHandler.sqf [life_fnc_keyHandler], line 485
Error in expression <c ["life_fnc_say3D",0 ];
};
};
};
};
};
};

_handled;>
  Error position: <};

_handled;>
  Error Missing {
File core\functions\fn_keyHandler.sqf [life_fnc_keyHandler], line 485

 

Link to post
Share on other sites

@AmaZiinG

 

How do i fix this?

Quote

Error in expression <c ["life_fnc_say3D",0 ];
};
};
};
};
};
};

_handled;>
  Error position: <};

_handled;>
  Error Missing {
File core\functions\fn_keyHandler.sqf [life_fnc_keyHandler], line 485
Error in expression <c ["life_fnc_say3D",0 ];
};
};
};
};
};
};

_handled;>
  Error position: <};

_handled;>
  Error Missing {
File core\functions\fn_keyHandler.sqf [life_fnc_keyHandler], line 485

 

Link to post
Share on other sites

If anyone creates new light positions (or if i do it before someone posts it) for all the basic police vehicles, I'd appreciate it if it you could share it.

 

So far I have:

class C_Van_01_box_F {
        pos[] = { 0.4, -0.02, 0.82 };
    };

    class B_MRAP_01_F {
        pos[] = { 0.7, -0.05, -0.1 };
    };

 

Link to post
Share on other sites
On 4/11/2017 at 10:31 PM, Repentz said:

If anyone creates new light positions (or if i do it before someone posts it) for all the basic police vehicles, I'd appreciate it if it you could share it.

 

So far I have:

class C_Van_01_box_F {
        pos[] = { 0.4, -0.02, 0.82 };
    };

    class B_MRAP_01_F {
        pos[] = { 0.7, -0.05, -0.1 };
    };

 

How do you find out where to put the lights? Is it just trial and error?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.