Jump to content

Moving objects


Recommended Posts

Posted

BUMP

I also want to know that :)

If please someone can take the time, I know how to add a lua script, but giving an example script with a bit of information would be pleased :mrgreen:

Posted

You can create a Serverside Script with the "moveObject" Function.

https://wiki.multitheftauto.com/wiki/MoveObject

But i think theres a Way to move Objects without creating a Script,

i´ve seen a Tutorial before but i dont remember where :?

Heres a Video for rotation Objects

http://www.xiii-mta.nl/index.php?topic=1228.0

Stats_Signature.php?name=Jason_Gregory
Contact me if you need a Website / Signature ↑ / Mapuploadsystem

(HTML5, JS, PHP, ASP.NET, MySQL / Sybase)

Posted

So I only have to include a script in the .zip

So Questions:

How is it called when my map is called i.e. "race-LukkieMap"

How would the script be when I have 2 objects to rotate?

I only have to enter

bool moveObject ( object theObject, int time, float targetx, float targety, float targetz)

and make it to

bool moveObject ( object <object name>, int 2000, float 500, float 800, float 70)

or simply

moveObject (<object name>, 2000, 500, 800, 70)

and nothing above or under it?

And does it return automatically?

Too many questions I know but I really want to know it :D

Posted

last one

you have to create object via script, or at least get your object from the game, which probably be harder to do for you..

and if you need object moving more than once, you need few lines of script, not just once..

search, there was another topic like that few days ago

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted (edited)

I guess this will work

Only I still need an interval to make a life return.

Objectname123 = createObject(3458, -2464.9296875, 1522.9167480459, 6.1990437507629)
moveObject(Objectname123, 4000, -2464.9296875, 1522.9167480469, 27.570457458496) 
end

Edited by Guest
Posted

get MTA Script Editor, it will catch some of your errors (syntax errors)..

in that 3 lines script, "end" is not needed..

you shold "end" loops, functions, etc

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Is this the right code?

function ClientStarted ()
setSkyGradient( 255, 0, 0, 255, 0, 0)
end
 
function ObjectsRotateStart ()
moveObject(rotate1, 10000, -4475.867188, -2251.131836, 494.547363, 0, 180, 0)
moveObject(rotate2, 10000, -4475.867188, -2251.131836, 494.547363, 0, 180, 0)
end
 
setTimer(ObjectsRotateStart, 10000, 0)
 
 
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), ClientStarted )
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), ObjectsRotateStart )

2 objects with the id rotate1 and rotate2 will be rotating 360 degrees in 20 seconds; right?

Posted

if rotate1 and rotate1 is defined, all should be ok, i didnt test it, did you? just test it:)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

test it without editor

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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...