local sampev = require 'samp.events'
local active = true
function main()
if not isSampfuncsLoaded() and not isSampLoaded() then return end
while not isSampAvailable() do wait(0) end
audio = loadAudioStream('moonloader/resource/audio/kolokol.mp3')
sampRegisterChatCommand("kl", function()
if active then active = false else active = true end
sampAddChatMessage((active and 'kokolON' or 'kokolOFF'), 0x00FF00)
end)
while true do
wait(0)
end
end
function sampev.onSendTakeDamage(playerId)
if active then
if playerId ~= 65535 then
setAudioStreamState(audio, 3)
end
end
end