local vkeys = require 'vkeys'
local MAX = 1000 -- Максимальное значение
local MIN = 100 -- Минимальное значание
local UP = 100 -- Скачок
local currentFog = 0
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage(string.format("Текущее значение: %d", currentFog), -1)
while true do
wait(0)
if wasKeyPressed(vkeys.VK_Z) then -- + значение Up
changeFog(UP)
end
if wasKeyPressed(vkeys.VK_X) then -- - значение Up
changeFog(-UP)
end
end
end
function changeFog(znc)
currentFog = currentFog + znc
if currentFog > MAX then currentFog = MAX end
if currentFog < MIN then currentFog = MIN end
sampProcessChatInput(string.format("/fogdist %d", currentFog))
sampAddChatMessage(string.format("Значение: %d", currentFog), -1)
end