Einzelnen Beitrag anzeigen
Alt 05.07.2010, 15:03   #6 (permalink)
Pfandgiraffe
500 Beiträge1000 Beiträge
 
Benutzerbild von Pfandgiraffe
 
Registriert seit: 16.09.2008
Ort: Berlin
Alter: 38
Beiträge: 1.737
Pfandgiraffe eine Nachricht über ICQ schicken Pfandgiraffe eine Nachricht über Skype™ schicken
Standard

um infs spawnen zu lassen die einen punkt verteidigen benutz ich immer das hier...


Code:
//by psycho
//troublemaker v1.2
if (!(Local Server)) exitWith {};
private ["_list","_pos","_spawn","_x","_y","_z","_i","_j","_guard","_unit","_spawn","_allunits","_max","_wp","_wp1","_2","_3","_4","_pos1","_pos2","_pos3","_pos4"];

_list = _this select 0;
_xachs = if (count _this > 1) then {_this select 1} else {90};
_yachs = if (count _this > 2) then {_this select 2} else {90};
_pos = position _list;
_spawn = [];
_x = 0;
_y = 0;
_i = 0;
_z = 0;
_j = 0;
_plnum = 0;
sleep 0.01;
_plnum = playersNumber west;

_pos1 = [(_pos select 0) +_xachs,(_pos select 1),(_pos select 2)];
_pos2 = [(_pos select 0),(_pos select 1) +_yachs,(_pos select 2)];
_pos3 = [(_pos select 0) -_xachs,(_pos select 1),(_pos select 2)];
_pos4 = [(_pos select 0),(_pos select 1) -_yachs,(_pos select 2)];


_y = ceil random 8;                    //maximal mögliche gruppen

if (_plnum <= 2) then {
if (_y <= 3) then {_y = 3;};};        //mindestens 3 gruppen...

if ((_plnum > 2) AND (_plnum <= 5)) then {
if (_y <= 4) then {_y = 4;};};

if (_plnum >= 6) then {
if (_y <= 6) then {_y = 6;};};
///////////////////create inf-squads
while {_j<_y} do
{
_allspawns = [_pos1,_pos2,_pos3,_pos4];
_x = round random 3;
_z = ceil random 12;
if (_z <= 6) then {_z = 6;};        //minimum 6 einheiten je gruppe
//hint format ["Gruppen = %1 Infs = %2", _y, _z];        //debug

_guard = grpNull;
_unit = objNull;
_max = objnull;
_allunits = ["MVD_Soldier_TL","MVD_Soldier_MG","MVD_Soldier","MVD_Soldier_GL","MVD_Soldier_AT","MVD_Soldier_Sniper","RU_Soldier_AA","RU_Soldier_AT","RU_Soldier_Medic","RU_Soldier_LAT"];
_max = count _allunits;
_guard = createGroup (east);

_spawn = _allspawns select _x;
while {_i<_z} do
{
    _unit = _guard createUnit [(_allunits select round random (_max - 1)), _spawn, [], 0, "NONE"];_unit setSkill 2+(random 3);[_unit] join _guard; _unit addEventHandler ["Killed",{_psy = _this execVM "skripts\CB_deldeads.sqf"}];
    Sleep 0.2;
    _i = _i + 1;
};

_wp = _guard addWaypoint [position _list, 20];
_wp1 = _guard addWaypoint [position _list, 90];
_wp2 = _guard addWaypoint [position _list, 90];
_wp3 = _guard addWaypoint [position _list, 90];
_wp4 = _guard addWaypoint [position _list, 90];
_wp4 setWaypointType "CYCLE";
_j = _j + 1;
sleep 1;
};


/////////////////create statics or aa
if (_y<=3) then
{
_allstats = ["D30_RU","KORD","AGS_RU","ZU23_Ins"];
_maxs = (count _allstats)-1;
_deffer = createGroup (east);

_allspawns = [_pos1,_pos2,_pos3,_pos4];
_x = round random 3;
_spawn = _allspawns select _x;
_dir = random 359;
_array = [_allstats select (round random _maxs),_pos,(east),50,_dir,0] call CreateVehicle;
_grp = _array select 0;
};

sleep 0.1;
deleteVehicle _list;

if (true) exitWith {};
somit ist die anzahl der infs von der anzahl der spieler abhängig und es hat hohes maß an random. auslösen tut es schlicht ein auslöser, bedingung blufor vorhanden, einmal und aktivierung:

psy = [nameTrigger] execVM "troublemaker.sqf"


bestimmt nicht perffekt aber evtl kannst du es ja deinen bedürfnissen anpassen... das mit den statischen waffen müsstest du allerdings wegkürzen, dafehlt sonst noch ein script.

p.s.: sind a2 classnames!
__________________
Niemand hat die Absicht eine Tüte zu bauen!
​​​​​​​
___<<<A3 Wounding System>>>___
Pfandgiraffe ist offline   Mit Zitat antworten