Ulysses

General => Developers Corner => Topic started by: Telmoquares on October 01, 2016, 03:38:28 PM

Title: Play Sound when an admin write a message.
Post by: Telmoquares on October 01, 2016, 03:38:28 PM
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: [Select]
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." )

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

Thanks for the help!
Title: Re: Play Sound when an admin write a message.
Post by: iViscosity on October 01, 2016, 04:00:43 PM
The surface.PlaySound (http://wiki.garrysmod.com/page/surface/PlaySound) function may help you out.