kevin11 Posted June 2, 2010 Share Posted June 2, 2010 (edited) idk what to tell i dont know what function to use can anyone send me wiki page or tell me what function function onSoundEvent ( )() local sound = playSound("music.mp3",false) end addCommandHandler("startc", onSoundEvent) Edited June 2, 2010 by Guest Link to comment
Dark Dragon Posted June 2, 2010 Share Posted June 2, 2010 function onResourceStart() local sound = playSound("music.mp3",true) end addCommandHandler("startc",onResourceStart) is this what you mean? Link to comment
kevin11 Posted June 2, 2010 Author Share Posted June 2, 2010 nope it doesnt plays the sound Link to comment
Dark Dragon Posted June 2, 2010 Share Posted June 2, 2010 is this a client side file? did you add the file in the meta.xml? by the way you broke your script even further function onSoundEvent () local sound = playSound("music.mp3",false) end addCommandHandler("startc", onSoundEvent) Link to comment
kevin11 Posted June 2, 2010 Author Share Posted June 2, 2010 is this a client side file? did you add the file in the meta.xml? yes its client <meta> <info type="script" version="1.0.0" /> <script src="music.lua" type="client"/> <file src="music.mp3" /> meta> Link to comment
Dark Dragon Posted June 2, 2010 Share Posted June 2, 2010 remember what i told you about debugging? try this function onSoundEvent () outputDebugString("command used") local sound = playSound("music.mp3",false) outputDebugString(tostring(sound)) end addCommandHandler("startc", onSoundEvent) Link to comment
kevin11 Posted June 2, 2010 Author Share Posted June 2, 2010 ty its working and i forgot about debugging ty for youre help and time Link to comment
kevin11 Posted June 2, 2010 Author Share Posted June 2, 2010 dark u still onine?? my guests cant hear to music maybe a bug inside script Link to comment
50p Posted June 2, 2010 Share Posted June 2, 2010 dark u still onine?? my guests cant hear to music maybe a bug inside script It's only heard by player who typed in the command. They can hear it when they type that command. Link to comment
kevin11 Posted June 2, 2010 Author Share Posted June 2, 2010 dark u still onine?? my guests cant hear to music maybe a bug inside script It's only heard by player who typed in the command. They can hear it when they type that command. is it possible to that if i type it everyone hears it? Link to comment
robhol Posted June 2, 2010 Share Posted June 2, 2010 Yes. But frankly, you're too clueless about even basic syntax - you should read some more about Lua before you try anything. Once you've gotten the basic Lua down, you can accomplish this by creating a client-side event and triggering it for everybody when the command is entered. Link to comment
50p Posted June 2, 2010 Share Posted June 2, 2010 Yes. You need to triggerServerEvent which will then triggerClientEvent to everyone. Link to comment
kevin11 Posted June 2, 2010 Author Share Posted June 2, 2010 Yes. But frankly, you're too clueless about even basic syntax - you should read some more about Lua before you try anything.Once you've gotten the basic Lua down, you can accomplish this by creating a client-side event and triggering it for everybody when the command is entered. this is client side... u mean trigger server side? i am learning scripting a little more everyday (very little) but i cant do this because i thought it would play for everyone can someone post solution? or how to make one? Link to comment
NotAvailable Posted June 2, 2010 Share Posted June 2, 2010 Here is my music resource: http://www.community.multitheftauto.com/index.ph ... ils&id=762 Link to comment
raulrobi Posted June 2, 2010 Share Posted June 2, 2010 yeha but you must add in meta this line i use winap so it will be So for me works Link to comment
Dark Dragon Posted June 2, 2010 Share Posted June 2, 2010 Yes.You need to triggerServerEvent which will then triggerClientEvent to everyone. in this case adding the command handler server side would probably be the more efficient way 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