fierrostor Posted May 6, 2016 Share Posted May 6, 2016 Hello i want ask how i can make these script only for specific ACL group that would allowed them to open because now everyone can open it but i want just for specific group acl this is the script: function createTheGate myGate1 = createObject ( 3037, -2694.6999511719, 1394.5999755859, 8.3000001907349, 0, 0, 90 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate2 ) function openMyGate ( ) local Omegausergroup = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Xyruviausergroup, aclGetGroup("OMEGA")) then moveObject(myGate1, 3037, -2694.6999511719, 1394.5999755859, 3.000000) end end addCommandHandler("baseopen",openMyGate) end function closeMyGate ( ) moveObject ( myGate1, 3037, -2694.6999511719, 1394.5999755859, 8.3100004196167 ) end addCommandHandler("baseclose",closeMyGate) Link to comment
Dimos7 Posted May 6, 2016 Share Posted May 6, 2016 myGate1 = createObject ( 3037, -2694.6999511719, 1394.5999755859, 8.3000001907349, 0, 0, 90 ) function openMyGate ( ) local account= getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..account, aclGetGroup("OMEGA")) then moveObject(myGate1, 3037, -2694.6999511719, 1394.5999755859, 3.000000) end end addCommandHandler("baseopen",openMyGate) function closeMyGate ( ) local account = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..account,aclGetGroup("OMEGA")) then moveObject ( myGate1, 3037, -2694.6999511719, 1394.5999755859, 8.3100004196167 ) end end addCommandHandler("baseclose",closeMyGate) Link to comment
Walid Posted May 6, 2016 Share Posted May 6, 2016 simply it can be like this local myGate1 = createObject ( 3037, -2694.6999511719, 1394.5999755859, 8.3000001907349, 0, 0, 90 ) function openMyGate (player,cmd) if player and isElement(player) then local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local accountName = getAccountName(account) if isObjectInACLGroup("user."..accountName, aclGetGroup("OMEGA")) then if cmd == "open" then moveObject(myGate1, 3037, -2694.6999511719, 1394.5999755859, 3.000000) elseif cmd == "close" then moveObject ( myGate1, 3037, -2694.6999511719, 1394.5999755859, 8.3100004196167 ) end end end end end addCommandHandler("gate",openMyGate) use /gate open : to open the gate. use /gate close: to close the gate. 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