Jump to content
Scalings // Mr. Whale

[TUTORIAL] Customization of Lights! (COP & EMS)

Recommended Posts

hello guys I have a problem I find the doctors who only have the blinkers in the offroad while on the other vehicles no, so I copied the same classes of police vehicles as they are equal and added classes to the fn_mediclights file and fn_sirenlight file I added the affected vehicles but it does not work!
 

Share this post


Link to post
Share on other sites
27 minutes ago, Federick90 said:

hello guys I have a problem I find the doctors who only have the blinkers in the offroad while on the other vehicles no, so I copied the same classes of police vehicles as they are equal and added classes to the fn_mediclights file and fn_sirenlight file I added the affected vehicles but it does not work!
 

There is plenty you need to edit for this:

The vehicle needs to be in your keyhandler: https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/core/functions/fn_keyHandler.sqf#L203

It needs to be in the array for medicSirensLights: https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/core/medical/fn_medicSirenLights.sqf#L14

Multiple switches need your vehicle in medicLights: https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/core/medical/fn_medicLights.sqf#L26

Share this post


Link to post
Share on other sites
15 minuti fa, ha detto che:

where am I wrong?
 

Questo è un hundler chiave

 // L Key?
    caso 38: {
        // Se la poliziotta controlla se le luci sono accese.
        se (_shift && playerSide in [west, independent]) poi {
            if (! (isNull objectParent player) && (typeOf vehicle player) 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"]) poi {
                if (! IsNil {vehicle player getVariable "lights"}) poi {
                    if (playerSide isEqualTo west) quindi {
                        [vehicle player] chiama life_fnc_sirenLights;
                    } else {
                        [vehicle player] chiama life_fnc_medicSirenLights;
                    };

                };
            };
        };

 

Questo è medico light.sqf

/ *
    File: fn_medicLights.sqf
    Autore: mindstorm, modificato da Adanteh
    Link: http://forums.bistudio.com/showthread.php?157474-Offroad-Police-sirens-lights-and-underglow

    Descrizione:
    aggiunge l'effetto luce ai veicoli della polizia, in particolare all'offroad.
* /

params [
    ["_vehicle", objNull, [objNull]],
    ["_lightTime", 0.22, [0]]
];

if (isNil "_vehicle" || {isNull _vehicle || {! (_ veicolo getVariable "lights")}}) exitWith {};

private _lightRed = [0.1, 0.1, 20];
private _lightBlue = [0.1, 0.1, 20];

_lightLeft = "#lightpoint" createVehicleLocal getPos _vehicle;
sleep 0.2;
_lightLeft setLightColor _lightBlue;
_lightLeft setLightBrightness 0.2;
_lightLeft setLightAmbient [0.1,0.1,1];

private _offset = switch (typeOf _vehicle) do {
    case "C_Offroad_01_F": {
        [-0.37, 0.0, 0.56];
    };
    case "B_MRAP_01_F": {
        [-0.37, -1.9, 0.7];
    };
    case "C_SUV_01_F": {
        [-0.37,-1.2,0.42];
    };
    case "C_Hatchback_01_sport_F": {
        [-0.35,-0.2,0.25];
    };
    case "B_Heli_Light_01_F": {
        [-0.37, 0.0, -0.80];
    };
    case "B_Heli_Transport_01_F": {
        [-0.5, 0.0, 0.81];
    };
};

_lightLeft setLightAttenuation [0.181, 0, 1000, 130];
_lightLeft setLightIntensity 10;
_lightLeft setLightFlareSize 0.38;
_lightLeft setLightFlareMaxDistance 150;
_lightLeft setLightUseFlare true;

_lightRight = "#lightpoint" createVehicleLocal getPos _vehicle;
sleep 0.2;
_lightRight setLightColor _lightBlue;
_lightRight setLightBrightness 0.2;
_lightRight setLightAmbient [0.1,0.1,1];

private _offset = switch (typeOf _vehicle) do {
    case "C_Offroad_01_F": {
        [-0.37, 0.0, 0.56];
    };
    case "B_MRAP_01_F": {
        [-0.37, -1.9, 0.7];
    };
    case "C_SUV_01_F": {
        [-0.37,-1.2,0.42];
    };
    case "C_Hatchback_01_sport_F": {
        [-0.35,-0.2,0.25];
    };
    case "B_Heli_Light_01_F": {
        [-0.37, 0.0, -0.80];
    };
    case "B_Heli_Transport_01_F": {
        [-0.5, 0.0, 0.81];
    };
};

_lightRight setLightAttenuation [0.181, 0, 1000, 130];
_lightRight setLightIntensity 10;
_lightRight setLightFlareSize 0.38;
_lightRight setLightFlareMaxDistance 150;
_lightRight setLightUseFlare true;

_lightLeft setLightDayLight true;
_lightRight setLightDayLight true;

private _leftRed = true;
while {alive _vehicle} do {
    if !(_vehicle getVariable "lights") exitWith {};
    if (_leftRed) then {
        _lightRight setLightBrightness 0.0;
        sleep 0.05;
        _lightLeft setLightBrightness 6;
    } else {
        _lightLeft setLightBrightness 0.0;
        sleep 0.05;
        _lightRight setLightBrightness 6;
    };
    _leftRed = !_leftRed;
    sleep _lightTime;
};

deleteVehicle _lightLeft;
deleteVehicle _lightRight;

 

 

 

and sirenlights

 

#include "..\..\script_macros.hpp"
/*
    File: fn_sirenLights.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Lets play a game! Can you guess what it does? I have faith in you, if you can't
    then you have failed me and therefor I lose all faith in humanity.. No pressure.
*/
params [
    ["_vehicle",objNull,[objNull]]
];
if (isNull _vehicle) exitWith {}; //Bad entry!
if !(typeOf _vehicle 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"]) exitWith {}; //Last chance check to prevent something from defying humanity and creating a monster.

private _trueorfalse = _vehicle getVariable ["lights",false];

if (_trueorfalse) then {
    _vehicle setVariable ["lights", false, true];
    if! (isNil {(_vehicle getVariable "lightsJIP")}) then {
        private _jip = _vehicle getVariable "lightsJIP";
        _vehicle setVariable ["lightsJIP", nil, true];
        remoteExec ["", _jip]; // rimuovi dalla coda JIP
    };
} else {
    _vehicle setVariable ["lights", true, true];
    private _jip = [_vehicle, 0.22] remoteExec ["life_fnc_medicLights", RCLIENT, true];
    _vehicle setVariable ["lightsJIP", _ jip, true];
};

 

 

Edited by Federick90

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

×