Файл со скриптом есть на клиенте.
Порядок мне не важен... она там вообще никак не запускается))
Вот всё полностью, а то может я как-то не так объясняю, я хз:
Вот этот файл запускается при старте:
["PiR_injuriplayer_on", "CHECKBOX", ["Влючить ранения для игрока", "Enable injuries for player"], "Project injury Reaction", true] call cba_settings_fnc_init;
EyeEffect0 = compile preprocessfilelinenumbers "\PiR\Functions\EyeEffect0.sqf";
publicVariable "EyeEffect0";
if (isServer) then {
Uncondition = compile preprocessfilelinenumbers "\PiR\Functions\Uncondition.sqf";
Crawl = compile preprocessfilelinenumbers "\PiR\Functions\Crawl.sqf";
DropWeapon = compile preprocessfilelinenumbers "\PiR\Functions\DropWeapon.sqf";
Helmet = compile preprocessfilelinenumbers "\PiR\Functions\Helmet.sqf";
BendsDown = compile preprocessfilelinenumbers "\PiR\Functions\BendsDown.sqf";
UnconditionAnim = compile preprocessfilelinenumbers "\PiR\Functions\UnconditionAnim.sqf";
EyeEffect = compile preprocessfilelinenumbers "\PiR\Functions\EyeEffect.sqf";
PiR = compile preprocessfilelinenumbers "\PiR\Functions\PiR.sqf";
Uncondition0 = compile preprocessfilelinenumbers "\PiR\Functions\Uncondition0.sqf";
Crawl0 = compile preprocessfilelinenumbers "\PiR\Functions\Crawl0.sqf";
DropWeapon0 = compile preprocessfilelinenumbers "\PiR\Functions\DropWeapon0.sqf";
Helmet0 = compile preprocessfilelinenumbers "\PiR\Functions\Helmet0.sqf";
BendsDown0 = compile preprocessfilelinenumbers "\PiR\Functions\BendsDown0.sqf";
UnconditionAnim0 = compile preprocessfilelinenumbers "\PiR\Functions\UnconditionAnim0.sqf";
PiR0 = compile preprocessfilelinenumbers "\PiR\Functions\PiR0.sqf";
_null = [] execvm "\PiR\Functions\PiRstart.sqf";
};
Из него запускается файл PiRstart.sqf
В котором добавляется отслеживание попадания в юнита.
if (!isServer) exitWith {};
dam_fnc_setunconscious = {
params[ "_unit" ];
[ _unit, true ] remoteExec [ "setUnconscious", _unit ];
};
dam_fnc_wake = {
params[ "_unit" ];
[ _unit, false ] remoteExec [ "setUnconscious", _unit ];
};
//Добавляем юнитам отслеживание попадания
_units = [];
while { (true) } do {
{
if ((_x isKindOf "Man")) then
{
if (("INCAPACITATED" != lifeState _x) && (alive _x) && !(_x getVariable ["dam_ignore_hit0",false]) && (AnimationState _x != "ainjppnemrunsnonwnondb") && (AnimationState _x != "ainjppnemrunsnonwnondb_still") && (AnimationState _x != "UnconsciousFaceDown") && (AnimationState _x != "UnconsciousFaceUp") && (AnimationState _x != "UnconsciousReviveDefault_C") && (AnimationState _x != "UnconsciousOutProne")) then
{
_units pushBack _x;
_x removeAllMPEventHandlers "MPHit";
_x setVariable ["dam_ignore_hit0",true];
IF (!isplayer _x) then {
_x addMPEventHandler ["MPHit", {_this spawn PiR}];
} ELSE {
IF !(PiR_injuriplayer_on) exitwith {};
_x addMPEventHandler ["MPHit", {_this spawn PiR0}];
};
};
};
} forEach allUnits;
sleep 60;
};
Из него уже запускается PiR0.sqf. В котором уже распределяются ранения для игрока на типы и запускается нужный эффект.
if (!isServer) exitWith {};
// Назначение действий на попадание игрок
private ["_unit","_selection","_shans"];
_unit = (_this select 0);
IF !(_unit getVariable ["dam_ignore_injured0",false]) then {
//________________________________Распределение анимаций по частям тела______________________________________________________________________
_anim = selectRandom [
"UnconsciousReviveArms_A","UnconsciousReviveArms_B","UnconsciousReviveArms_C","UnconsciousReviveBody_A",
"UnconsciousReviveBody_B","UnconsciousReviveDefault_A","UnconsciousReviveDefault_B","UnconsciousReviveDefault_C","UnconsciousReviveHead_A",
"UnconsciousReviveHead_B","UnconsciousReviveHead_C","UnconsciousReviveLegs_A","UnconsciousReviveLegs_B"];
_shans = 0;
if (vehicle _unit != _unit) exitWith {
IF !(_unit getVariable ["dam_ignore_effect0",false]) then {
_unit setVariable ["dam_ignore_effect0",true];
_null = [_unit, _anim, _shans] spawn EyeEffect0;
};
};
IF (damage _unit > 0) then {
if ((_unit getHitPointDamage "HitFace" > 0) && (_unit getHitPointDamage "HitHead" > 0) && (_unit getHitPointDamage "HitNeck" > 0) && (_unit getHitPointDamage "HitPelvis" > 0) && (_unit getHitPointDamage "HitAbdomen" > 0) && (_unit getHitPointDamage "HitDiaphragm" > 0) && (_unit getHitPointDamage "HitChest" > 0) && (_unit getHitPointDamage "HitBody" > 0) && (_unit getHitPointDamage "HitHands" > 0) && (_unit getHitPointDamage "HitArms" > 0) && (_unit getHitPointDamage "HitLegs" > 0)) exitWith {
_anim = selectRandom [
"UnconsciousReviveArms_A","UnconsciousReviveArms_B","UnconsciousReviveArms_C","UnconsciousReviveBody_A",
"UnconsciousReviveBody_B","UnconsciousReviveDefault_A","UnconsciousReviveDefault_B","UnconsciousReviveDefault_C","UnconsciousReviveHead_A",
"UnconsciousReviveHead_B","UnconsciousReviveHead_C","UnconsciousReviveLegs_A","UnconsciousReviveLegs_B"];
_shans = 8;
};
if ((_unit getHitPointDamage "HitFace" > 0.25) or (_unit getHitPointDamage "HitHead" > 0.25) or (_unit getHitPointDamage "HitNeck" > 0.25)) exitWith {
_anim = selectRandom [
"UnconsciousReviveHead_A","UnconsciousReviveHead_B","UnconsciousReviveHead_C"];
_shans = 10;
};
if ((_unit getHitPointDamage "HitPelvis" > 0.25) or (_unit getHitPointDamage "HitAbdomen" > 0.25)) exitWith {
_anim = selectRandom [
"UnconsciousReviveBody_A","UnconsciousReviveBody_B","UnconsciousReviveDefault_A"];
_shans = 7;
};
if ((_unit getHitPointDamage "HitDiaphragm" > 0.25) or (_unit getHitPointDamage "HitChest" > 0.25) or (_unit getHitPointDamage "HitBody" > 0.25)) exitWith {
_anim = selectRandom [
"UnconsciousReviveDefault_A","UnconsciousReviveDefault_B","UnconsciousReviveDefault_C"];
_shans = 9;
};
if (_unit getHitPointDamage "HitHands" > 0.25) exitWith {
_anim = selectRandom [
"UnconsciousReviveArms_A","UnconsciousReviveArms_B","UnconsciousReviveArms_C"];
_shans = 1;
};
if (_unit getHitPointDamage "HitArms" > 0.25) exitWith {
_anim = selectRandom [
"UnconsciousReviveArms_A","UnconsciousReviveArms_B","UnconsciousReviveArms_C"];
_shans = 3;
};
if (_unit getHitPointDamage "HitLegs" > 0.25) exitWith {
_anim = selectRandom [
"UnconsciousReviveLegs_A","UnconsciousReviveLegs_B"];
_shans = 5;
};
};
//_____________________________________________________________________________________________________________________
// Голова
IF ((_shans == 10) && !(_unit getVariable ["dam_ignore_injured0",false])) then {
_unit setVariable ["dam_ignore_injured0",true];
_unit removeAllMPEventHandlers "MPHit";
IF ((_shans - (random 25)) >=0) then {
_null = [_unit, _anim, _shans] spawn Helmet0;
} ELSE {
_null = [_unit, _anim, _shans] spawn Uncondition0;
};
};
// Живот и Грудь
IF (((_shans == 7) or (_shans == 9)) && ((_shans - (random 10)) >=0) && !(_unit getVariable ["dam_ignore_injured0",false])) then {
_unit setVariable ["dam_ignore_injured0",true];
_unit removeAllMPEventHandlers "MPHit";
IF ((_shans - (random 22)) >=0) then {
_null = [_unit, _anim, _shans] spawn BendsDown0;
} ELSE {
IF ((_shans - (random 14)) >=0) then {
_null = [_unit, _anim, _shans] spawn Crawl0;
} ELSE {
_null = [_unit, _anim, _shans] spawn Uncondition0;
};
};
};
// Верх руки и Низ руки
IF (((_shans == 1) or (_shans == 3)) && ((7 - (random 10)) >=0) && !(_unit getVariable ["dam_ignore_injured0",false])) then {
_unit setVariable ["dam_ignore_injured0",true];
_unit removeAllMPEventHandlers "MPHit";
IF (((_shans - (random 8)) <=0) && !(_unit getVariable ["dam_ignore_dragger0",false])) then {
_null = [_unit, _anim, _shans] spawn DropWeapon0;
} ELSE {
IF ((_shans - (random 10)) >=0) then {
_null = [_unit, _anim, _shans] spawn Uncondition0;
} ELSE {
_null = [_unit, _anim, _shans] spawn Crawl0;
};
};
};
// Бедро, голень и стопа
IF (((_shans == 6) or (_shans == 4) or (_shans == 2)) && ((_shans - (random 10)) >=0) && !(_unit getVariable ["dam_ignore_injured0",false])) then {
_unit setVariable ["dam_ignore_injured0",true];
_unit removeAllMPEventHandlers "MPHit";
IF ((_shans - (random 22)) >=0) then {
_null = [_unit, _anim, _shans] spawn Uncondition0;
} ELSE {
_null = [_unit, _anim, _shans] spawn Crawl0;
};
};
// Подрыв
IF ((_shans == 8) && ((_shans - (random 10)) >=0) && !(_unit getVariable ["dam_ignore_injured0",false])) then {
_unit setVariable ["dam_ignore_injured0",true];
_unit removeAllMPEventHandlers "MPHit";
IF ((_shans - (random 16)) >=0) then {
_null = [_unit, _anim, _shans] spawn Crawl0;
} ELSE {
IF ((_shans - (random 12)) >=0) then {
_null = [_unit, _anim, _shans] spawn Uncondition0;
} ELSE {
IF ((_shans - (random 12)) >=0) then {
_null = [_unit, _anim, _shans] spawn BendsDown0;
} ELSE {
_null = [_unit, _anim, _shans] spawn Helmet0;
};
};
};
};
//_____________________________________________________________________________________________________________________
//________________________________Крик при попадании_______________________________________________________________________
IF (_shans !=10 ) then {
[_unit, (selectRandom ["Hit1", "Hit2", "Hit3", "Hit4", "Hit5", "Hit6", "Hit7", "Hit8", "Hit9", "Hit10"]) ] remoteExec [ "say3D", 0];
};
//__________________________________________________________________________________________________________________________
//________________________________Эффекты крови_____________________________________________________________________________
IF !(_unit getVariable ["dam_ignore_effect0",false]) then {
_unit setVariable ["dam_ignore_effect0",true];
[_unit, _anim, _shans ] remoteExec [ "EyeEffect0", 0 ];
// [[_unit, _anim, _shans ], "\PiR\Functions\EyeEffect0.sqf"] remoteExec ["execVM", _unit];
};
//__________________________________________________________________________________________________________________________
//________________________________Стоны при ранении_________________________________________________________________________
while {true} do {
sleep (40 + random 20);
if (!(_unit getVariable ["dam_ignore_injured0",false]) or !(alive _unit)) exitWith {};
[_unit, (selectRandom ["pain1", "pain2", "pain3", "pain4", "pain5", "pain6", "pain7", "pain8", "pain9"]) ] remoteExec [ "say3D", 0];
};
//___________________________________________________________________________________________________________________________
sleep 1;
if !(alive _unit) then {
_unit removeAllMPEventHandlers "MPHit";
};
};
И вот до этого момента всё работает... но из раздела, где у меня там подписано "Эффект крови", на клиенте должен запускаться EyeEffect0.sqf. И вот он, не запускается.
Edited by 0-0, 17 February 2019 - 14:55.