Machine Posted August 12, 2012 Share Posted August 12, 2012 this gate moved great but how can i make it only for admins? local gate1 = createObject ( 980, -2085.8994140625, -213, 37.099998474121, 0, 0, 0 ) local status = false addCommandHandler ( "move", function ( ) if ( status ) then status = false moveObject ( gate1, 4000, -2085.8999023438, -213, 29.10000038147 ) else status = true moveObject ( gate1, 4000, -2085.8999023438, -213, 37.099998474121 ) end end ) Link to comment
manve1 Posted August 12, 2012 Share Posted August 12, 2012 use: aclGetGroup PS. Click on "aclGetGroup" for function. EDIT: do the "aclGetGroup" on top of the whole script. Link to comment
Vision Posted August 12, 2012 Share Posted August 12, 2012 You can also use: isObjectInACLGroup Link to comment
manve1 Posted August 12, 2012 Share Posted August 12, 2012 thanks alot Always happy to help. Link to comment
Machine Posted August 12, 2012 Author Share Posted August 12, 2012 tried it give me error whats wrong? (aclGetGroup("Admin") ) local gate1 = createObject ( 980, 1264.2998046875, -2045.7998046875, 61.099998474121, 0, 0, 0 ) local status = false addCommandHandler ( "move", function ( ) if ( status ) then status = false moveObject ( gate1, 4000, 1264.2998046875, -2045.7998046875, 46.099998474121 ) else status = true moveObject ( gate1, 4000, 1264.2998046875, -2045.7998046875, 61.099998474121 ) end end ) Link to comment
Guest Guest4401 Posted August 12, 2012 Share Posted August 12, 2012 What you have done is absolute non sense. Try this: local gate1 = createObject ( 980, 1264.2998046875, -2045.7998046875, 61.099998474121, 0, 0, 0 ) local status = false addCommandHandler ( "move", function (player) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then if ( status ) then status = false moveObject ( gate1, 4000, 1264.2998046875, -2045.7998046875, 46.099998474121 ) else status = true moveObject ( gate1, 4000, 1264.2998046875, -2045.7998046875, 61.099998474121 ) end else outputChatBox("You can't do that.",player,255,0,0) end end ) Aaand it is serversided. Link to comment
Machine Posted August 12, 2012 Author Share Posted August 12, 2012 thanks alot its so cool! 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