1
Armed Assault 2 / Jihad Sheep
« on: August 03, 2012, 10:20:44 am »
Jihad Sheep
Beware of roaming sheep they could be deadly
sheepmove.sqf
baa.sqf
sheepsatchel.sqf
Beware of roaming sheep they could be deadly
sheepmove.sqf
Code: [Select]
_sheep = _this select 0;
_owner = _this select 1;
_bomb = _this select 2;
while {alive _sheep} do {
_enemy = _owner findNearestEnemy _sheep;
if (_enemy distance _sheep < 40) then {
_sheep doMove getPos _enemy;
_sheep doFollow _enemy;
sleep 1;
};
if ((!alive _bomb) || (_enemy distance _sheep < 3)) then {
_sheep setDamage 1;
};
};
_owner action ["TOUCHOFF", _owner];
sleep 5;
deleteVehicle _sheep;
baa.sqf
Code: [Select]
_unit = _this select 0;
_weapon = _this select 1;
_muzzle = _this select 2;
_mode = _this select 3;
_ammo = _this select 4;
_shot = player;
_pos = [];
_vecup = [];
_vecdir = [];
_speed = [];
_new = player;
if (_ammo == "PipeBomb") then {
sheepbomb = creategroup side _unit;
_shot = nearestObject [_unit, _ammo];
sleep 0.005;
"sheep" createUnit [getPos _shot,sheepbomb,'mysheep=this',1,'COLONEL'];
sleep 0.005;
_sheep = mysheep;
_sheep setPos (_unit modelToWorld [0,1,0]);
_sheep setCaptive true;
_sheep setDir getDir _unit;
_shot attachTo [_sheep,[0,0.45,0.82]];
_shot setVectorDirAndUp[[1,0,0],[0,1,0.2]];
_sheep doMove (_sheep modelToWorld [0,100+random 100,0]);
nul=[_sheep,_unit,_shot] execVM "wuat\scripts\sheepmove.sqf";
};
sheepsatchel.sqf
Code: [Select]
nul = player addEventHandler ["fired", {nul=_this execVM "scripts\baa.sqf"}];