Skip to content
User Avatar
#1359
Auto-translated
It's slightly different there: in my case, the amount of gold was checked after the sum was already deducted, while in your case, you need to compare it not to 0, but to 10000, and in that case, you need to use >=.

Added 5 minutes later
It's better to perform the check in function b and immediately display a message about the lack of resources.

Added 7 minutes later
function b()
    if GetPlayerResource(1, 6) >= 10000 then
        QuestionBox("золото есть.txt", "yes")
    else
        MessageBox("золота нет.txt")
    end
end

function yes()
    SetPlayerResource(1, 6, GetPlayerResource(1, 6) - 10000)
    obs = obs + 10
end
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4