function GarrisonBlock()
while 1 do
if GetObjectOwner("Fortress_2")==GetObjectOwner("Dungeon_1") then
SetObjectEnabled("Garnizon_1", 1, GetObjectOwner("Dungeon_1"))
while not IsObjectEnabled("Garnizon_1") do sleep(1) end
end
for i=1,8 do
if GetPlayerState(i)==PLAYER_ACTIVE and i~=GetObjectOwner("Dungeon_1") and i~=GetObjectOwner("Fortress_2") and IsObjectEnabled("Garnizon_1") then
SetObjectEnabled("Garnizon_1", nil, i)
end;
end;
sleep(1)
end;
end;
startThread(GarrisonBlock)
I put the second sleep(1) in the wrong place, so the loop was running without a pause, and the game would freeze if the condition wasn't met.
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________