Moving objects
#1

Hello!

I don't have single idea how I should make Moving objects, I know how to make single movable objects like doors and so on but a thing I want to make is object that is moving left and right non stop, how should I make this ?
Reply
#2

timers and moving objects, onobjectmoved many choices really
Reply
#3

Uhh maybe example code ?
Reply
#4

Anyone ? :/
Reply
#5

My script for example...
pawn Код:
new Garagedoor1;
new Gatetime;
Garagedoor1 = CreateObject(16773, 914.78003, 872.05969, 16.29810,   0.00000, 0.00000, 90.00000);


==============================================================
Gatetime = MoveObject(Garagedoor1, 914.78003, 872.05969, 8.3654, 3.00);
SetTimer("GateClose", Gatetime, 0);
pawn Код:
forward GateClose(playerid);
public GateClose(playerid)
{
    MoveObject(Garagedoor1, 914.78003, 872.05969, 16.29810, 3.00);
    return 1;
}

This opens, and closes as soon as it opens all the way... What exactly do you need? I can script it bro.
Reply
#6

From what i see, you want an object to start moving as soon as your script is loaded, and not stop moving, and it will move left to right to left and so on, non-stop...


pawn Код:
new Garagedoor1;
Garagedoor1 = CreateObject(16773, 914.78003, 872.05969, 16.29810,   0.00000, 0.00000, 90.00000);
new Gatetime;
pawn Код:
CMD:movegate(playerid, params[])
{
Gatetime = MoveObject(Garagedoor1, 914.78003, 872.05969, 8.3654, 3.00);
SetTimer("GateClose", Gatetime, 0);
return1;
}
pawn Код:
forward GateClose(playerid);
forward GateOpen(playerid);
public GateClose(playerid)
{
MoveObject(Garagedoor1, 914.78003, 872.05969, 8.3654, 3.00);
SetTimer("GateOpen", Gatetime, 0);
return 1;
}
public GateOpen(playerid)
{
MoveObject(Garagedoor1, 914.78003, 872.05969, 16.29810, 3.00);
SetTimer("GateClose", Gatetime, 0);
return 1;
}
This the modified version of my code, it will continuously move a garage door up and down in my server, I dont know if this is what you wanted but this works, and you can call the command anyway you want...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)