Storm-Hanma Posted June 20, 2018 Share Posted June 20, 2018 (edited) Creat gates first, then use markers or cuboid with on hit function move gate to xyz positions for open gate and for close the gate use on leave function see below code Code local time = 4000 -- time for the gate open and close local gate = createObject(0, 0, 0, 0, 0, 0, 0) --(object id, x, y, z, rx, ry, rz) local marker = createMarker(0, 0, 0, "cylinder", 13, 255, 0, 0, 0) --(x, y, z, function moveGate(hitPlayer, matchingDimension) moveObject(gate, time, 0, 0, 0, 0, 0, 0) --(position when the gate is open (gate, time, x, y, z, rx, ry, rz) end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, time, 0, 0, 0, 0, 0, 0) --(position when the gate is close same of "local gate = createObject..." but just(x, y, z, rx, ry, rz) not put id end addEventHandler("onMarkerLeave", marker, moveBack) -- for work with commands put addCommandHandler("open", moveGate) and addCommandHandler("close", moveBack) You can make this without commands also use created cuboid function and remove commandhandler function Like this : Code : gate = createObject( 971, 2334.8000488281, 2444.1000976563, 8.3000001907349, 0, 0, 58 ) --Object ID (Airport Gate=978) & Co-Ordinates of your gates start of position. gatecol = createColCircle ( 2334.8000488281, 2444.1000976563, 15 ) --Co-Ordinates "X" and "Y" and the radius, I use 15 as default. function openagates(thePlayer) if getElementModel( thePlayer ) == 267 then --Will open only if the player is in the male staff skin moveObject ( gate, 3000, 2334.8000488281, 2444.1000976563, 0 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. end end addEventHandler( "onColShapeHit", gatecol, openagates ) --Event Handler to trigger the function function closegates (thePlayer) moveObject ( gate, 971, 2334.8000488281, 2444.1000976563, 8.3000001907349, 0, 0, 58) end addEventHandler ( "onColShapeLeave", root, closegates ) Edited June 20, 2018 by Khadeer143 Link to comment
Siu Posted June 20, 2018 Author Share Posted June 20, 2018 ok thank you very much How to create server and how to add my map into server? Link to comment
Storm-Hanma Posted June 21, 2018 Share Posted June 21, 2018 For server you need to open ports or have a vps or buy server but I'm providing free game servers so you can request from my host site visit here :Pirateshosting.com ,to upload files in your server you must use ftp 2 Link to comment
Siu Posted June 21, 2018 Author Share Posted June 21, 2018 You give me the code is type for where? Link to comment
Z4Zy Posted June 21, 2018 Share Posted June 21, 2018 Suggestion :- Refer multi theft auto wiki, for acquire better knowledge about scripting scripting intro :- https://wiki.multitheftauto.com/wiki/Scripting_Introduction Main Page :- https://wiki.multitheftauto.com/wiki/Main_Page 1 Link to comment
Siu Posted June 21, 2018 Author Share Posted June 21, 2018 Ok thanks! Have anyone use texture studio? Texture studio map myself can play in mta or samp server? 2) code is write object right? 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