Skip to content
#2747
Auto-translated
Try this instead:
function RemoveHero()
while 1 do
if not IsHeroAlive("Aberrar") then
if GetObjectOwner("mine1") == 1 and GetObjectOwner("mine2") == 1 and GetObjectOwner("mine3") == 1 and GetObjectOwner("mine4") == 1 and GetObjectOwner("mine5") == 1 and GetObjectOwner("mine6") == 1 then
UnreserveHero("Aberrar")
else DeployReserveHero("Aberra", coordinates)
end
end
end
end

startThread (RemoveHero)


Added 8 minutes later
Gerter


Attach OBJECT_CAPTURE_TRIGGER to a dwelling, and when it triggers, write the necessary actions:
function Capture(n1, n2, s1, s2)

if(n2 == 1) then
MessageBox(...)
SetPlayerResource(...)
RemoveObject(...) or RazeBuilding(...), if you need to destroy it
end

end

Trigger(OBJECT_CAPTURE_TRIGGER, 'object name', 'Capture')

Thank you, but there are two problems here: there are many dwellings, and the computer doesn't interact with them at all. I meant a function where I touch a dwelling, and I'm offered what to do with it. At the same time, it is not captured, but the computer can interact with it as usual.