xTravax Posted June 9, 2013 Share Posted June 9, 2013 Can anyone give me a full script example of voicecommand like i make sound hi and name it hi.mp3 and when i write command /hi it will play sound hi.mp3 Link to comment
xXMADEXx Posted June 9, 2013 Share Posted June 9, 2013 addCommandHandler playSound -- or: playSound3D Link to comment
xTravax Posted June 9, 2013 Author Share Posted June 9, 2013 i don't know to script but i tried to edit wiki script is it good? -- it was stopSound so i changed it to startSound function startMySound() sound = playSound( "sound.mp3", true ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound ) addCommandHandler ( "startsound", startMySound ) Link to comment
WASSIm. Posted June 9, 2013 Share Posted June 9, 2013 function startMySound() sound = playSound( "sound.mp3", false ) end addCommandHandler ( "startsound", startMySound ) Link to comment
xTravax Posted June 14, 2013 Author Share Posted June 14, 2013 i got this error BASS ERROR 2 in LoadMedia path:C:\Program Files (x86)\MTA San Andreas 1.3\mods\deathmatch\resources\voicecommands\hello.mp3 3d:0 loop:1 Link to comment
iPrestege Posted June 14, 2013 Share Posted June 14, 2013 Post the script and meta.xml. Link to comment
xTravax Posted June 14, 2013 Author Share Posted June 14, 2013 function startMySound() sound = playSound( "hello.mp3", false ) end addCommandHandler ( "hello", startMySound ) i have made mistake in META now its FIXED but i have another PROBLEM when i do /hello it will keep repeating without stopping and i want it to stop when it finishes (2 seconds) Link to comment
iPrestege Posted June 14, 2013 Share Posted June 14, 2013 function startMySound() sound = playSound( "hello.mp3", false ) end addCommandHandler ( "hello", startMySound ) i have made mistake in META now its FIXED but i have another PROBLEM when i do /hello it will keep repeating without stopping and i want it to stop when it finishes (2 seconds) setTimer destroyElement Link to comment
xTravax Posted June 16, 2013 Author Share Posted June 16, 2013 i tried to make it but it looks all weird and if i give it to you it would look like i never saw lua and i know to make function startMySound() sound = playSound( "hello.mp3", false ) end addCommandHandler ( "hello", startMySound ) but idk to make destroyelement and settimer Link to comment
blehmeh Posted June 16, 2013 Share Posted June 16, 2013 It shouldn't repeat since the loop argument is false, but I guess your mp3 file isn't just a one "hello". function startMySound() helloSound = playSound( "hello.mp3", false ) setTimer(stopHelloSound, 2000, 1) end addCommandHandler ( "hello", startMySound ) function stopHelloSound() stopSound(helloSound) end Link to comment
xTravax Posted June 17, 2013 Author Share Posted June 17, 2013 thanks Waba it's working. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now