MoveObject bug
#1

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...

Код:
new obj;
Код:
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:
Reply
#2

the MoveObject takes absolute coordinates, not relative:
Код:
new movetime = MoveObject(obj, 2492.6999, 2773, 15.3000, 2.00);//changed 9 to 15 units altitude
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)