farside 6 Posted December 24, 2012 I am making a life raft script, i was wondering how i would go about making the action "inflate life raft" only available after ejection, would be even better if it would be only available when swimming, save people from inflating it on land. any ideas? Share this post Link to post Share on other sites
panther42 40 Posted December 24, 2012 Here's a post with swimming animation check by BIS: swimming I believe there are other posts, search may help you out. Share this post Link to post Share on other sites
farside 6 Posted December 24, 2012 many thanks, gave it a good search before i started, the swimming state was an after thought tbh. cheers! ---------- Post added at 16:04 ---------- Previous post was at 15:00 ---------- ok so now i have this as PPE.sqf private ["_isSwimmingFunction"];_isSwimmingFunction = { private ["_pos", "_isSwimming"]; _pos = position _veh; _isSwimming = false; if ((surfaceIsWater _pos) && ((_pos select 2) < 0.5) && (!_isChar || ((animationState player) in ["aswmpercmwlksnonwnondf", "aswmpercmsprsnonwnondf", "aswmpercmrunsnonwnondf", "aswmpercmstpsnonwnondnon", "aswmpercmrunsnonwnondf_aswmpercmstpsnonwnondnon", "aswmpercmstpsnonwnondnon_aswmpercmrunsnonwnondf", "aswmpercmstpdnon", "aswmpercmstpdnon_aswmpercmstpdf", "aswmpercmstpdf_aswmpercmstpdnon", "aswmpercmstpsnonwnondf"]))) then { _isSwimming = true; }; _isSwimming }; _raft = if (_isSwimming = true) then [{player addAction ["Inflate Liferaft", "liferaft.sqf"]},{}]; but it doesnt create and action, ideas? Share this post Link to post Share on other sites
panther42 40 Posted December 24, 2012 That was just an example, for you to see how to use the animations for swimming check. You cannot use "as is" - there are local variables in it which you do not use. Try something like this: _pos = getpos player; _SwimAnims = ["aswmpercmwlksnonwnondf", "aswmpercmsprsnonwnondf", "aswmpercmrunsnonwnondf", "aswmpercmstpsnonwnondnon", "aswmpercmrunsnonwnondf_aswmpercmstpsnonwnondnon", "aswmpercmstpsnonwnondnon_aswmpercmrunsnonwnondf", "aswmpercmstpdnon", "aswmpercmstpdnon_aswmpercmstpdf", "aswmpercmstpdf_aswmpercmstpdnon", "aswmpercmstpsnonwnondf"]; if ((surfaceIsWater _pos) && (animationState player) in _SwimAnims) then { player addAction ["Inflate Liferaft", "liferaft.sqf"]; }; Share this post Link to post Share on other sites
farside 6 Posted December 27, 2012 many thanks, working fine now, just gotta run the script on a continual loop and its sorted, thanks! Share this post Link to post Share on other sites