28WL Posted January 11, 2014 Share Posted January 11, 2014 How I can make this script only for groups: Owners, Admins ---> and it should hear everyone when one of this group members will write a command /PS1? addCommandHandler ( "PS1", function ( Play_Sound_1 ) if isAccountInGroup ( { "Owner", "Admin", "28WLSF" }, getAccountName ( getPlayerAccount ( Play_Sound_1 ) ) ) then setTimer(function() playSound("Sounds/Sound_1.mp3") end, 1000, 1) else outputChatBox ("* You have no acces to that command.", Play_Sound_1 ) end end ) function isAccountInGroup ( groups, account ) local theGroup = false for _, group in ipairs ( groups ) do if isObjectInACLGroup ( "user.".. account, aclGetGroup ( group ) ) then theGroup = group break end end return theGroup end I tried to make it, but I can't hear it. Write, how it should look like, where is the problems? Thanks. Link to comment
Castillo Posted January 11, 2014 Share Posted January 11, 2014 playSound is a client side only function, and your script is server side. You must use triggerClientEvent and add the event client side to play the sound there. 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