Thresh Posted December 23, 2013 Posted December 23, 2013 How can I make this command only for acl group admin and donator? function helloCommand ( playerSource, commandName ) local theTriggerer = getPlayerName ( playerSource ) triggerClientEvent ( "onHello", getRootElement() ) outputChatBox ( theTriggerer .. " #ffffffstarted sound #ff8c00Hello Man#ffffff!", getRootElement(), 255, 255, 255, true ) end
Sasu Posted December 23, 2013 Posted December 23, 2013 (edited) function helloCommand ( playerSource, commandName ) local accPlayer = getPlayerAccount(playerSource) local accName = getAccountName(accPlayer) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Donator" ) ) then local theTriggerer = getPlayerName ( playerSource ) triggerClientEvent ( "onHello", getRootElement() ) outputChatBox ( theTriggerer .. " #ffffffstarted sound #ff8c00Hello Man#ffffff!", getRootElement(), 255, 255, 255, true ) end end Edited December 23, 2013 by Guest
Thresh Posted December 23, 2013 Author Posted December 23, 2013 It's still dont start the sound or show the text if i use that function helloCommand ( playerSource, commandName ) local accPlayer = getPlayerAccount(playerSource) local accName = getAccountName(accName) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Donator" ) ) then local theTriggerer = getPlayerName ( playerSource ) triggerClientEvent ( "onHello", getRootElement() ) outputChatBox ( theTriggerer .. " #ffffffstarted sound #ff8c00Hello Man#ffffff!", getRootElement(), 255, 255, 255, true ) end end
Thresh Posted December 23, 2013 Author Posted December 23, 2013 Is there just copied the function but ok here is it : addCommandHandler ( "hello", helloCommand )
Castillo Posted December 23, 2013 Posted December 23, 2013 local accName = getAccountName(accName) Should be: local accName = getAccountName ( accPlayer )
Grafu Posted December 23, 2013 Posted December 23, 2013 By the way you can limit usage of the command for other players by passing "true" as the third argument to addCommandHandler. Then you will have to add a right "command.yourCommandName" to the acls you want to use.
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