T-72Б › Понедельник
› 29.06.2015
› 16:43
› Сообщение #
1
Генерал-майор
В увольнительной
Группа:
Пользователи
Сообщений:
411
Не стал плодить новую тему I. Проблема с createVehicle. Опишу систему включения скрипта SPOSOBNOSTI.sqf для начала инит.sqf [] execvm "sposobnost\allspos.sqf"; Код
[] execvm "sposobnost\SPOSOBNOSTI.sqf"; [] execvm "sposobnost\zaxvat.sqf"; [] execvm "sposobnost\godmodeSTART.sqf"; [] execvm "sposobnost\zrenie.sqf"; [] execvm "sposobnost\Conc.sqf"; [] execvm "sposobnost\netoryzieTMSQ.sqf"; [] execvm "sposobnost\netformaTMSQ.sqf"; [] execvm "sposobnost\formaCAR.sqf";
Скрипт, который не работает. SPOSOBNOSTI.sqf
if (side player == west) exitwith {}; if !(side player == civilian) exitwith {}; I=60; waituntil {time > 1}; /// функция вызываемая при нажатии клавиш keyspressed = { private["_key","_exit"]; _key = _this select 1; /// переменная может понадобиться для работы функции //_exit = false; /// T if (_key == 20) then { /// создать копию if (time - lasttime < 60) exitWith {}; /// задержка на нажатие lasttime = time; I=time; if (isServer) then { _BoecThingSpawn = { if (isServer) then { _side = createCenter east; _groupThing = createGroup east; _MolThing = _groupThing createUnit ["ModuleLightning_F", [0, 0, 0], [], 0, "NONE"]; _MolThing setpos getPos player; sleep 1; _BoecThing = _groupThing createUnit ["B_Soldier_F", [0, 0, 0], [], 0, "NONE"]; _BoecThing setpos getPos player; _BoecThing setdir getdir player; _BoecThing setunitpos "up"; _BoecThing setcaptive true; dostop _BoecThing; sleep 60; _MolThing = _groupThing createUnit ["ModuleLightning_F", [0, 0, 0], [], 0, "NONE"]; _MolThing setpos getPos _BoecThing; deletevehicle _BoecThing; }; }; [] spawn _BoecThingSpawn; }; }; /// Space if (_key == 57) then { /// прыжки (Space) if (time - lasttime < 5) exitWith {}; /// задержка на нажатие lasttime = time; I=time; _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; _soundToPlay = _soundPath + "Sound\clone.ogg"; playSound3D [_soundToPlay, player]; player setvelocity [sin(getdir player)*5,cos(getdir player)*5, 10]; }; /// B if (_key == 48) then { /// телепорт по карте (B) if (time - lasttime < 60) exitWith {}; /// задержка на нажатие lasttime = time; I=time; onMapSingleClick " player setpos _pos; _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; _soundToPlay = _soundPath + 'Sound\teleport.ogg'; playSound3D [_soundToPlay, player]; onMapSingleClick '',true"; }; /// C if (_key == 46) then { /// телепорт © if (time - lasttime < 30) exitWith {}; /// задержка на нажатие lasttime = time; I=time; _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; _soundToPlay = _soundPath + "Sound\teleport.ogg"; playSound3D [_soundToPlay, player]; crPlow attachto [player,[0,15,0]]; detach crPlow; player setpos getpos crPlow; }; /// R if (_key == 19) then { /// спавн клонов ® if (time - lasttime < 30) exitWith {}; /// задержка на нажатие lasttime = time; I=time; crPlow attachto [TheThing,[0,15,0]]; detach crPlow; if (isServer) then { _ManThingSpawn = { if (isServer) then { _side = createCenter civilian; _groupThing = createGroup civilian; _manThings = []; _dirs = [0, 45, 90, 130, 180, 225, 270, 325]; _mol="ModuleLightning_F" createUnit [getpos crPlow, group igcam]; sleep 1; for "_i" from 0 to 7 do { _manThing = _groupThing createUnit ["C_scientist_F", [0, 0, 0], [], 0, "NONE"]; _manThing setpos getPos crPlow; _manThing setdir (_dirs select _i); _manThing setunitpos "up"; _manThing disableAI "anim"; _manThing switchmove "AmovPercMrunSnonWnonDf"; _manThings pushBack _manThing; }; sleep 8; _dirs = [0, 225, 270, 325, 0, 45, 90, 135]; { if !(isNull _x) then { _x setdir (_dirs select _forEachIndex); }; } foreach _manThings; sleep 10; _mol1="ModuleLightning_F" createUnit [getpos crPlow, group igcam]; { if !(isNull _x) then { deletevehicle _x; }; } foreach _manThings; }; }; [] spawn _ManThingSpawn; }; }; /// H if (_key == 33) then { /// быстрая атака (F) if (time - lasttime < 1.5) exitWith {}; /// задержка на нажатие lasttime = time; I=time; _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; _soundToPlay = _soundPath + "Sound\ydar.ogg"; playSound3D [_soundToPlay, player]; player switchmove 'AwopPercMstpSgthWnonDnon_end'; if (isServer) then { _pul9= createVehicle ['B_45ACP_Ball', getPos TheThing 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; I=time; _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; _soundToPlay = _soundPath + "Sound\fog.ogg"; playSound3D [_soundToPlay, player]; 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"];
Основная проблема. Всё, что связано с createVehicle в мультиплеере не работает. Не могу понять почему. Думаю из-за isserver, но тогда как не создать овер 9000 объектов. II. Проблема с ppEffect sposobnost\zrenie.sqf
ppbw = ppEffectCreate ["colorCorrections", 1500]; ppbw ppEffectEnable true; ppbw ppEffectAdjust [1,1.5,0.05,[0.3,0.3,1,-1],[1,0.1,0.1,0],[0.5,0.2,0.25,1]]; ppbw ppEffectCommit 0; if !(side player == civilian) exitwith {ppbw ppEffectEnable false;}; if (side player == civilian) exitwith { Player enableFatigue false; ppbw ppEffectEnable true; };
Проблема следующая. После смерти, у игрока НЕ пропадает пост.эффект. Хотя скрипты onPlayerkilled и onPlayerRespawn должны его выключать. Также не изменяется время респавна. onPlayerkilled и onPlayerRespawn if (side player == west) then { setPlayerRespawnTime 15; removeAllActions player; [] execvm "sposobnost\allspos.sqf"; }; if (side player == civilian) then { setPlayerRespawnTime 30; removeAllActions player; [] execvm "sposobnost\allspos.sqf"; };