

Код: Выделить всё
function CheckUseItem(itemId)
local status = false;
local count = GetItemCount(itemId);
if (count or 0) > 0 then
local start,duration,enable = GetItemCooldown(itemId);
if start == 0 and duration == 0 and enable then
status = true;
end
end
return status;
end
До этого все работало, с таким же кодом, вот вчера перед тем как написать перестал правильно работать. Сейчас по новой все прописал, опять заработалnoname123 писал(а): ↑06 апр 2024, 07:35Привет. Тебе не количество зарядов надо проверять, а готовность итема к использованию.
Камень здоровья.pngНо если хочешь проверять именно заряды, то тебе поможет GetItemCount(5512, nil, true)>2Код: Выделить всё
function CheckUseItem(itemId) local status = false; local count = GetItemCount(itemId); if (count or 0) > 0 then local start,duration,enable = GetItemCooldown(itemId); if start == 0 and duration == 0 and enable then status = true; end end return status; end
Сейчас этот форум просматривают: Bing [Bot] и 1 гость