Thresh Posted December 23, 2013 Share 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 Link to comment
Sasu Posted December 23, 2013 Share 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 Link to comment
Thresh Posted December 23, 2013 Author Share 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 Link to comment
Castillo Posted December 23, 2013 Share Posted December 23, 2013 And where's addCommandHandler? Link to comment
Thresh Posted December 23, 2013 Author Share Posted December 23, 2013 Is there just copied the function but ok here is it : addCommandHandler ( "hello", helloCommand ) Link to comment
Castillo Posted December 23, 2013 Share Posted December 23, 2013 local accName = getAccountName(accName) Should be: local accName = getAccountName ( accPlayer ) Link to comment
Thresh Posted December 23, 2013 Author Share Posted December 23, 2013 Now it works! Thank you all guys Link to comment
Grafu Posted December 23, 2013 Share 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. 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