Jump to content

Problem with moveObject


X-Tornado

Recommended Posts

Posted

I did this script but my object didn't move qhen i type the command : /abrirbase . What's the problem?

puertabase = createObject ( 2933, 2463.39, -1659.11, 14.0203, 0, 0, 270.675 ) 
function puertabaseopen() 
moveObject ( puertabase, 5000, 2463.26, -1650.36, 14.0203 ) 
addCommandHandler ( "abrirbase", puertabaseopen ) 
end 

Sorry for my english. I'm Spanish.

Posted

The problem is pretty easy, it's just a little hard to get this in the start.

You're saying to the computer: When function "puertabaseopen" is executed, then move object "puertabase" and add command "abrirbase"

You need the command to execute, while you're creating the command while it's executed. Confusing isn't it? :P

Solution is simple though:

puertabase = createObject ( 2933, 2463.39, -1659.11, 14.0203, 0, 0, 270.675 ) -- Object is being created 
function puertabaseopen() -- Function is being created 
    moveObject ( puertabase, 5000, 2463.26, -1650.36, 14.0203 ) 
end 
addCommandHandler ( "abrirbase", puertabaseopen ) -- Execute function puertabaseopen when "/abrirbase" has been typed 

I hope that should make it a little easier to understand. ;)

Posted (edited)

Thanks. Now it works ;)

Now, How can i make the time speed normal?. i changed the game time with the local time but the time go too quickly

Edited by Guest
Posted

Time speed can be set in MTA 1.0, not in DP2.x yet. You'll have to wait for it.

Or well, you can also set a 1 second forever looping timer which sets the time to what it's supposed to be, but the weather will generally mess up.

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