Stormmy1950 41 Posted March 6, 2018 so i have the script that works when the players join at the same time but i wanted to add when players join on a random time to still have earplugs and i added JIP but not correcly if somebody can tell me how to add JIP correclty i have error Missing ] [ player addAction ["Enable earuplugs ",{ params ["_plyr","_caller","_id"]; private _actMenu = (_plyr actionParams _id) select 0; if (_actMenu isEqualTo "Disable earuplugs") then { _actMenu = "Enable earuplugs"; call disableEarplugs; } else { _actMenu = "Disable earuplugs"; call enableEarplugs; }; _plyr setUserActionText [_id,_actMenu]; },nil,0.8,false,true,"", ""], ] call BIS_fnc_MP; 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted March 6, 2018 Hello there Stormmy1950! There is also this if you want to check: Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted March 6, 2018 Can you paste the code? or give a link to download? this is fixed: player addAction ["Enable earuplugs ",{ params ["_plyr","_caller","_id"]; private _actMenu = (_plyr actionParams _id) select 0; if (_actMenu isEqualTo "Disable earuplugs") then { _actMenu = "Enable earuplugs"; call disableEarplugs; } else { _actMenu = "Disable earuplugs"; call enableEarplugs; }; _plyr setUserActionText [_id,_actMenu]; },nil,0.8,false,true,"", ""]call BIS_fnc_MP; Share this post Link to post Share on other sites
HazJ 1288 Posted March 6, 2018 There is no need to use BIS_fnc_MP or remoteExec unless I have misunderstood. What do you mean on the same time? The action being added to JIP players? Just add it init.sqf / initPlayerLocal.sqf or in another script called from there. 2 Share this post Link to post Share on other sites
thedubl 43 Posted March 7, 2018 I do not understand why jip is needed. Here is my mp version... description.ext class CfgFunctions { //dub functions #include "dub\CfgFunctions.hpp" }; initPlayerLocal.sqf /***************************************************************** //Earbud Functions (dub functions) ****************************************************************/ call dub_fnc_earbuds; fn_earbuds.sqf /**dub 2016**/ buds = ["<t color='#33ccff'>Earbuds</t>", { _i = _this select 2; if (soundVolume == 1) then { hintSilent "Inserting earbuds..."; 2 fadeSound 0.1; player setUserActionText [_i,"<t color='#ffcc33'>Remove Earbuds</t>"]; } else { hintSilent "Removing earbuds..."; 2 fadeSound 1; player setUserActionText [_i,"<t color='#33ccff'>Insert Earbuds</t>"]; } }, [], -90, false, true, "", "_target == vehicle player" ]; player addAction buds; player addEventHandler [ "Respawn", { 2 fadeSound 1; player addAction buds; } ]; ~dub 2 Share this post Link to post Share on other sites
Stormmy1950 41 Posted March 7, 2018 ty for that @thedubl sorry i wasnt active i was away today so yea i will test that script and give it a feed back later Share this post Link to post Share on other sites
zonekiller 174 Posted March 8, 2018 you could try something as simple as add the below lines into initPlayerLocal.sqf _player addAction ["Remove Ear Muffs" , {1 fadeSound 1},0,1,false,false,"","(soundVolume < 1)"]; _player addAction ["Wear Ear Muffs" , {1 fadeSound 0.15},0,1,false,false,"","(soundVolume == 1)"]; 2 Share this post Link to post Share on other sites
thedubl 43 Posted March 8, 2018 28 minutes ago, zonekiller said: you could try something as simple as add the below lines into initPlayerLocal.sqf _player addAction ["Remove Ear Muffs" , {1 fadeSound 1},0,1,false,false,"","(soundVolume < 1)"]; _player addAction ["Wear Ear Muffs" , {1 fadeSound 0.15},0,1,false,false,"","(soundVolume == 1)"]; Still would need a respawn event handler. Otherwise, upon respawn the addaction will not exist. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted September 5, 2018 On 6/3/2018 at 10:12 PM, GEORGE FLOROS GR said: There is also this if you want to check: Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted September 6, 2018 On 3/8/2018 at 11:44 AM, zonekiller said: you could try something as simple as add the below lines into initPlayerLocal.sqf _player addAction ["Remove Ear Muffs" , {1 fadeSound 1},0,1,false,false,"","(soundVolume < 1)"]; _player addAction ["Wear Ear Muffs" , {1 fadeSound 0.15},0,1,false,false,"","(soundVolume == 1)"]; You can also put this into one addAction: GOM_earplugID = player addAction ["Earplugs Off",{ _plugState = missionNamespace getVariable ["GOM_fnc_plugState",false]; 1 fadeSound ([1,0.15] select _plugState); player setUserActionText [GOM_earplugID, ["Earplugs On","Earplugs Off"] select _plugState]; missionNamespace setVariable ["GOM_fnc_plugState",!_plugState]; },0,1,false,false,"","_target isEqualTo _this"]; Also I wouldn't use soundVolume for checks, since the returned value will not gradually change over time, it will immediately take the value set by fadeSound, no matter the time parameter. Cheers 1 Share this post Link to post Share on other sites