Way to detect object position while moving
#1

Hello.

There is no way to detect object position while moving right? (MoveObject)
Reply
#2

Wouldn't GetObjectPos return the object's position? I'm not sure if that would work while moving.
Reply
#3

Well there actaully is a way, you can do something like this
pawn Код:
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!");
}
}
Reply
#4

GetDynamicObjectPos i was talking about dynamic streamer plugin sorry.
Actually does not return the right position while the object is moving
Reply
#5

It might be a bug. It's better to report it to Incognito's thread.

PS: If it's about 1-2 objects, you can use CreateObject instead and try GetObjectPos to see if it works.
Reply
#6

Oh, sorry I realize that I'm wrong, but you can do something like this.
pawn Код:
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
}
}
Reply
#7

Man i know that thanks but that's not the problem.. the object seems to return back when using StopDynamicObject
Reply
#8

I know this from experience that the streamer performs very poorly when it comes to moving dynamic objects. I think your trying to get more out of it than it can do.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)