kalitonchik Posted February 14, 2009 Share Posted February 14, 2009 help please I have many times tried to run these scripts, but without success and examples from the wiki do not work http://development.mtasa.com/index.php?title=MoveObject please help a fool createObject(id,posX,posY,posZ) moveObject( there i need set value to up and down +;-value_posZ ) hear command for object move speed ( in whot time fore exemple 5 sek ) this is my guess please help to run this script Link to comment
50p Posted February 14, 2009 Share Posted February 14, 2009 Show us what you tried. We're not going to do it for you because it's simple and sometimes I think you act a fool. Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 i whont create moving object script include tdma map this is my attemp function createObject( 3117, 2500, 450.5, 9.6 ) moveObject ( 5000, x, y, -2 / +2 ) end object dont spawn so he can moveXD whot i lost whot can i do? act a fool! Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 eror or '...' expected near '3117' Link to comment
Vivalavido Posted February 14, 2009 Share Posted February 14, 2009 i whont create moving object script include tdma mapthis is my attemp function createObject( 3117, 2500, 450.5, 9.6 ) moveObject ( 5000, x, y, -2 / +2 ) end object dont spawn so he can moveXD whot i lost whot can i do? act a fool! Lol, your doing the createObject in the function now? function createAndShowObject() myobject = createObject( 3117, 2500, 450.5, 9.6 ) moveObject ( myobject, 5000, x, y, -2 / +2 ) end addCommandHandler("showobject", createAndShowObject) Try that Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 eror at unexpected symbol near '+' so i deleted / +2 (to see whots hapens next) but now another eror ERROR: Couldn't packetize argument list, invalid element specified. Link to comment
Vivalavido Posted February 14, 2009 Share Posted February 14, 2009 eror atunexpected symbol near '+' so i deleted / +2 (to see whots hapens next) but now another eror ERROR: Couldn't packetize argument list, invalid element specified. function createAndShowObject() myobject = createObject( 3117, 2500, 450.5, 9.6 ) moveObject ( myobject, 5000, 2500, 450.5, 15 ) end addCommandHandler("showobject", createAndShowObject) This will move the object up. (Takes 5 seconds, as you can see, moveObject( myObject, 5000ms <--- )) Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 hm but whot you can tell about this?! ERROR: Couldn't packetize argument list, invalid element specified. ( object dont spawn ) Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 https://forum.multitheftauto.com/viewtop ... 00#p286500 similar topic Link to comment
Vivalavido Posted February 14, 2009 Share Posted February 14, 2009 hm but whot you can tell about this?!ERROR: Couldn't packetize argument list, invalid element specified. ( object dont spawn ) Alright. Lets do it this way then. function loadObjects() myobject = createObject( 3117, 2500, 450.5, 9.6 ) end addEventHandler("onResourceStart", getRootElement(), loadObjects) function moveObjects() moveObject ( myobject, 5000, 2500, 450.5, 15 ) end addCommandHandler("showobject", moveObjects) Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 You know, from this you can go crazy yes, now object are spawned, but dont move achtung Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 function loadObject() myobject = createObject( 3117, 2500, 480, 9.5 ) local 2500, 480, 10.5 local 12.5 = 10.5 + 2 moveObject ( object, 10000, 2500, 480, 12.5 ) end add(EventHandler ore CommandHandler) and ("onResourceStart", getRootElement(), loadObjects, moveObject)? Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 maby this is beter way? but how can get this work correctly Link to comment
Vivalavido Posted February 14, 2009 Share Posted February 14, 2009 function loadObjects() myobject = createObject( 3117, 2500, 450.5, 9.6 ) end addEventHandler("onResourceStart", getRootElement(), loadObjects) function moveObjects() moveObject(myobject, 5000, 2500, 450.5, 15 ) end addCommandHandler("showobject", moveObjects) There cant be anything wrong with it. Exept that your doing it clientsided, or you just dont know where the object is. I spawned an object on other X,Y,Z´s in my server. With this script. Worked like a charm. Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 function loadObjects() myobject = createObject( 3117, 2500, 480, 10.5 ) end addEventHandler("onResourceStart", getRootElement(), loadObjects) function moveObjects() local 2500, 480, 10.5, = getElementPosition ( object ) local 12.5 = 10.5 + 2 moveObject ( object, 5000, 2500, 480, 12.5 ) end addCommandHandler("showobject", moveObjects) donw work dont spawn object and eror '' expected near '2500' Link to comment
Vivalavido Posted February 14, 2009 Share Posted February 14, 2009 function loadObjects() myobject = createObject ( 1337, 5540.6654, 1020.55122, 1240.545, 90, 0, 0 ) end addEventHandler("onResourceStart", getRootElement(), loadObjects) function moveObjects() moveObject(myobject, 5000, 2500, 450.5, 15 ) end addCommandHandler("showobject", moveObjects) ¨ Ingame, go to the coordinateds 5540, 1020, 1240 Link to comment
kalitonchik Posted February 14, 2009 Author Share Posted February 14, 2009 see i am at that object but this one dont moveXD Link to comment
Vivalavido Posted February 14, 2009 Share Posted February 14, 2009 see i am at that object but this one dont moveXD You have to type /showobject you know? In the chatbox that is. Link to comment
kalitonchik Posted February 15, 2009 Author Share Posted February 15, 2009 yey its works i tuped /showobject Thanks, I appreciate your help Link to comment
kalitonchik Posted February 15, 2009 Author Share Posted February 15, 2009 how to make a automatically moving object ( whitsout presing /...) Link to comment
jkub Posted February 15, 2009 Share Posted February 15, 2009 local x, y, z = getElementPosition ( myObject ) use this instead. u said getELementPosition ( object ) ive looked through your code and "object" does not exist... u have to provie the specific object name in this case it is myObject U use getElementPosition to get the position. If u provide the numbers for the arguement like u did it would be more like setting the position I guess Link to comment
jkub Posted February 15, 2009 Share Posted February 15, 2009 as to making it move automaticly u might want to use some kind of event handler for it. I dont know what in the world this object is in this case. If it is a gate I would add a marker or colshape around it somewhere. But Its probably not Link to comment
kalitonchik Posted February 16, 2009 Author Share Posted February 16, 2009 I mean( moving object automatically and continuously ) I think this addEventHandler ( "onPlayerSpawn", Link to comment
jkub Posted February 16, 2009 Share Posted February 16, 2009 in that case set a timer inside the move object and btw if u want the object to move continuosly then why would u set a arrival location for it? 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