Jump to content

[XaFlaForo Studios] SeatBelt System [Script]


XaFlaForo
 Share

Recommended Posts

Who we are:
Here at XaFlaForo Studios, we strive for perfection in our work. We work day in, day out, weekdays, weekends, to ensure quality in our products. Over the coming weeks we will be dropping a lot of products in to this forum that are remakes of popular scripts but they will be for free.

Why do we release this stuff for free:
Here at XaFlaForo Studios, our ethos is that Arma scripts should be readily available for the whole community to enjoy, instead of being cast away behind the ever-growing pay wall that we all love to hate. We are proud that we strive to give the community scripts without hiding them behind a paywall for only the most premium, as it bring the community closer together making Arma all that more enjoyable and you can learn from our scripts as they are not obfuscated.

Want free custom work?
https://docs.google.com/forms/d/e/1FAIpQLScbBsZ7-B1em1wZf3YSkKGNtWmikvap1CK0Oz4ssVDHJTu1oQ/viewform

How to support us?
Follow me on github - https://github.com/XaFlaForo
Add me on steam - https://steamcommunity.com/id/XaFlaForo

Post Details:
Script Name: Seat Belt
Framework: All
Inspired/Wanted From: Myself

How to download:
        - Base https://github.com/XaFlaForo/AltisLifeScripts/tree/Base-Installation-Pack
        - Files https://github.com/XaFlaForo/Altis-Life-Seatbelt-System

How to install:

STEP 1: Move the seat belts folder to XaFlaForo Folder

STEP 2: Add the following code to Config_Functions.hpp Under tag = "XaFlaForo";

   class Belts {
    file = "XaFlaForo\SeatBelts";
    class seatbeltaction {};
    class seatbeltOff {};
    class seatbeltOn {};
  };



STEP 3: Add the following code to fn_setupEVH.sqf

//--- XaFlaForo SeatBelts
player addEventHandler ["GetInMan", {XaFlaForo_seatbelt = false;}];
player addEventHandler ["GetOutMan", {XaFlaForo_seatbelt = false;}];


STEP 4: Add the following code to keyhandler

//--- END KEY 

case 207: { 
if (vehicle player != player) then { 
[] spawn XaFlaForo_fnc_seatbeltaction; 
}; 
}; 

STEP 5: Add the following code to handle_damage

//--- Seatbelt on so take off seatbelt
if ( vehicle _unit isKindOf "Car" && { isNull _source } || { _source isEqualTo _unit } ) then {

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

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

        //--- Damage gotten is less then current damage
        if ( _damage < _currentDamage ) then {

            //--- Set damage to current damage
            _damage = _currentDamage;

        };

    };

};

 

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

  • XaFlaForo changed the title to [XaFlaForo Studios] SeatBelt System [Script]
//--- Seatbelt on so take off seatbelt
if ( vehicle _unit isKindOf "Car" && { isNull _source } || { _source isEqualTo _unit } ) then {

    //--- Seatbelt on
    if ( XaFlaForo_seatbelt ) then {   //You had it as seatbalt

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

        //--- Damage gotten is less then current damage
        if ( _damage < _currentDamage ) then {

            //--- Set damage to current damage
            _damage = _currentDamage;

        };

    };

};
Link to comment
Share on other sites

I cant post my .RPT because of other information thats coming up atm but here is a part that is not happy about your Config_RemoteExec.hpp:

2019/04/26,  2:56:00 Error context ddEventHandler ["GetInMan", {XaFlaForo_seatbelt = false;}];
2019/04/26,  2:56:00 Warning Message: File mpmissions\Altis_Life.Altis\XaFlaForo\Config_RemoteExec.hpp, line 0: '.player': 'a' encountered instead of '='
2019/04/26,  2:56:00 Warning Message: Config : some input after EndOfFile.

This error doesnt really make sense to me because it refers to line 0, which correct me if Im wrong doesn't exist.

This is the Config_RemoteExec.hpp, maybe someone who looks at this post can see an issue.

//--- XaFlaForo SeatBelts
player addEventHandler ["GetInMan", {XaFlaForo_seatbelt = false;}];
player addEventHandler ["GetOutMan", {XaFlaForo_seatbelt = false;}];

 

Link to comment
Share on other sites

On 4/15/2019 at 9:58 PM, XaFlaForo said:

STEP 3: Add the following code to Config_RemoteExec.hpp 

//--- XaFlaForo SeatBelts
player addEventHandler ["GetInMan", {XaFlaForo_seatbelt = false;}];
player addEventHandler ["GetOutMan", {XaFlaForo_seatbelt = false;}];

This step makes no sense.

22 minutes ago, CPTBubbles said:

This error doesnt really make sense to me because it refers to line 0, which correct me if Im wrong doesn't exist.

This is the Config_RemoteExec.hpp, maybe someone who looks at this post can see an issue.

That would be because you are putting code in a config and that part of the tutorial makes no sense. My assumption is that you were intended to put that code here: https://github.com/AsYetUntitled/Framework/blob/8d42f714d30c4aecfe989e23921a9aafdcb9aa66/Altis_Life.Altis/core/fn_setupEVH.sqf

 

Link to comment
Share on other sites

  • 1 year later...

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.

 Share

×
×
  • Create New...

Important Information

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