Spesso Posted October 27, 2013 Share 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 Link to comment
Tete omar Posted October 27, 2013 Share 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. Link to comment
Spesso Posted October 27, 2013 Author Share Posted October 27, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) this? Link to comment
Castillo Posted October 27, 2013 Share Posted October 27, 2013 If 'accountname' is defined, then it should work. Link to comment
Moderators Citizen Posted October 27, 2013 Moderators Share 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. Link to comment
فاّرس Posted October 27, 2013 Share Posted October 27, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ))this? if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) then Link to comment
-.Paradox.- Posted October 27, 2013 Share 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 Link to comment
Castillo Posted October 27, 2013 Share Posted October 27, 2013 'acc' will be a string there. Link to comment
.:HyPeX:. Posted October 27, 2013 Share 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 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