yToPzz Posted July 5, 2022 Share Posted July 5, 2022 ERROR: Server triggered clientside event sonido, but event is not added clientside Client-Side: function playSonido() local sound = playSound("chat.mp3",false) setSoundVolume(sound, 0.9) end addEvent("sonido",true) addEventHandler("sonido",getRootElement(),playSonido) Server-Side: function chat (thePlayer) triggerClientEvent("sonido",getRootElement()) end addEventHandler ( "onPlayerChat", getRootElement(), chat ) the error occurs when the player sends a message in chat without being logged in so as I don't know how to block message during download I need help with the error Link to comment
Fierelier Posted July 5, 2022 Share Posted July 5, 2022 Is the client script added in meta.xml, like this? <script src="client.lua" type="client"/> Link to comment
yToPzz Posted July 5, 2022 Author Share Posted July 5, 2022 (edited) 32 minutes ago, Fierelier said: Is the client script added in meta.xml, like this? <script src="client.lua" type="client"/> yes Edited July 5, 2022 by yToPzz Link to comment
#\_oskar_/# Posted July 6, 2022 Share Posted July 6, 2022 function playSonido(Sound) sound = playSound(Sound,false) setSoundVolume(sound, 0.9) end addEvent("sonido",true) addEventHandler("sonido",getRootElement(),playSonido) function chat (_,type) if type == 0 then triggerClientEvent(source,"sonido",getRootElement(),'chat.mp3') --elseif type == 2 then triggerClientEvent(source,"sonido",getRootElement(),'team.mp3') end end addEventHandler ( "onPlayerChat", getRootElement(), chat ) <meta> <script src="client.lua" type="client"/> <script src="server.lua" type="server"/> <file src="chat.mp3" /> <!--<file src="team.mp3" />--> </meta> 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