Persian MO 81 Posted October 19, 2016 Hi. I have a simple script so when ai get shoot , there is a chance they move to Unconscious state and it working on my pc and also on server, but the Unconscious animation working just on my pc(single player). In dedicated server Ai unit move to Unconscious state but no animation. Here is script: init.sqf fnc_injured = { _unit = _this select 0; _unit removeAllMPEventHandlers "MPHit"; _unit setUnconscious true; while {(true)} do { sleep (30 + random 60); _ls = lifeState _unit; if (_ls != "INCAPACITATED") exitWith {}; _sound = [ "pain1", "pain2", "pain3", "pain4", "pain5", "pain6", "pain7", "pain8", "pain9", "pain10", "pain11", "pain12", "pain13" ] call BIS_fnc_selectRandom; _unit say3D [_sound, 100, 1]; sleep (60 + random 60); }; }; initserver.sqf _null = [] execvm "injured.sqf"; injured.sqf sleep 1; { if (side _x == east) then { if (_x isKindOf "Man") then { _x removeAllMPEventHandlers "MPHit"; call compile format[" %1 addMPEventHandler ['MPHit',{ if (vehicle %1 == %1) then { _rand = random 100; if (_rand < 35) then { [%1] spawn fnc_injured; }; }; }] ",[_x] call BIS_fnc_objectVar]; }; }; } forEach allUnits; any solution for animation? on singlePlayer on server Share this post Link to post Share on other sites
Persian MO 81 Posted October 20, 2016 here is a video about im trying to accomplish https://youtu.be/oCM8L8uSAaQ Share this post Link to post Share on other sites
Guest Posted October 21, 2016 You can broadcast the animation yourself with remoteExec and switchMove. Share this post Link to post Share on other sites
Persian MO 81 Posted October 23, 2016 (edited) Ok, found a solution. Share a demo mission here if somebody need it http://www.mediafire.com/file/8yz3oj35mr9nzx5/test_uncouncios3.VR.rar init.sqf fnc_injured = { _unit = _this select 0; _unit removeAllMPEventHandlers "MPHit"; [ _unit ] remoteExec [ "TAG_fnc_setunconscious", 2 ]; sleep 3; _anim = [ "UnconsciousReviveArms_A","UnconsciousReviveArms_B","UnconsciousReviveArms_C","UnconsciousReviveBody_A", "UnconsciousReviveBody_B","UnconsciousReviveDefault_A","UnconsciousReviveDefault_B","UnconsciousReviveHead_A", "UnconsciousReviveHead_B","UnconsciousReviveHead_C","UnconsciousReviveLegs_A","UnconsciousReviveLegs_B" ] call bis_fnc_selectRandom; [[[_unit,_anim],"animation.sqf"],"BIS_fnc_execVM",true,false] call BIS_fnc_MP; while {(true)} do { sleep (30 + random 60); _ls = lifeState _unit; if (_ls != "INCAPACITATED") exitWith {}; _sound = [ "pain1", "pain2", "pain3", "pain4", "pain5", "pain6", "pain7", "pain8", "pain9", "pain10", "pain11", "pain12", "pain13" ] call BIS_fnc_selectRandom; _unit say3D [_sound, 100, 1]; sleep (60 + random 60); }; }; initserver.sqf TAG_fnc_setunconscious = { params[ "_unit" ]; [ _unit, true ] remoteExec [ "setUnconscious", _unit ]; }; _null = [] execvm "injured.sqf"; injured,sqf sleep 3; { if (side _x == east) then { if (_x isKindOf "Man") then { _x removeAllMPEventHandlers "MPHit"; call compile format[" %1 addMPEventHandler ['MPHit',{ if (vehicle %1 == %1) then { _rand = random 100; if (_rand < 35) then { [%1] spawn fnc_injured; }; }; }] ",[_x] call BIS_fnc_objectVar]; }; }; } forEach allUnits; animation.sqf _unit = _this select 0; _anim = _this select 1; _unit disableAI "TARGET"; _unit disableAI "AUTOTARGET"; _unit disableAI "MOVE"; _unit disableAI "TEAMSWITCH"; _unit disableAI "FSM"; _unit disableAI "AIMINGERROR"; _unit disableAI "SUPPRESSION"; _unit disableAI "COVER"; _unit disableAI "AUTOCOMBAT"; _unit disableAI "PATH"; while {true} do { _ls = lifeState _unit; if (_ls != "INCAPACITATED") exitWith {}; _unit playMove _anim; sleep 5; }; Edited October 23, 2016 by Persian MO Share this post Link to post Share on other sites