Jump to content

ERROR


yToPzz

Recommended Posts

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
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

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...