GRIFF - ARMA3
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le deal à ne pas rater :
Réassort du coffret Pokémon 151 Électhor-ex : où l’acheter ?
Voir le deal

OTAGE2.SQF

Aller en bas

OTAGE2.SQF Empty Re: OTAGE2.SQF

Message par Nach Mar 24 Avr - 19:40

Otage2.sqf modifié désormais le script contient une task indépendante au reste de la mission .
Rajout d un patrouilleur dans la maison de l otage.
Ajout du fichier housep.sqf;

null = [objet,2,300] execVM "otage2.sqf"; >>> [nom de l objet editeur, le nombre d otage , Radius de spawn autour de l objet].

Bonne Edition a Tous Nach

Nach

Messages : 513
Date d'inscription : 31/01/2016

Revenir en haut Aller en bas

OTAGE2.SQF Empty Re: OTAGE2.SQF

Message par Nach Mar 24 Avr - 19:40

f (!isServer) exitWith {};

// null = [objet,2,300] execVM "otage2.sqf"; >>> [nom de l objet editeur, le nombre d otage , Radius de spawn autour de l objet]

_listecivils = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_hunter_1_F","C_man_p_beggar_F","C_man_p_fugitive_F",
"C_man_p_shorts_1_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F",
"C_man_polo_6_F","C_man_shorts_1_F","C_man_shorts_2_F","C_man_shorts_3_F","C_man_shorts_4_F","C_man_w_worker_F"];

_lop = ["O_T_Support_GMG_F","O_T_Support_MG_F","O_T_Support_MG_F","O_T_Support_AMG_F","O_T_Support_AMort_F","O_T_Soldier_TL_F","O_T_Soldier_SL_F","O_T_Soldier_Exp_F","O_T_Soldier_F","O_T_Soldier_LAT_F","O_T_Soldier_AR_F","O_T_Soldier_AR_F","O_T_Soldier_AAR_F","O_T_Soldier_GL_F","O_T_Crew_F","O_T_Medic_F","O_T_Officer_F","O_T_Soldier_A_F","O_T_Soldier_Repair_F","O_T_Engineer_F","O_T_Soldier_AA_F","O_T_Soldier_AT_F","O_T_Soldier_AAA_F","O_T_Soldier_AAT_F","O_T_Recon_F","O_T_Recon_LAT_F","O_T_Recon_Exp_F","O_T_Spotter_F"];



private["_houseObjects","_position","_buildings","_newpos","_unit","_bposs","_i","_i2","_x","_habiter","_side"];



_position = _this select 0;
_side = CIVILIAN;
_Nombredemaison = (_this select 1);
_iamaison = 1;
_radiusmaison = (_this select 2);
_wtime = 30;

_x = 0;
_y = 0;
_t = 0;
_timeout = 0;


for [{_n=0}, {_n<_Nombredemaison}, {_n=_n+1}] do {

_habiter = [];

for "_i" from 1 to _iamaison do {
_nombre3 = round(random (count (_listecivils)));
_unit2 = _listecivils select _nombre3;
_habiter set [count _habiter ,_unit2];
};



_houseObjects = nearestObjects [_position, ["building"],_radiusmaison];

if(isNil("_houseObjects"))exitWith{nil};
if((count _houseObjects)==0)exitWith{nil};

_buildings = [];
{
if(str(_x buildingPos 0) != "[0,0,0]")then{_buildings set[(count _buildings),_x];};
}forEach _houseObjects;

if((count _buildings)==0)exitWith{nil};

_bPoss = [];
_a = 0;
while { _a < (count _buildings) } do {
_building = (_buildings select _a);
_i = 0;
while { ((_building buildingPos _i) select 0) != 0 } do {
_bPoss set [count (_bPoss), (_building buildingPos _i)];
_i = _i + 1;
};
_a = _a + 1;
};


_newPos = _bposs select floor(random count _bposs);

_spawnGroup2 = [_newpos, _side ,_habiter,[],[],[],[],[],180] call BIS_fnc_spawnGroup;


};




// Recherche de chaque civils addaction + unité ennemi le gardant

_otage = nearestObjects [_position ,_listecivils,_radiusmaison];
{
// addaction Civil
_x addAction ["liberer Civil","otagegriff\liberation.sqf",[],1,false,true,"","(_target distance _this) < 3"] call bis_fnc_mp;
_x disableAI "move";
_x setCaptive true;
_x addEventHandler ["killed", {deleteVehicle (_this select 0)}];

// creation d un opfor aleatoire par variable civil

_grb2 = createGroup east;
_grb3 = createGroup east;
_nombre2 = round(random ((count _lop)-1));
_nombre3 = round(random ((count _lop)-1));
_s11 = _lop select _nombre2;
_s12 = _lop select _nombre3;


_posx = (getPosatl _x select 0)+2;
_posy = (getPosatl _x select 1)-2;
_posz = (getPosatl _x select 2)+1;
_pos = [_posx,_posy,_posz];
_s11 createUnit [_pos, _grb2];

_posx = (getPosatl _x select 0)+2;
_posy = (getPosatl _x select 1)-2;
_posz = (getPosatl _x select 2)+1;
_pos1 = [_posx,_posy,_posz];
_s12 createUnit [_pos1, _grb3];

{null = [_x] execVM "otagegriff\housep.sqf";} foreach (units _grb3);

//[_grb2, getpos _x, 1] call BIS_fnc_taskDefend;



} forEach _otage;

hint format ["%1 civil(s) sur cette mission",_Nombredemaison ];


// installation du trigger et de la task civil absent

pos9Miss = position (_this select 0);
textoMiss = "Libérer les habitants";
misot1 = "obj9";
valide = false;
publicVariable "pos9Miss";
publicVariable "textoMiss";
publicVariable "misot1";
publicVariable "valide";



// creation est spawn de la task
[west,misot1,["",textoMiss, pos9Miss],"",true]call bis_fnc_taskCreate;

// validation par civil absent
trg9 = createTrigger["EmptyDetector",pos9miss];
trg9 setTriggerArea[1000,1000,0,false];
trg9 setTriggerActivation["CIV","NOT PRESENT",false];
trg9 setTriggerStatements["this", "null = [misot1,""SUCCEEDED"",true] call bis_fnc_taskSetState; publicVariable 'misot1'; publicVariable 'textomiss';valide = true; publicvariable 'valide';", ""];
publicVariable "trg9";


waitUntil {triggerActivated trg9};
sleep 5;

["obj9"] call BIS_fnc_deleteTask;
deleteVehicle trg9;

Nach

Messages : 513
Date d'inscription : 31/01/2016

Revenir en haut Aller en bas

OTAGE2.SQF Empty OTAGE2.SQF

Message par Nach Mar 24 Avr - 19:39

*


Dernière édition par ('l|) Nach le Mar 24 Avr - 19:41, édité 1 fois

Nach

Messages : 513
Date d'inscription : 31/01/2016

Revenir en haut Aller en bas

OTAGE2.SQF Empty Re: OTAGE2.SQF

Message par Contenu sponsorisé


Contenu sponsorisé


Revenir en haut Aller en bas

Revenir en haut


 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum