В данный момент выглядит так:
серверсайд
private ["_radPointsValue","_i","_radPosType","_radPosRadius","_pos","_r","_theta","_position","_posy","_posx","_trg","_markerName"];
// _radPointsValue - количество горячих зон на карте
// _radPosType тип горячей зоны - влияет на уровень РАД/с
// _radPosRadius - радиус горячей зоны
_radPointsValue = floor random 10 + 1;
diag_log format ["_radPointsValue = %1",_radPointsValue];
for "_i" from 1 to _radPointsValue do
{
_radPosType = floor random 3 + 1;
_radPosRadius = floor random 50 + 1;
_r = random 1500;
_theta = random 360;
_position = getMarkerPos "3km center";
_posx = _position select 0;
_posy = _position select 1;
_pos = [_posx+_r*Cos(_theta),_posy+_r*Sin(_theta),0];
diag_log format ["_radPosType = %1, _radPosRadius=%2, _pos=%3",_radPosType,_radPosRadius,_pos];
[_radPosType,_radPosRadius,_pos,_i] remoteExec ["ATH_createRadiationSpot",0,true];
};
Клиентсайд
/**
* ATH_Client_fnc_createRadiationSpot.sqf
* Athena Mod
* Создаёт "горячую зону" по параметрам переданным с сервера
*/
private ["_radPosType","_radPosRadius","_pos","_i","_markerName","_mrk"];
_radPosType = _this select 0;
_radPosRadius = _this select 1;
_pos = _this select 2;
_i = _this select 3;
diag_log format ["_radPosType = %1, _radPosRadius=%2, _pos=%3, _i=%4",_radPosType,_radPosRadius,_pos,_i];
// приходит вот это: [_radPosType,_radPosRadius,_pos,_i] remoteExec ["ATH_createRadiationSpot",0,true];
switch (_radPosType) do
{
case 1:
{
trg = createTrigger ["EmptyDetector", _pos,false];
trg setTriggerArea [_radPosRadius, _radPosRadius, 0, false];
trg setTriggerActivation ["ANY", "PRESENT", true];
trg setTriggerStatements ["player in thisList", "ATH_current_rad_level = 1;", "ATH_current_rad_level = 0;"];
_markerName = format["%1_marker",_i];
_mrk = createMarkerLocal [_markerName, _pos];
_mrk setMarkerColorLocal "ColorRed";
_mrk setMarkerTypeLocal "Mil_dot";
_mrk setMarkerTextLocal "Rad zone";
};
case 2:
{
trg = createTrigger ["EmptyDetector", _pos,false];
trg setTriggerArea [_radPosRadius, _radPosRadius, 0, false];
trg setTriggerActivation ["ANY", "PRESENT", true];
trg setTriggerStatements ["player in thisList", "ATH_current_rad_level = 2;", "ATH_current_rad_level = 0;"];
_markerName = format["%1_marker",_i];
_mrk = createMarkerLocal [_markerName, _pos];
_mrk setMarkerColorLocal "ColorRed";
_mrk setMarkerTypeLocal "Mil_dot";
_mrk setMarkerTextLocal "Rad zone";
};
case 3:
{
trg = createTrigger ["EmptyDetector", _pos,false];
trg setTriggerArea [_radPosRadius, _radPosRadius, 0, false];
trg setTriggerActivation ["ANY", "PRESENT", true];
trg setTriggerStatements ["player in thisList", "ATH_current_rad_level = 3;", "ATH_current_rad_level = 0;"];
_markerName = format["%1_marker",_i];
_mrk = createMarkerLocal [_markerName, _pos];
_mrk setMarkerColorLocal "ColorRed";
_mrk setMarkerTypeLocal "Mil_dot";
_mrk setMarkerTextLocal "Rad zone";
};
};
Согласен. Но Ave_Ursus задаёт условие активации с помощью setTriggerActivation, а потом "затирает" его с помощью setTriggerStatements. Зачем тогда использовать setTriggerActivation?
Чёрт... точно.. Это мой первый раз с триггерами =)
Накосячил.