Jump to content

[Help] With Gates


Daz

Recommended Posts

Ok here is my gate.lua file it currently works for certain ACL Groups

I want the gate to work for Teams such as military

So the gate only opens for a team I have put in the lua and no one else

Do you know how to do this if so all help would be appreciated Thanks :D

Heres the lua

[lua]col  = createColTube (110.199, 1757.300, 17, 20, 3) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. 
root = getRootElement () 
  
door = createObject ( 980, 110.299, 1756.400, 19.399, 0, 0, 90) -- enter the ID of the object followed by the coordinates 
                                                    -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. 
  
addEvent ( "Open", true ) 
function Open ( pla ) 
  
        if getElementType ( pla ) == "player" then 
        if vehicle or not vehicle then 
        aclGroupListACL ( aclgroup, Military ) if --here you can alter the group from Admin to whatever you require in your server but remember the rest must be the same i.e change everything where it says Admin to your desired group and add the users to that group. 
        isObjectInACLGroup ( "user."..getPlayerName(pla), aclGetGroup ( "Military" ) ) then 
        moveObject (door, 2200, 110.299, 1756.400, 25.5) -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. 
                else          
                return 0 
             
                end 
            end 
        end 
    end 
     
addEventHandler ( "onColShapeHit", col, Open)  
addEventHandler ( "Open", root, Open) 
  
function Close ( pla ) 
    if getElementType ( pla ) == "player" then 
        if vehicle or not vehicle then 
        aclGroupListACL ( aclgroup, Military ) if 
          isObjectInACLGroup ( "user."..getPlayerName(pla), aclGetGroup ( "Military" ) ) then 
             moveObject (door, 2951, 110.299, 1756.400, 19.399) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. 
            else  
            return 0 
            end 
        end 
    end 
end 
  
  
addEventHandler ( "onColShapeLeave", col, Close ) 
addEventHandler ( "Close", root, Close) 
  
  
  
  
  

[/lua]

Link to comment
col  = createColTube (110.199, 1757.300, 17, 20, 3) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape.  
door = createObject ( 980, 110.299, 1756.400, 19.399, 0, 0, 90) -- enter the ID of the object followed by the coordinates 
-- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. 
  
function Open ( pla ) 
    if ( getElementType ( pla ) == "player" ) then 
        local team = getPlayerTeam ( pla ) 
        local teamName = ( team and getTeamName ( team ) or "" ) 
        if ( teamName == "Military" ) then 
            moveObject ( door, 2200, 110.299, 1756.400, 25.5 ) -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( pla ) 
    if ( getElementType ( pla ) == "player" ) then 
        local team = getPlayerTeam ( pla ) 
        local teamName = ( team and getTeamName ( team ) or "" ) 
        if ( teamName == "Military" ) then 
            moveObject ( door, 2951, 110.299, 1756.400, 19.399 ) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. 
        end 
    end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...