Seaton Posted January 30, 2010 Share Posted January 30, 2010 Alright, in MTA theres the "smashbar" object, which I believe is the one that on msot servers is used that raises upwards to open up, if not correct me with the name of the proper one, what i'm asking is.. what do I need to do, to construct this gate, do I only need the bar? Also, how do you any door, like Airport door and what-not. sorry this is my first day with MTA. Link to comment
WallMart Posted February 2, 2010 Share Posted February 2, 2010 i dont know if you can make a gate with just objects.... doesnt it need to be scripted or something? Link to comment
dzek (varez) Posted February 5, 2010 Share Posted February 5, 2010 it need scripting indeed Link to comment
WallMart Posted February 5, 2010 Share Posted February 5, 2010 sorry cant help you with that im very bad at scripting, maybe you can ask gamesnert or DarkDragon[GER] Link to comment
Dark Dragon Posted February 5, 2010 Share Posted February 5, 2010 this should be at the scripting section but yes. local openArea = createColCuboid(x,y,z,width,depth,height) --you need to replace x,y,z,width,depth,height here local door = createObject(modelid,x,y,z,rotx,roty,rotz) --you need to replace modelid,x,y,z,rotx,roty,rotz here function openTheDoor(element) local move = false if getElementType(element) == "player" then move = true elseif getElementType(element) == "vehicle" then if getVehicleOccupant(element,0) then move = true end end if move then moveObject(door,timetomove,x,y,z,rotx,roty,rotz) --you need to replace timetomove,x,y,z,rotx,roty,rotz here end end addEventHandler("onColShapeHit",openArea,openTheDoor) function closeTheDoor(element) local move = true for i,v in ipairs(getElementsWithinColShape(openArea)) do if getElementType(v) == "player" then move = false break elseif getElementType(v) == "vehicle" then if getVehicleOccupant(v,0) then move = false break end end end if move then moveObject(door,timetomove,oldx,oldy,oldz,oldrotx,oldroty,oldrotz) --you need to replace timetomove,oldx,oldy,oldz,oldrotx,oldroty,oldrotz here end end addEventHandler("onColShapeLeave",openArea,closeTheDoor) untested and of course you have to place all the values correctly in order to make it work. if you need further help, just ask Link to comment
Seaton Posted February 7, 2010 Author Share Posted February 7, 2010 Does anyone know how to script it, so factions can only opena certain gate? Link to comment
Dark Dragon Posted February 9, 2010 Share Posted February 9, 2010 if you set up teams you can easily check if the players team matches the one which should be able to open the door 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