#Whit3^ Posted June 5, 2013 Share Posted June 5, 2013 Server function stfu (player, command) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox( "Sounds StartedBy "..getPlayerName(player).." :#FF8000 Shut The **** UP!", root, 255, 255, 255, true ) triggerClientEvent("stfu", root) end addCommandHandler("stfu", stfu) Client addEvent( "stfu", true ) addEventHandler( "stfu", root, function() local sound = playSound("sounds/stfu.mp3") end ) When I do the command the music doesn't start Anyone can help me pls ? p.s Admin Sounds Link to comment
iPrestege Posted June 5, 2013 Share Posted June 5, 2013 -- Server Side -- function stfu ( player ) if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then outputChatBox( "Sounds StartedBy "..getPlayerName(player).." :#FF8000 Shut The **** UP!", root, 255, 255, 255, true ) triggerClientEvent("stfu", root) end end addCommandHandler("stfu", stfu) -- Client Side -- addEvent( "stfu", true ) addEventHandler( "stfu", root, function( ) if isElement ( sound ) then destroyElement ( sound ) end sound = playSound("sounds/stfu.mp3") end ) Link to comment
#Whit3^ Posted June 6, 2013 Author Share Posted June 6, 2013 -- Server Side -- function stfu ( player ) if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then outputChatBox( "Sounds StartedBy "..getPlayerName(player).." :#FF8000 Shut The **** UP!", root, 255, 255, 255, true ) triggerClientEvent("stfu", root) end end addCommandHandler("stfu", stfu) -- Client Side -- addEvent( "stfu", true ) addEventHandler( "stfu", root, function( ) if isElement ( sound ) then destroyElement ( sound ) end sound = playSound("sounds/stfu.mp3") end ) Work Perfectly Thanks Bro And if I want a command that I turn on and off the ability to make this command? For Example /revokesounds Link to comment
iPrestege Posted June 6, 2013 Share Posted June 6, 2013 Change this ; addEvent( "stfu", true ) addEventHandler( "stfu", root, function( ) if not sound then sound = playSound("sounds/stfu.mp3") else destroyElement ( sound ) end end ) 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