Jump to content
Repentz

[Tutorial] Seatbelts

Recommended Posts

Hey how do I repeat my sound? 

Quote

if(!isNil "life_seatbelt") then 
{
    if (vehicle player != player) then 
    {
        if(life_seatbelt) then 
        {
            LIFEctrl(IDC_LIFE_BAR_SeatBelt) ctrlSetText "textures\SeatBelts\seatbeltOn.paa";
        }
        else 
        {
            LIFEctrl(IDC_LIFE_BAR_SeatBelt) ctrlSetText "textures\SeatBelts\seatbeltOff.paa";
                while {true} do 
            {
                playsound "seatbelt";
                sleep 1.90;
            };
        };
    } else 
    {
        LIFEctrl(IDC_LIFE_BAR_SeatBelt) ctrlSetText "";
    };
};

I have put the playsound in the hudupdate.sqf file as I couldn't make it play the sound when you got on the vehicle but only when the seatbelt was removed once put on for the first time. So basically what I am saying is that the SeatBelt noise needs to play on repeat both when you enter the vehicle while the seatbelt is off and then when it is removed again it must play the sound still.

Also it will currently play the sound once and then stop.

Thanks in advance!

 

Edited by Kermit005

Share this post


Link to post
Share on other sites
On 28.5.2017 at 3:28 PM, Jean Yve said:
Hello,

It is possible to prevent being able to get out if one does not remove the belt?

 

Jean Yve

+1

is there any function yet to prevent getting out when belt is still attached?

Share this post


Link to post
Share on other sites

I am currently getting a error with this.

 0:19:25 Warning Message: File mpmissions\__cur_mp.Altis\dialog\hud_stats.hpp, line 17: Config: 'L' after Life_RscText_HUDWater
 0:19:25 Warning Message: File mpmissions\__cur_mp.Altis\dialog\hud_stats.hpp, line 17: Config: 'I' encountered instead of ','
 0:19:25 Warning Message: Config : some input after EndOfFile.

 

My hud_stats.hpp

class playerHUD {
    idd = -1;
    duration = 10e10;
    movingEnable = 0;
    fadein = 0;
    fadeout = 0;
    name = "playerHUD";
    onLoad = "uiNamespace setVariable ['playerHUD',_this select 0]";
    objects[] = {};
    controls[] = {
        Life_RscBackground_HUD,
        Life_RscProgress_HUDFood,
        Life_RscProgress_HUDHealth,
        Life_RscProgress_HUDWater,
        Life_RscText_HUDFood,
        Life_RscText_HUDHealth,
        Life_RscText_HUDWater,
		LIFE_BAR_SeatBelt		
    };

 

Share this post


Link to post
Share on other sites

Script core\fn_seatbelt.sqf not found and i did everything step by step right!!!

I add the sqf in core file but still i get another error : Include file mpmissions\script_macros.hpp not found.

Please someone help

Edited by Johnny Cash
another error

Share this post


Link to post
Share on other sites
21 minutes ago, Johnny Cash said:

Script core\fn_seatbelt.sqf not found and i did everything step by step right!!!

I add the sqf in core file but still i get another error : Include file mpmissions\script_macros.hpp not found.

Please someone help

It does not go in just core it goes in core then functions.

Share this post


Link to post
Share on other sites
Just now, silencedaxis said:

It does not go in just core it goes in core then functions.

if i put in in functions i get this : Script core\fn_seatbelt.sqf not found

Thank you for the quick reply

Share this post


Link to post
Share on other sites
1 hour ago, Johnny Cash said:

if i put in in functions i get this : Script core\fn_seatbelt.sqf not found

Thank you for the quick reply

core/functions/fn_seatbelt.sqf

any script referencing functions is leading to here!

core/functions

thats where it goes buddy...

Share this post


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

Hi does anyone know why this script only works for cops and EMS but not civs I've been through it 3 times now and I have everything 100% the same as the tutorial 

Can we have some more detail? Does it appear on the scroll wheel as civ? Do you get any errors if it is in the scroll wheel menu when you try and put it on?

 

Thanks,

Nathan

Share this post


Link to post
Share on other sites
6 hours ago, DeadeyeGaming90 said:

Hi does anyone know why this script only works for cops and EMS but not civs I've been through it 3 times now and I have everything 100% the same as the tutorial 

Are you sure you put this in the rite spot?

Next, let's go into core/setupActions.sqf, place this at the very bottom to enable for all sides:

life_actions pushBack (player addAction["<t color = '#D660D6'>Put on Seatbelt</t>",life_fnc_seatbelt,"",7,false,false,"",' !life_seatbelt && vehicle player != player ']);
life_actions pushBack (player addAction["<t color = '#D660D6'>Remove Seatbelt</t>",life_fnc_seatbelt,"",7,false,false,"",' life_seatbelt && vehicle player != player ']);

Like ;

/*
    File: fn_setupActions.sqf
    Author:

    Description:
    Master addAction file handler for all client-based actions.
*/
switch (playerSide) do {
    case civilian: {
        //Drop fishing net
        life_actions = [player addAction[localize "STR_pAct_DropFishingNet",life_fnc_dropFishingNet,"",0,false,false,"",'
        (surfaceisWater (getPos vehicle player)) && (vehicle player isKindOf "Ship") && life_carryWeight < life_maxWeight && speed (vehicle player) < 2 && speed (vehicle player) > -1 && !life_net_dropped ']];
        //Rob person
        life_actions = life_actions + [player addAction[localize "STR_pAct_RobPerson",life_fnc_robAction,"",0,false,false,"",'
        !isNull cursorObject && player distance cursorObject < 3.5 && isPlayer cursorObject && animationState cursorObject == "Incapacitated" && !(cursorObject getVariable ["robbed",false]) ']];
		//Gang
		life_actions = life_actions + [player addAction["<t color='#FF0000'>Capture Gang Location</t>",life_fnc_areaCapture,"",0,false,false,"",' ((typeOf cursorTarget) == "Flag_Red_F") ']];
		//Seatbelt
		life_actions pushBack (player addAction["<t color = '#D660D6'>Put on Seatbelt</t>",life_fnc_seatbelt,"",7,false,false,"",' !life_seatbelt && vehicle player != player ']);
		life_actions pushBack (player addAction["<t color = '#D660D6'>Remove Seatbelt</t>",life_fnc_seatbelt,"",7,false,false,"",' life_seatbelt && vehicle player != player ']);
		
    };
};

 

Edited by one

Share this post


Link to post
Share on other sites
19 hours ago, MrDeano said:

how can i make it so this allso works for helis?

Deano, Pretty sure if you crash a heli into a wall or building the heli is going to blow up and i dont think the seat belt can save you from that xD

Share this post


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

Deano, Pretty sure if you crash a heli into a wall or building the heli is going to blow up and i dont think the seat belt can save you from that xD

im a dev for you and on your server you have it so if you crash your heli you only take 50%

Share this post


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...