25.09.2013, 17:13
Hello.
There is no way to detect object position while moving right? (MoveObject)
There is no way to detect object position while moving right? (MoveObject)
new object123;
new Float:ObjX;
new Float:ObjY;
new Float:ObjZ;
//Under a cmd or something
object123= CreateObject(blabla
GetObjectPos(object123, ObjX,ObjY,ObjZ);
SetTimer("ObjectMoved",1000,true);
//
forward ObjectMoved;
public ObjectMoved
{
new Float:X,Float:Y,Float:Z;
GetObjectPos(object123, X,Y,Z);
if(X == ObjX && Y == ObjY && Z == ObjZ)
{
return 1;
}
else
{
SendClientMessage(playerid, -1,"Object moved!");
}
}
new Float:ObjmoveX;
new Float:ObjmoveY;
new Float:ObjmoveZ;
forward ObjectMoved;
public ObjectMoved
{
new Float:X,Float:Y,Float:Z;
GetDynamicObjectPos(object123, X,Y,Z);
if(X == ObjX && Y == ObjY && Z == ObjZ)
{
return 1;
}
else
{
//This should show the current position of the object while it's moving
GetDynamicObjectPos(object123, ObjmoveX, ObjmoveY,ObjmoveZ);
format(string,sizeof(string),"The current object pos is f%, f%,f&",ObjmoveX,ObjmoveY,ObjmoveZ);
SendClientMessageToAll(string, -1);
//Here you can kill the timer or something
}
}