donis123 Posted August 12, 2013 Share Posted August 12, 2013 Hey! i wanna know more about moving gate script couz i ahve find some format there i set in my gate pos and all that stuff and try make a Meta but im not sure about how do i do a Meta to moving gates so here is a " list " off what i wanna know and maby you can make the formats to me and write something about how i do it? Do i need Meta? (and if how do i set it up can you do it for me and show me?) do the Meta do something that the Lua will not start or show some error when i start the (MTA server)? can you make a good and easy Moving Gate format to me so i can follow it and make my gate and make sure you write info about how to do it couz i dont know so much about it! ps: dont tell me to look at the forum couz i have been looking everywhere and try all Lua formats and nothing works! pleas take a time of you life to help me with this, this is my dream to start up a server i have just started all this stuff now and will be happy for one who can help me on the way up to a server! thanks aigen to all who help! ^^ btw if you dont have made one before and dont know that works pleas dont post it here ;/ i looking for one who know the Meta and Lua works couz i have used over 20 hours of my life to look and try and fail and yeah try make the moving gate and now im just tired and realy take this as my last opportunity to make it so aigen i will be very happy for some help! and when i say that i have used 20 hours then i mean it to Have a nice day Link to comment
motax Posted August 12, 2013 Share Posted August 12, 2013 STAFF EDIT/NOTE: Easiest is just downloading this ready to go Moving gates script: https://community.multitheftauto.com/?p=resources&s=details&id=14987 Of course you need meta you always need a meta file for a new resource. The meta.xml should look something like this: "Your_Name" name="resource_name" version="1.0" type="script"/> Then the "move_gate.lua" --create the gate local gate = createObject ( ObjID, Pos_X, Pos_Y, Pos_Z, Rot_X, Rot_Y, Rot_Z ) local state = 0 --this is the state, if 0 gate closed if 1 it's open function move() if state == 0 then --it's closed so open it moveObject ( gate, Time, New_X, New_Y, New_Z) --Time means how fast the object'ill be moved. state = state + 1 elseif state == 1 then --it's open so close it moveObject ( gate, Time,Old_X, Old_Y, Old_Z) state = state - 1 end end addCommandHandler("gate", move )--this one creates a command "/gate" wich'll start the move function This script is written by xScatta and also can be found in the forum here: https://forum.multitheftauto.com/viewtopic.php?f=91&t=63339&p=602320#p602320 and you should also start reading the wiki page because you can find all these stuff there. Link to comment
xXMADEXx Posted August 12, 2013 Share Posted August 12, 2013 You should search the tutorial section. viewtopic.php?f=148&t=53694 viewtopic.php?f=148&t=51875 Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 i will test this soon thanks guys! Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 Of course you need meta you always need a meta file for a new resource.The meta.xml should look something like this: "Your_Name" name="resource_name" version="1.0" type="script"/> Then the "move_gate.lua" --create the gate local gate = createObject ( ObjID, Pos_X, Pos_Y, Pos_Z, Rot_X, Rot_Y, Rot_Z ) local state = 0 --this is the state, if 0 gate closed if 1 it's open function move() if state == 0 then --it's closed so open it moveObject ( gate, Time, New_X, New_Y, New_Z) --Time means how fast the object'ill be moved. state = state + 1 elseif state == 1 then --it's open so close it moveObject ( gate, Time,Old_X, Old_Y, Old_Z) state = state - 1 end end addCommandHandler("gate", move )--this one creates a command "/gate" wich'll start the move function This script is written by xScatta and also can be found in the forum here: https://forum.multitheftauto.com/viewtopic.php?f=91&t=63339&p=602320#p602320 and you should also start reading the wiki page because you can find all these stuff there. Thank you so much for help! Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 Of course you need meta you always need a meta file for a new resource.The meta.xml should look something like this: "Your_Name" name="resource_name" version="1.0" type="script"/> Then the "move_gate.lua" --create the gate local gate = createObject ( ObjID, Pos_X, Pos_Y, Pos_Z, Rot_X, Rot_Y, Rot_Z ) local state = 0 --this is the state, if 0 gate closed if 1 it's open function move() if state == 0 then --it's closed so open it moveObject ( gate, Time, New_X, New_Y, New_Z) --Time means how fast the object'ill be moved. state = state + 1 elseif state == 1 then --it's open so close it moveObject ( gate, Time,Old_X, Old_Y, Old_Z) state = state - 1 end end addCommandHandler("gate", move )--this one creates a command "/gate" wich'll start the move function This script is written by xScatta and also can be found in the forum here: https://forum.multitheftauto.com/viewtopic.php?f=91&t=63339&p=602320#p602320 and you should also start reading the wiki page because you can find all these stuff there. hmm get an error " couldnt find the Move.gate.lua " --create the gate local AdminGate = createObject ( 971, -504.7998046875, 2592.599609375, 56.200000762939, 0, 0, 90 ) local state = 0 --this is the state, if 0 gate closed if 1 it's open function move() if state == 0 then --it's closed so open it moveObject ( AdminGate, 2500, -504.79998779297, 2592.6000976563, 62.099998474121) --Time means how fast the object'ill be moved. state = state + 1 elseif state == 1 then --it's open so close it moveObject ( AdminGate, 2500, -504.7998046875, 2592.599609375, 56.200000762939,) state = state - 1 end end addCommandHandler("admin75", move )--this one creates a command "/gate" wich'll start the move function and the meta <meta> <info author="Don" name="AdminGate" version="1.0" type="script"/> <script src="move_gate.lua" type="server"/> </meta> what is the problem here? ;( Link to comment
motax Posted August 12, 2013 Share Posted August 12, 2013 Lua is case sensitive so maybe it's because the big M, but maybe because there is a "." and not a "_" int the move_gate.lua try using something easier, simpler name like gate.lua and also dont forget to change the name in the meta Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 Lua is case sensitive so maybe it's because the big M, but maybe because there is a "." and not a "_" int the move_gate.luatry using something easier, simpler name like gate.lua and also dont forget to change the name in the meta okay man i try do that! thanks for your help if it dont work i will tell you! ^^ Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 np, ok still not working ;/ you have any idee of it? Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 any error message? haha i find out how to fix it now is works! thanks man! thanks for use your time to help me very happy now! ^^ i did just have to copy the text inside Lua and make a new Lua save file and paste the text with the name in Meta! Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 any error message? the gate wont open ;/ i use the command but still nothing can you take a look on the lua i posted upstairs on the site and see for any problems? Link to comment
motax Posted August 12, 2013 Share Posted August 12, 2013 The problem is in here: moveObject ( AdminGate, 2500, -504.7998046875, 2592.599609375, 56.200000762939,) You dont need that comma in the end of the line Link to comment
donis123 Posted August 12, 2013 Author Share Posted August 12, 2013 The problem is in here: moveObject ( AdminGate, 2500, -504.7998046875, 2592.599609375, 56.200000762939,) You dont need that comma in the end of the line hmm okay but now its works but its a double gate now! X) hehe Link to comment
motax Posted August 12, 2013 Share Posted August 12, 2013 (edited) if AdminGate then destroyElement ( AdminGate ) end local AdminGate = createObject ( 971, -504.7998046875, 2592.599609375, 56.200000762939, 0, 0, 90 ) local state = 0 --this is the state, if 0 gate closed if 1 it's open function move() if state == 0 then --it's closed so open it moveObject ( AdminGate, 2500, -504.79998779297, 2592.6000976563, 62.099998474121) --Time means how fast the object'ill be moved. state = state + 1 elseif state == 1 then --it's open so close it moveObject ( AdminGate, 2500, -504.7998046875, 2592.599609375, 56.200000762939) state = state - 1 end end addCommandHandler("admin75", move )--this one creates a command "/gate" wich'll start the move function Edited August 12, 2013 by Guest Link to comment
antonhs35 Posted September 29, 2013 Share Posted September 29, 2013 How to open the gate Automatic????? Link to comment
Castillo Posted September 29, 2013 Share Posted September 29, 2013 By automatic you mean when you get close to the gate? if so, you can use colshapes: https://wiki.multitheftauto.com/wiki/Se ... _functions Link to comment
antonhs35 Posted September 29, 2013 Share Posted September 29, 2013 Yea When approaching the gate to open and when I go to close (Sorry i dont very good english)can you tell me to do more detailed And thanks for help Link to comment
antonhs35 Posted October 4, 2013 Share Posted October 4, 2013 I want when approaching the gate to open, and when I go to close.........And for all players I want to open the gate(Automatic)without I press a command... can someone help me???? more detail???? Link to comment
Castillo Posted October 4, 2013 Share Posted October 4, 2013 You must create a colshape around the gate, using one of the colshape functions. 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