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 )