Jump to content

DayZ Help


Recommended Posts

Hello MTA I made an door opening and i put it on dayz but everyone can open it with that command how to add just one group can use it.. Im using the regular dayz group system witch comes with dayz

Code:

  
local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) 
local state = 0 
  
function move(player) 
        if state == 0 then 
            moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) 
            state = state + 1 
        elseif state == 1 then 
            moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) 
            state = state - 1 
        end 
         
    end 
end 
addCommandHandler("gate", move ) 
  

Link to comment
local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) 
local state = 0 
  
function move(player) 
        if state == 0 then 
            moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) 
            state = state + 1 
        elseif state == 1 then 
            moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) 
            state = state - 1 
        end 
        
    end 
addCommandHandler("gate", move ) 
  

Link to comment

if its team you can make it like this:

local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) 
local state = 0 
  
function move(thePlayer) 
    local team = getPlayerTeam(thePlayer) 
    if (team == "team name here") then 
        if state == 0 then 
            moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) 
            state = state + 1 
        elseif state == 1 then 
             moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) 
             state = state - 1 
        end 
    end 
end 
addCommandHandler("gate", move) 

if tis group like that do like this

local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) 
local state = 0 
  
function move(thePlayer) 
    local group = getElementData(thePlayer, "Groups") 
    if (group == "group name here") then 
        if state == 0 then 
            moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) 
            state = state + 1 
        elseif state == 1 then 
             moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) 
             state = state - 1 
        end 
    end 
end 
addCommandHandler("gate", move) 

Link to comment
if its team you can make it like this:
local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) 
local state = 0 
  
function move(thePlayer) 
    local team = getPlayerTeam(thePlayer) 
    if (team == "team name here") then 
        if state == 0 then 
            moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) 
            state = state + 1 
        elseif state == 1 then 
             moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) 
             state = state - 1 
        end 
    end 
end 
addCommandHandler("gate", move) 

if tis group like that do like this

local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) 
local state = 0 
  
function move(thePlayer) 
    local group = getElementData(thePlayer, "Groups") 
    if (group == "group name here") then 
        if state == 0 then 
            moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) 
            state = state + 1 
        elseif state == 1 then 
             moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) 
             state = state - 1 
        end 
    end 
end 
addCommandHandler("gate", move) 

Thanks my Friend

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...