Jump to content

Звук


DexA

Recommended Posts

Posted (edited)

И снова всем привет. Подскажите как сделать остановку звука через некоторое время.

local sound = playSound3D("play.wav", x,y,z, true) 

Edited by Guest
  • Moderators
Posted
И снова всем привет. Подскажите как сделать остановку звука через некоторое время.

local sound = playSound3D("play.wav", x,y,z, true) 

https://wiki.multitheftauto.com/wiki/StopSound и https://wiki.multitheftauto.com/wiki/SetTimer

Не?

Developers, Developers, Developers, Developers.... © Steve Balmer

http://www.lua.org/about.html

Quote
Please do not write it as "LUA", which is both ugly and confusing, because then it becomes an acronym with different meanings for different people. So, please, write "Lua" right!
Posted (edited)
local sound = playSound3D("play.wav", x,y,z, true) 
local stop = stopSound( sound ) 
setTimer ( stop, 22000, 1 ) 

Edited by Guest
Posted
local sound = playSound3D("play.wav", x,y,z, true) 
local stop = stopSound( sound ) 
setTimer ( stop, 22000, 1 ) 

У тебя не правильный код.

1) Ты проигрываешь звук play.wav

2) Потом ты сразу останавливаешь его, в итоге ты не услышишь звук.

3) Затем ты ставишь таймер не на функцию, а на булевую переменную.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

Ты должен понять, что ты не сможешь написать не один скрипт без знания Lua, а также чтения вики https://wiki.multitheftauto.com/wiki/Main_Page.

  
local fX, fY, fZ = 0, 0, 10; -- координаты 
local pSound = playSound3D( "play.wav", fX, fY, fZ, true ); 
setTimer( stopSound, 22000, 1, pSound ); 
  

Читай viewtopic.php?f=141&t=32458

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

Большое спасибо за помощь. Вики я читаю, значит в чем-то не разобрался там. Еще раз спасибо.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...