- 64
- 8
- Версия MoonLoader
- .026-beta
Скрипт:
script_name("Auto turn signal")
script_author("Rybkabob")
script_version("0.1-beta")
require "lib.moonloader"
local tag = "My first script"
local label = 0
local keys = require "vkeys"
local sound_state = require('moonloader').audiostream_state
function main()
repeat wait(100) until isSampAvailable()
if not doesFileExist('moonloader/resource/audio/3byki.mp3') then
sampAddChatMessage('{ [Auto turn signal] Звук был не найден, отключаюсь.', -1)
print('[Auto turn signal]Звук не найден, отключаюсь.')
thisScript():unload()
end
AudioStream = loadAudioStream('moonloader/resource/audio/3byki.mp3')
while true do
wait(0)
if isKeyJustPressed(VK_A) and not sampIsChatInputActive() then
lua_thread.create(function()
setVirtualKeyDown(VK_Q, true)
wait(10)
setVirtualKeyDown(VK_Q, false)
setAudioStreamState(AudioStream, sound_state.PLAY)
wait(10000)
setAudioStreamState(AudioStream, sound_state.STOP)
end)
end
if isKeyJustPressed(VK_D) and not sampIsChatInputActive() then
lua_thread.create(function()
setVirtualKeyDown(VK_E, true)
wait(10)
setVirtualKeyDown(VK_E, false)
setAudioStreamState(AudioStream, sound_state.PLAY)
wait(10000)
setAudioStreamState(AudioStream, sound_state.STOP)
end)
end
end
end
Проверял пути к звуку, все ровно.