MoveObject bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MoveObject bug (
/showthread.php?tid=291051)
MoveObject bug -
Artie_Scorpion - 18.10.2011
Hi I have one problem. I did everything ok, but my object is moving not right. I'm using 0.3c, but when full 0.3b version will be realesed, then ill use 0.3d...
Код:
obj = CreateObject(3095, 2492.6999511719, 2773, 9.3000001907349, 0.0, 0.0, 0.0);
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/moveobject", true) == 0)
{
new string[50];
new movetime = MoveObject(obj, 1, 1, 3, 2.00);
format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
return 0;
}
I changed move distansion (X,Y,Z) but object moving in same wrong distansion. Ex. photo:
Re: MoveObject bug -
Babul - 18.10.2011
the MoveObject takes absolute coordinates, not relative:
Код:
new movetime = MoveObject(obj, 2492.6999, 2773, 15.3000, 2.00);//changed 9 to 15 units altitude
Re: MoveObject bug -
KingHual - 18.10.2011
Try:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/moveobject", true) == 0)
{
new string[50];
new Float:X, Float:Y, Float:Z;
GetObjectPos(obj, X, Y, Z);
new movetime = MoveObject(obj, X + 1, Y + 1, Z + 3, 2.00);
format(string, sizeof(string), "Object will finish moving in %d milliseconds", movetime);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
return 0;
}
The "Object will finish moving in ... seconds" won't be correct though. But this thread is about the object not showing up after all.