ZeyadGTX Posted June 22, 2014 Posted June 22, 2014 Hey Guys , i have script which make sound in chat , but i have something i want this sounds Plays onTeamChat only because it plays on Any Chat Client function playSonido() local sound = playSound("chat.mp3",false) setSoundVolume(sound, 0.9) end addEvent("sonido",true) addEventHandler("sonido",getRootElement(),playSonido) Server function chat (thePlayer) triggerClientEvent("sonido",getRootElement()) end addEventHandler ( "onPlayerChat", getRootElement(), chat ) My nick in MTA is Spider
Max+ Posted June 23, 2014 Posted June 23, 2014 Next Time , Make sure your in the Scripting Section , addEventHandler('onPlayerChat', root, function ( msg, msgType ) if ( msgType == 2 ) then triggerClientEvent(source, 'Play', source ) end end ) ---ServerSide addEvent('Play', true ) addEventHandler('Play', root, function ( ) local sound = playSound("chat.mp3" ) setSoundVolume(sound, 1.0) end ) - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Et-win Posted June 23, 2014 Posted June 23, 2014 We have helped you with 2 scripts for teamchat already and still you don't know it? Look into the scripts we have 'helped' you with and go understand it. I think you are not even taking time to look into it. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Moderators IIYAMA Posted June 24, 2014 Moderators Posted June 24, 2014 We have helped you with 2 scripts for teamchat already and still you don't know it? Look into the scripts we have 'helped' you with and go understand it. I think you are not even taking time to look into it. Hij wil het ook niet, dit is alleen maar bedelen. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Et-win Posted June 24, 2014 Posted June 24, 2014 We have helped you with 2 scripts for teamchat already and still you don't know it? Look into the scripts we have 'helped' you with and go understand it. I think you are not even taking time to look into it. Hij wil het ook niet, dit is alleen maar bedelen. Yup. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
ZeyadGTX Posted June 24, 2014 Author Posted June 24, 2014 Not Working , i added this to server side addEventHandler('onPlayerChat', root, function ( msg, msgType ) if ( msgType == 2 ) then triggerClientEvent(source, 'Play', source ) end end ) ---ServerSide addEvent('Play', true ) addEventHandler('Play', root, function ( ) local sound = playSound("chat.mp3" ) setSoundVolume(sound, 1.0) end ) My nick in MTA is Spider
Max+ Posted June 24, 2014 Posted June 24, 2014 are you sure chat.mp3 is not inside a file , ? and show meta.xml - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
ZeyadGTX Posted June 24, 2014 Author Posted June 24, 2014 "" description="teamsoundT" info="mod" type="misc" version="1.0.5" /> My nick in MTA is Spider
Et-win Posted June 24, 2014 Posted June 24, 2014 Where is the client file in meta? ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Max+ Posted June 24, 2014 Posted June 24, 2014 Make 2 lua file , file 1 - clientSide witch is the play sound , file 2 the server side , witch is the have triggerClient, - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
ZeyadGTX Posted June 24, 2014 Author Posted June 24, 2014 Look "0" description="" info="mod" type="misc" version="1.0.5" /> My nick in MTA is Spider
ZeyadGTX Posted June 24, 2014 Author Posted June 24, 2014 Server side addEventHandler('onPlayerChat', root, function ( msg, msgType ) if ( msgType == 2 ) then triggerClientEvent(source, 'Play', source ) end end ) ---ServerSide addEvent('Play', true ) addEventHandler('Play', root, function ( ) local sound = playSound("chat.mp3" ) setSoundVolume(sound, 1.0) end ) Client function playSonido() local sound = playSound("chat.mp3",false) setSoundVolume(sound, 0.9) end addEvent("sonido",true) addEventHandler("sonido",getRootElement(),playSonido) My nick in MTA is Spider
Et-win Posted June 24, 2014 Posted June 24, 2014 type="misc" has to be script btw. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Max+ Posted June 24, 2014 Posted June 24, 2014 this is serverSide , addEventHandler('onPlayerChat', root, function ( msg, msgType ) if ( msgType == 2 ) then triggerClientEvent(source, 'Play', source ) end end ) ClientSide , addEvent('Play', true ) addEventHandler('Play', root, function ( ) local sound = playSound("chat.mp3" ) setSoundVolume(sound, 1.0) end ) and change the misc to script - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
ZeyadGTX Posted June 25, 2014 Author Posted June 25, 2014 thanks , it works good but i have another question . i hear the sound when i send message i want to hear it when others send My nick in MTA is Spider
#DRAGON!FIRE Posted June 25, 2014 Posted June 25, 2014 Client Side ! addEvent( "PlaySound", true ) addEventHandler( "PlaySound", root, function ( ) if ( isElement( sound ) ) then destroyElement( sound ) end local sound = playSound( "chat.mp3" ) setSoundVolume( sound, 1.0 ) end ) Server Side ! addEventHandler( "onPlayerChat", root, function ( msg, msgType ) if ( msg ~= "" and msgType == 2 ) then triggerClientEvent( "PlaySound", root ) end end ) To Contact Me at Skype : [email protected]
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