26.07.2012, 10:03
how can i make a object moving up and down continuosly without anyones presence or using cmds?
It should move randomly.
How to script? anyone plz help
It should move randomly.
How to script? anyone plz help
new object; // Save here your object
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, object)
{
MoveObject(object, /*coordinates*/); // Coordinates for gate UP
}
else
{
MoveObject(object, /*coordinates*/); // Coordinates for gate DOWN
}
}
Not like that as i told above i want it to move the objects without anyone's interference.Like moving up and down continuously.
|
// Top
new
theObject;
// Gamemode Init
theObject = CreateObject(...);
MoveObject(theObject, ...);
// Anywhere else
forward @MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed);
@MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed) return MoveObject(objectid, X, Y, Z, Speed);
public OnObjectMoved(objectid)
{
new rand = 1000 * random(10); // how many seconds between moving? (10)
SetTimerEx("@MoveObject", rand, 0, "dffff", objectid, /* insert x, y, z */, 3.0);
return 1;
}
CreateObject(3865, -2712.88, 583.54, 16.30, 0.00, 0.00, 270.01); //down
CreateObject(3865, -2712.88, 583.54, 34.95, 0.00, 0.00, 270.01);//up