Spesso Posted October 27, 2013 Posted October 27, 2013 hey guys, i wanna i little help, i created this function function helloCommand ( playerSource, commandName ) local theTriggerer = getPlayerName ( playerSource ) triggerClientEvent ( "onHello", getRootElement() ) outputChatBox ( theTriggerer .. ": #00FF00Hello Man!", getRootElement(), 255, 255, 255, true ) end but i wanna add this function works only for admin and donators, and idk how do it. anyone help me pls
Tete omar Posted October 27, 2013 Posted October 27, 2013 For admins you can use: getAccountName getPlayerAccount isObjectInACLGroup aclGetGroup For donators you have to make your own donators system which means every donator, you store them in an XML file or a database or something like that, afterwards you make a custom function to check whether a player is a donator and use it when needed.
Spesso Posted October 27, 2013 Author Posted October 27, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) this?
Castillo Posted October 27, 2013 Posted October 27, 2013 If 'accountname' is defined, then it should work.
Moderators Citizen Posted October 27, 2013 Moderators Posted October 27, 2013 For donators you have to make your own donators system No you can create a donator group in the ACL just like for the admins and manually put the donators in that group.
فاّرس Posted October 27, 2013 Posted October 27, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ))this? if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) then
-.Paradox.- Posted October 27, 2013 Posted October 27, 2013 Try this not tested function helloCommand ( playerSource, commandName, acc ) local accName = getAccountName ( acc ) local theTriggerer = getPlayerName ( playerSource ) triggerClientEvent ( "onHello", getRootElement() ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" )) then outputChatBox ( theTriggerer .. ": #00FF00Hello Man!", getRootElement(), 255, 255, 255, true ) else outputChatBox ( "You can't use this command!", getRootElement(), 255, 0, 0, true) end end
.:HyPeX:. Posted October 27, 2013 Posted October 27, 2013 function helloCommand ( playerSource, commandName, acc ) local account = getPlayerAccount( playerSource ) local accName = getAccountName( account ) local theTriggerer = getPlayerName ( playerSource ) triggerClientEvent ( "onHello", getRootElement() ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "SuperModerator" )) then outputChatBox ( theTriggerer .. ": #00FF00Hello Man!", getRootElement(), 255, 255, 255, true ) else outputChatBox ( "You can't use this command!", getRootElement(), 255, 0, 0, true) end end
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