mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 22:54:53 +02:00
fix items, map, protocls
This commit is contained in:
31
800OTClient/modules/game_bot/functions/sound.lua
Normal file
31
800OTClient/modules/game_bot/functions/sound.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
local context = G.botContext
|
||||
|
||||
context.getSoundChannel = function()
|
||||
if not g_sounds then
|
||||
return
|
||||
end
|
||||
return g_sounds.getChannel(SoundChannels.Bot)
|
||||
end
|
||||
|
||||
context.playSound = function(file)
|
||||
local botSoundChannel = context.getSoundChannel()
|
||||
if not botSoundChannel then
|
||||
return
|
||||
end
|
||||
botSoundChannel:setEnabled(true)
|
||||
botSoundChannel:stop(0)
|
||||
botSoundChannel:play(file, 0, 1.0)
|
||||
return botSoundChannel
|
||||
end
|
||||
|
||||
context.stopSound = function()
|
||||
local botSoundChannel = context.getSoundChannel()
|
||||
if not botSoundChannel then
|
||||
return
|
||||
end
|
||||
botSoundChannel:stop()
|
||||
end
|
||||
|
||||
context.playAlarm = function()
|
||||
return context.playSound("/sounds/alarm.ogg")
|
||||
end
|
Reference in New Issue
Block a user