Jump to content
XaFlaForo

[IRT STUDIOS] Script - SeatBelts

Recommended Posts

AltisLife-IRT-SeatBelts

Requires IRT Base:  https://github.com/XaFlaForo/AltisLife-IRT-BaseInstallation

DOWNLOAD PACKAGES: https://github.com/XaFlaForo/AltisLife-IRT-SeatBelts

Step 1: IN IRT_FUNCTIONS.HPP ADD UNDER OFPECTAG LINE

#include "Seatbelts\Functions.hpp"

Step 2: IN IRT_CONFIG.HPP ADD

#include "Seatbelts\config.hpp"

Step 3: IN FN_KEYHANDLER FIND THIS AND CHANGE THE CASE TO A DIFFERENT DIK_CODE

//Surrender (Shift + B)
    case 48: {
        if (_shift) then {
            if (player getVariable ["playerSurrender",false]) then {
                player setVariable ["playerSurrender",false,true];
            } else {
                [] spawn life_fnc_surrender;
            };
            _handled = true;
        };
    };

Step 4: IN FN_KEYHANDLER ADD 

//--- SeatBelts (B KEY)
    case 48: {
        if (vehicle player != player) then {
           [] spawn IRT_fnc_seatbeltaction;
        };
    };

Step 5: IN CONFIGURATION.SQF ADD 

//--- Set SeatBelt Variable As A Boolean
IRT_seatbelt = false;

Step 6: IN INITPLAYERLOCAL ADD 

[] spawn IRT_fnc_initbelts;

Step 7: IN HANDLE DAMAGE ADD 

//--- Crashed Vehicle
if ( vehicle _unit isKindOf "Car" && { isNull _source } || { _source isEqualTo _unit } ) then {

	//--- Seatbelt on
	if ( IRT_SeatBelt ) then {

		//--- Divide Damage in Half
		_damage = _damage / 2;

        //--- Take SeatBelt Off
        IRT_SeatBelt = false;

	};

};

 

THERE YOU GO DONE

Edited by XaFlaForo
  • Like 1
Link to post
Share on other sites

Error in expression <)) then {
_damage = 0;
};
};
};
};


if ( vehicle _unit isKindOf "Car" && { i>
  Error position: <( vehicle _unit isKindOf "Car" && { i>
  Error Invalid number in expression
File core\functions\fn_handleDamage.sqf [life_fnc_handleDamage], line 105
Error in expression <)) then {
_damage = 0;
};
};
};
};


if ( vehicle _unit isKindOf "Car" && { i>
  Error position: <( vehicle _unit isKindOf "Car" && { i>
  Error Invalid number in expression
File core\functions\fn_handleDamage.sqf [life_fnc_handleDamage], line 105

Link to post
Share on other sites

@Salkio | privatealpha.co.za

//--- Crashed Vehicle
if ( vehicle _unit isKindOf "Car" && { isNull _source } || { _source isEqualTo _unit } ) then {
    
    //--- Check Config To Start Effects
    if (getNumber (missionConfigFile >> "CfgSeatBelts" >> "effects") isEqualTo 1) then { [] call IRT_fnc_BeltEffects; };

	//--- Seatbelt on
	if ( IRT_SeatBelt ) then {

		//--- Divide Damage in Half
		_damage = _damage / 2;

        //--- Take SeatBelt Off
        IRT_SeatBelt = false;

	};

};

 

Link to post
Share on other sites

Step 3: IN FN_KEYHANDLER FIND THIS AND CHANGE THE CASE TO A DIFFERENT DIK_CODE

//Surrender (Shift + B)
    case 48: {
        if (_shift) then {
            if (player getVariable ["playerSurrender",false]) then {
                player setVariable ["playerSurrender",false,true];
            } else {
                [] spawn life_fnc_surrender;
            };
            _handled = true;
        };
    };

Step 4: IN FN_KEYHANDLER ADD 

//--- SeatBelts (B KEY)
    case 48: {
        if (vehicle player != player) then {
           [] spawn IRT_fnc_seatbeltaction;
        };
    };

 

I did not understand these steps could you tell me what to do?

 

Link to post
Share on other sites
23 hours ago, Madanazzi said:

 

I did not understand these steps could you tell me what to do?

 

He wants to use the "B" key on the keyboard for seatbelts, so he wants you to change your surrender to another key. The key is the number after "case".

You can find the numbers here: https://community.bistudio.com/wiki/DIK_KeyCodes#German_keyboard

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.