function onTimer_change()
OFP:setTimer("change",5000);
local target=OFP:getGroupMember("p",math.random(0,OFP:getGroupSize("p")-1));
if OFP:getSide(target)==0 then
OFP:setArmy(target,1);
end
if OFP:getSide(target)==1 then
OFP:setArmy(target,0);
end
if OFP:getGroupSize("p")<=15 then
local x,y,z=OFP:getPosition(target);
add=OFP:spawnEntitySetAtLocation("E",x,y,z);
end
end
function onMissionStart()
OFP:setInvulnerable("huntercqb",true);
OFP:addTimer("change",5000);
end
function onSpawnedReady( setName, setID, tableOfEntities, errorCode )
if setID==add then
for i=1,#tableOfEntities do
if OFP:getBroadUnitCategory(tableOfEntities[i])=="BROAD_UNIT_SOLDIER" then
OFP:addToGroup(tableOfEntities[i],"p");
end
end
end
end
OFP:setTimer("change",5000);
local target=OFP:getGroupMember("p",math.random(0,OFP:getGroupSize("p")-1));
if OFP:getSide(target)==0 then
OFP:setArmy(target,1);
end
if OFP:getSide(target)==1 then
OFP:setArmy(target,0);
end
if OFP:getGroupSize("p")<=15 then
local x,y,z=OFP:getPosition(target);
add=OFP:spawnEntitySetAtLocation("E",x,y,z);
end
end
function onMissionStart()
OFP:setInvulnerable("huntercqb",true);
OFP:addTimer("change",5000);
end
function onSpawnedReady( setName, setID, tableOfEntities, errorCode )
if setID==add then
for i=1,#tableOfEntities do
if OFP:getBroadUnitCategory(tableOfEntities[i])=="BROAD_UNIT_SOLDIER" then
OFP:addToGroup(tableOfEntities[i],"p");
end
end
end
end