Jamie_Mews Posted January 24, 2011 Share Posted January 24, 2011 i want only certain people to be able to open the gate, there will be a group name on the ACL called "police". and i want only the people from the "police" to be able to open the gate, it currently opens to those who have permission to kick people, local theMarker = createMarker ( -1572, 662, 6, "cylinder", 10, 0, 0, 255, 0 ) local gate = createObject ( 969, -1571.7370605469, 665.71630859375, 6.1875, 0, 0, 270.27026367188 ) function openGate ( hitElement ) if (getElementType(hitElement) == "player" ) then if hasObjectPermissionTo( hitElement, "function.kickPlayer" ) then moveObject ( gate, 1500, -1571.5941162109, 656.59051513672, 6.1875, 0, 0, 0 ) else outputChatBox ( "** You have entered a restricted area, you will now be taken away. **", hitElement, 255, 0, 0 ) setElementPosition ( hitElement, -1536, 651, 8 ) end end end function closeGate ( leftElement ) if (getElementType(leftElement) == "player" ) then moveObject ( gate, 1500, -1571.5941162109, 656.59051513672 + 9, 6.1875, 0, 0, 0 ) end end addEventHandler( "onMarkerLeave", theMarker, closeGate ) addEventHandler( "onMarkerHit", theMarker, openGate ) Link to comment
Aibo Posted January 24, 2011 Share Posted January 24, 2011 if isObjectInACLGroup("user."..getPlayerName(hitElement), aclGetGroup("police")) then though you may want to use account name instead of player name. Link to comment
eAi Posted January 24, 2011 Share Posted January 24, 2011 That really isn't the way to do it - you should do: if hasObjectPermissionTo(source, "resource.yourResourceNameHere.openGate") then Link to comment
50p Posted January 25, 2011 Share Posted January 25, 2011 That really isn't the way to do it - you should do: if hasObjectPermissionTo(source, "resource.yourResourceNameHere.openGate") then I agree. Though source would be the hit marker. Link to comment
eAi Posted January 25, 2011 Share Posted January 25, 2011 Indeed, replace source with hitElement. It's really stupid and an abuse of the ACL system to check for specific named groups - the whole point of the ACL is to make it so that that kind of stuff isn't necessary - to detach scripts from knowledge of the users. So if you find yourself using aclGetGroup in your script, think twice about it. The only valid use for that is for admin tools that are modifying the ACL. 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