General > Developers Corner

Play Sound when an admin write a message.

(1/1)

Telmoquares:
Hey,

I want to play a sound when an admin write a message in the chat.
I have made a special command from this (copied from ulx tsay) xD

This is locaeted in the ulx/modules/sh/chat.lua

--- Code: ---function ulx.lsay( calling_ply, message)
ULib.tsay( _, message )

end
local lsay = ulx.command( CATEGORY_NAME, "ulx lsay", ulx.lsay, "!l", true )
lsay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine }
lsay:defaultAccess( ULib.ACCESS_ADMIN )
lsay:help( "Sendet eine Nachricht mit Sound." )
--- End code ---

My question is: How can i play a sound, when someone type a message in here?
I tried to put
--- Code: ---sound.Play( "ambient/explosions/exp1.wav", Vector( 0, 0, 0 ) )
--- End code ---
found on a gmod wikia site, but its not working.

Thanks for the help!

iViscosity:
The surface.PlaySound function may help you out.

Navigation

[0] Message Index

Go to full version