GRIFF - ARMA3
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment : -45%
WHIRLPOOL OWFC3C26X – Lave-vaisselle pose libre ...
Voir le deal
339 €

TASK ALETOIRE SUR 7 Target Alive V0.0.1

Aller en bas

TASK ALETOIRE SUR 7 Target  Alive V0.0.1 Empty TASK ALETOIRE SUR 7 Target Alive V0.0.1

Message par Nach Dim 24 Fév - 19:07

L exemple par de 7 cibles nommée dans l éditeur de target1 à target7 .
Le declencheur c est la mort ou la destruction de ces cibles qui valide la task choisi aleatoirement.
Voici la mise en script.

le script cerveau>>  

Voici le taskloto.sqf a executer a partir de l init.sqf>>

if (isserver) then {
_selection = selectRandom [target1 ,target2,target3,target4,target5,target6,target7];
sleep 8;
if (_selection == target1)  then {null =[target1] execvm "task1.sqf";exit};
if (_selection == target2)  then {null =[target2] execvm "task2.sqf";exit};
if (_selection == target3)  then {null =[target3] execvm "task3.sqf";exit};
if (_selection == target4)  then {null =[target4] execvm "task4.sqf";exit};
if (_selection == target5)  then {null =[target5] execvm "task5.sqf";exit};
if (_selection == target6)  then {null =[target6] execvm "task6.sqf";exit};
if (_selection == target7)  then {null =[target7] execvm "task7.sqf";exit};
};

Le script de la cible (biensur je ne vais pas poster 7 fois la meme chose pour un chiffre qui va de 1 en 1
task1.sqf>>


if (alive target1) exitWith {

posMiss = getpos target1;
textMiss = "Detruire target1"; //a cet endroit le titre de la task qui spawn
misc1 = "obj1";
publicVariable "posMiss";
publicVariable "textMiss";
publicVariable "misc1";

[west,misc1,["",textMiss, ""],"",true]call bis_fnc_taskCreate;
[misc1,posmiss] call bis_fnc_taskSetDestination;

waitUntil {!alive target1};
[misc1,"SUCCEEDED",true] call bis_fnc_taskSetState;
sleep 2;
[textmiss ,west ] call BIS_fnc_deleteTask;


sleep 8;
execVM "taskloto.sqf";

   } ;

if (!alive target1) exitWith { sleep 2; execVM "taskloto.sqf"};
 
-------------------------------------------------------------------------------------------------------------------------------------------------------
suivre de task2.sqf etc il a juste a changer tous les 1 par des 2 tout simplement ex (target1 en target 2) (msc1="obj1" en msc2="obj2")
etc.. pour tous en suite numérologique.
En vous Souhaitant une bonne Edition
Bien a vous Nach...

Nach

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

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

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