Jump to content

Gates


mint3d

Recommended Posts

Ok i have this script and i want to set it to check name for CZ so it only opens for people with CZ in there name,or with using a command like /gate

  
   a51gate1 = createObject ( 980, 2060.96484375, 2437.982421875, 10.8203125, 0, 0, 0 ) 
   a51col = createColCircle ( 213.94564819336, 1875.40234375, 13.938992500305, 7 ) 
  
function opena51gates(thePlayer) 
if getElementModel( thePlayer ) == 287 then 
       moveObject (a51gate1, 5000, 2060.96484375, 2437.982421875, 10.8203125 ) 
  
end 
end 
addEventHandler( "onColShapeHit", a51col, opena51gates ) 
  
function closea51gates(thePlayer) 
if getElementModel( thePlayer ) == 287 then 
       moveObject (a51gate1, 5000, 2060.96484375, 2437.982421875, 5.8203125 ) 
end 
end 
addEventHandler( "onColShapeLeave", a51col, closea51gates ) 

Link to comment

with commands will be easier

local a51gate1 = createObject ( 980, 2060.96484375, 2437.982421875, 10.8203125, 0, 0, 0 ) 
local a51col = createColCircle ( 213.94564819336, 1875.40234375, 13.938992500305, 7 ) 
  
function opena51gates(thePlayer) 
    if getElementType(thePlayer) == "player" then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 2060.96484375, 2437.982421875, 10.8203125 ) 
        end 
    end 
end 
addCommandHandler( "open", opena51gates) 
  
function closea51gates(thePlayer) 
    if getElementType(thePlayer) == "player" then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 2060.96484375, 2437.982421875, 5.8203125 ) 
        end 
    end 
end 
addCommandHandler( "close", closea51gates) 

Sorry

Some mistakes edited!

Edited by Guest
Link to comment
local a51gate1 = createObject ( 980, 1940.04175 2215.40015 10.7225, 0, 0, 0 ) 
local a51col = createColCircle ( 1940.04175 2215.40015 10.7225, 7 ) 
  
function opena51gates(thePlayer) 
    if getElementType(thePlayer) == "player" then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1940.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addCommandHandler( "test", opena51gates) 
  
function closea51gates(thePlayer) 
    if getElementType(thePlayer) == "player" then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1930.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addCommandHandler( "test1", closea51gates) 

i am using that and the gate dosent show up and i ment like find a name that had CZ in it

Link to comment
local a51gate1 = createObject ( 980, 1940.04175 2215.40015 10.7225, 0, 0, 0 ) 
local a51col = createColCircle ( 1940.04175 2215.40015 10.7225, 7 ) 
  
function opena51gates(thePlayer) 
    if getElementType(thePlayer) == "player" then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1940.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addCommandHandler( "test", opena51gates) 
  
function closea51gates(thePlayer) 
    if getElementType(thePlayer) == "player" then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1930.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addCommandHandler( "test1", closea51gates) 

i am using that and the gate dosent show up and i ment like find a name that had CZ in it

is your skin at 287?

and if you want find a name that had CZ in it, so anyone can change it to CZ and enter

Link to comment

The gate dosent show up at my pos and yes i have a DayZ script and they want the gate to open with there gang CZ which is in there name and or a code and the gate dosent show up and i want to remove it so you dont need the skin id

Link to comment
local a51gate1 = createObject ( 980, 1940.04175 2215.40015 10.7225, 0, 0, 0 ) 
local a51col = createColCircle ( 1940.04175 2215.40015 10.7225, 7 ) 
  
function opena51gates(thePlayer) 
    if string.find ( getPlayerName ( thePlayer ),'CZ'  ) then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1940.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addCommandHandler( "open", opena51gates) 
  
function closea51gates(thePlayer) 
    if string.find ( getPlayerName ( thePlayer ),'CZ'  ) then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1930.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addCommandHandler( "close", closea51gates) 

Commands :

- open

- close

Server Side!

Link to comment

iFahad you didn't removed the commands :lol:

try this:

local a51gate1 = createObject ( 980, 1940.04175 2215.40015 10.7225, 0, 0, 0 ) 
local a51col = createColCircle ( 1940.04175 2215.40015 10.7225, 7 ) 
  
function opena51gates(thePlayer) 
    if string.find ( getPlayerName ( thePlayer ),'CZ'  ) then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1940.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addEventHandler( "onColShapeHit", a51col, opena51gates ) 
  
function closea51gates(thePlayer) 
    if string.find ( getPlayerName ( thePlayer ),'CZ'  ) then 
        if getElementModel( thePlayer ) == 287 then 
            moveObject (a51gate1, 5000, 1930.04175 2215.40015 10.7225 ) 
        end 
    end 
end 
addEventHandler( "onColShapeLeave", a51col, closea51gates ) 
  

Edited!

Link to comment
local a51gate1 = createObject ( 980, 1940.04175 ,2215.40015 ,10.7225, 0, 0, 0 ) 
local a51col = createColCircle ( 1940.04175 ,2215.40015 ,10.7225 ) 
  
function opena51gates(thePlayer) 
    if string.find ( getPlayerName ( thePlayer ),'CZ'  ) then 
            moveObject (a51gate1, 5000, 1940.04175 ,2215.40015 ,10.7225 ) 
    end 
end 
addCommandHandler( "open", opena51gates) 
  
function closea51gates(thePlayer) 
    if string.find ( getPlayerName ( thePlayer ),'CZ'  ) then 
            moveObject (a51gate1, 5000, 1930.04175 ,2215.40015 ,10.7225 ) 
    end 
end 
addCommandHandler( "close", closea51gates) 

open - close

Edited by Guest
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...