Jump to content
dexatrin82

Seatbelts Not Working

Recommended Posts

It's not even giving me the option, and forgive me, but I have forgotten where my clientside rpt file is lol

Edited by dexatrin82

Share this post


Link to post
Share on other sites

Nothing stood out to me unfortunately, you can try following the tutorial again and making sure you did it right, and/or put some diag_logs in your files to make sure what you would expect to happen is happening.

Share this post


Link to post
Share on other sites

 

I doubt it will have any effect but you could try removing "localize" from the addActions in "fn_setupActions.sqf" the tutorial's addActions don't have it.

Share this post


Link to post
Share on other sites

@dexatrin82  In your "config.sqf" move "life_seatbelt = false;"

from "Life Variables"

CASH = 0;
life_seatbelt = false;

to

"Backend Variables".

life_isSuiciding = false;

life_seatbelt = false;

 

Edited by Fawks
@ed the OP.

Share this post


Link to post
Share on other sites

Also, in your "fn_setupActions move the "put on/take off seatbelt" addActions into the cases.
For civilians

case civilian: {
//Drop fishing net
life_actions pushBack (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 pushBack (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]) ']);

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

For Cops

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

For EMS

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

 

Share this post


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

Now, If only someone can explain why it's showing my seatbelt icon as seatbelt off even when I put it on.

You have the options disabled by default in the tutorial. Make sure you look back at the tutorial and remove the comment (//) from all the lines like these:
image.thumb.png.0aa6680190018f890bf58521b481d90b.png

 

Should be in your "fn_seatBelt.sqf" and "initPlayerLocal.sqf".

Share this post


Link to post
Share on other sites
20 hours ago, dexatrin82 said:

yeah I have that, but it's only showing the off icon not the on icon

In the files you posted, you don't have that. It's still commented out (// in front of the line like in my image). Have you changed that since?

Share this post


Link to post
Share on other sites
On 1/8/2019 at 11:39 PM, Fawks said:

Also, in your "fn_setupActions move the "put on/take off seatbelt" addActions into the cases.
For civilians

case civilian: {
//Drop fishing net
life_actions pushBack (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 pushBack (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]) ']);

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

For Cops

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

For EMS

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

 

🤦‍♂️
absolutely unnecessary, you only need one set of them, do not add them into each case add it to the bottom of the file outside of the switch to make it global to all sides.
(why add the same thing 3 times?)

also yes, please remove localize from your addActions, you aren't calling to any string in your stringtable @dexatrin82

Edited by Prophet
@ him

Share this post


Link to post
Share on other sites
10 hours ago, Prophet said:

🤦‍♂️
absolutely unnecessary, you only need one set of them, do not add them into each case add it to the bottom of the file outside of the switch to make it global to all sides.
(why add the same thing 3 times?)

also yes, please remove localize from your addActions, you aren't calling to any string in your stringtable @dexatrin82

When I added it to the bottom of the file only Civs would get the option. Adding it into all 3 cases fixed the issue. It's not the best fix in the world but it's one that works and isn't causing any errors or slowdowns.

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

×