if (side player == west) exitwith {};
if !(side player == civilian) exitwith {};
waituntil {time > 1};
/// функция вызываемая при нажатии клавиш
keyspressed = {
private["_key","_exit"];
_key = _this select 1;
/// переменная может понадобиться для работы функции
//_exit = false;
/// T
if (_key == 20) then {
/// создать копию
if (time - lasttime < 30) exitWith {titleText ["Not power! Wait!","plain"]}; /// задержка на нажатие
lasttime = time;
if (isServer) then {
_side = createCenter civilian;
_groupThing = createGroup civilian;
_manThing = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing setpos getPos player;
_manThing setdir getdir player;
_manThing disableAI "move";
_manThing setunitpos "up";
};
};
/// Space
if (_key == 57) then {
/// прыжки (Space)
if (time - lasttime < 5) exitWith {}; /// задержка на нажатие
lasttime = time;
player setvelocity [sin(getdir player)*5,cos(getdir player)*5, 10];
};
/// C
if (_key == 46) then {
/// телепорт (C)
if (time - lasttime < 10) exitWith {}; /// задержка на нажатие
lasttime = time;
crPlow attachto [player,[0,15,0]];
detach crPlow;
player setpos getpos crPlow;
};
/// R
if (_key == 19) then {
/// спавн клонов (R)
if (time - lasttime < 30) exitWith {}; /// задержка на нажатие
lasttime = time;
crPlow attachto [player,[0,15,0]];
detach crPlow;
if (isServer) then {
_ManThingSpawn = {
if (isServer) then {
_side = createCenter civilian;
_groupThing = createGroup civilian;
_manThing = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing setpos getPos crPlow;
_manThing setdir 0;
_manThing setunitpos "up";
_manThing disableAI "anim";
_manThing switchmove "AmovPercMrunSnonWnonDf";
_manThing1 = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing1 setpos getPos crPlow;
_manThing1 setdir 45;
_manThing1 setunitpos "up";
_manThing1 disableAI "anim";
_manThing1 switchmove "AmovPercMrunSnonWnonDf";
_manThing2 = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing2 setpos getPos crPlow;
_manThing2 setdir 90;
_manThing2 setunitpos "up";
_manThing2 disableAI "anim";
_manThing2 switchmove "AmovPercMrunSnonWnonDf";
_manThing3 = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing3 setpos getPos crPlow;
_manThing setdir 130;
_manThing3 setunitpos "up";
_manThing3 disableAI "anim";
_manThing3 switchmove "AmovPercMrunSnonWnonDf";
_manThing4 = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing4 setpos getPos crPlow;
_manThing4 setdir 180;
_manThing4 setunitpos "up";
_manThing4 disableAI "anim";
_manThing4 switchmove "AmovPercMrunSnonWnonDf";
_manThing5 = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing5 setpos getPos crPlow;
_manThing5 setdir 225;
_manThing5 setunitpos "up";
_manThing5 disableAI "anim";
_manThing5 switchmove "AmovPercMrunSnonWnonDf";
_manThing6 = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing6 setpos getPos crPlow;
_manThing6 setdir 270;
_manThing6 setunitpos "up";
_manThing6 disableAI "anim";
_manThing6 switchmove "AmovPercMrunSnonWnonDf";
_manThing7 = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"];
_manThing7 setpos getPos crPlow;
_manThing7 setdir 325;
_manThing7 setunitpos "up";
_manThing7 disableAI "anim";
_manThing7 switchmove "AmovPercMrunSnonWnonDf";
sleep 1;
_mol="ModuleLightning_F" createUnit [getpos crPlow, group igcam];
sleep 8;
_manThing setdir 0;
_manThing1 setdir 225;
_manThing2 setdir 270;
_manThing3 setdir 325;
_manThing4 setdir 0;
_manThing5 setdir 45;
_manThing6 setdir 90;
_manThing7 setdir 135;
sleep 10;
_mol1="ModuleLightning_F" createUnit [getpos crPlow, group igcam];
deletevehicle _manThing;
deletevehicle _manThing1;
deletevehicle _manThing2;
deletevehicle _manThing3;
deletevehicle _manThing4;
deletevehicle _manThing5;
deletevehicle _manThing6;
deletevehicle _manThing7;
};
};
[] spawn _ManThingSpawn;
};
};
/// H
if (_key == 33) then {
/// быстрая атака (F)
if (time - lasttime < 1) exitWith {}; /// задержка на нажатие
lasttime = time;
player switchmove 'AwopPercMstpSgthWnonDnon_end';
if (isServer) then {
_pul9= createVehicle ['B_45ACP_Ball', getPos player, [], 0, 'none'];
_pul9 setpos [getpos _pul9 select 0, getpos _pul9 select 1, (getpos _pul9 select 2) + 1.9];
_pul9 setvelocity [sin(getdir player)*500,cos(getdir player)*500, -250];
};
};
/// G
if (_key == 34) then {
/// дым (G)
if (time - lasttime < 60) exitWith {}; /// задержка на нажатие
lasttime = time;
if (isServer) then {
_pul9S= createVehicle ["Smoke_120mm_AMOS_White", getPos player, [], 0, 'none'];
_pul9S attachto [player,[0,15,0]];
_pul9S setvelocity [0,0,-1];
detach _pul9S;
/// квадрат
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) +5 , (getpos _pul9 select 1) +5, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9S, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) -5 , (getpos _pul9 select 1) -5, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) -5 , (getpos _pul9 select 1) +5, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) +5 , (getpos _pul9 select 1) -5, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9S select 0) +5 , (getpos _pul9S select 1) + 0, (getpos _pul9S select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9S select 0) -5 , (getpos _pul9S select 1) + 0, (getpos _pul9S select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9S select 0) +0 , (getpos _pul9S select 1) + 5, (getpos _pul9S select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9S select 0) +0 , (getpos _pul9S select 1) - 5, (getpos _pul9S select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
/// большой квадрат
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) +15 , (getpos _pul9 select 1) +15, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) -15 , (getpos _pul9 select 1) -15, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) -15 , (getpos _pul9 select 1) +15, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
_pul9= createVehicle ['Smoke_120mm_AMOS_White', getPos _pul9S, [], 0, 'none'];
_pul9 setpos [(getpos _pul9 select 0) +15 , (getpos _pul9 select 1) -15, (getpos _pul9 select 2) + 0];
_pul9 setvelocity [0,0,-1];
_molYDAR="ModuleLightning_F" createUnit [getpos _pul9, group igcam];
};
};
};
/// создаём дисплей нажатия клавиатуры с ярлыком - EH_keyDown
EH_keyDown = (findDisplay 46) displayAddEventHandler ["keyDown", "_this call keyspressed"];