PSYKO_nz 42 Posted October 31, 2018 hi there, I'm wanting to restrict m,y addaction to being only available during daylight, currently the player has to be within 6 meters for it to show up but I would like that to be restricted to the hours of 0600 - 1900 as well in other words. the player can only activate it if it is daylight and they are close enough to the item Share this post Link to post Share on other sites
pierremgi 4739 Posted October 31, 2018 add this simple condition (8th inner param of addAction): sunOrMoon > 0.5 true for daylight. Transition (0 to 1) during dusk and dawn is quick. That's enough for a true/false condition. Share this post Link to post Share on other sites
PSYKO_nz 42 Posted October 31, 2018 worked like a charm! is there any way to fine tune it? it's a little too dark when it starts/stops working at the moment Share this post Link to post Share on other sites
pierremgi 4739 Posted October 31, 2018 you can play with this boolean instead: (dayTime > (date call BIS_fnc_sunriseSunsetTime) select 0) && (dayTime < (date call BIS_fnc_sunriseSunsetTime) select 1) true for dayLight between the sunrise and sunset of the day. you can add some figures if needed, to modify the values. Share this post Link to post Share on other sites
PSYKO_nz 42 Posted October 31, 2018 ok, so my add action looks like this... this addAction["<t color='#ff9900'>Skydive Altis</t>", "ATM_airdrop\atm_airdrop.sqf",[],1,false,true,"","_this distance _target < 2, sunOrMoon > 0.5"]; where would the edited boolean code go? Share this post Link to post Share on other sites
pierremgi 4739 Posted October 31, 2018 "_this distance _target < 2 && sunOrMoon > 0.5" or "_this distance _target < 2 && (dayTime > (date call BIS_fnc_sunriseSunsetTime) select 0) && (dayTime < (date call BIS_fnc_sunriseSunsetTime) select 1)" Share this post Link to post Share on other sites
PSYKO_nz 42 Posted October 31, 2018 working great so far! please forgive me but what numbers should I change or add, I'm getting so close to this being spot on, how would I delay turning the addiction off by 30 mins for sunset and make it work 30 mins earlier for sunrise (in-game time not real world)??? if it's not possible that's ok, 5 am to 7 pm is a good set of business hours for a local company haha Share this post Link to post Share on other sites
pierremgi 4739 Posted November 1, 2018 Simple: "_this distance _target < 2 && (dayTime > ((date call BIS_fnc_sunriseSunsetTime) select 0) - 0.5) && (dayTime < ((date call BIS_fnc_sunriseSunsetTime) select 1) + 0.5)" Share this post Link to post Share on other sites
PSYKO_nz 42 Posted November 1, 2018 Oooooo I was so close!! when I was trying it before i asked in the last post I was doing -0.5 instead of - 0.5!! thank you so much for your help :) Share this post Link to post Share on other sites
pierremgi 4739 Posted November 1, 2018 That was not the problem. Check brackets. Share this post Link to post Share on other sites