Dynamic Objects won't move
#1

The doors aren't moving.

Anyone see what the error is? And the doors are indeed defined.

pawn Код:
bcpddoor1 = CreateDynamicObject(1495, 755.86792, -1400.87695, 3000.06006,   0.00000, 0.00000, 180.00000);

        bcpddoor2 = CreateDynamicObject(1495, 752.59412, -1400.57556, 3000.06006,   0.00000, 0.00000, 180.00000);

        bcpddoor3 = CreateDynamicObject(1495, 747.84210, -1400.22693, 3000.06006,   0.00000, 0.00000, 90.00000);
pawn Код:
command(door, playerid, params[])
    {
        if(Player[playerid][Faction] == 1)
        {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, 755.86792, -1400.87695, 3000.06006))
            {
                if(bcpd1 == 1)
                {
                    MoveDynamicObject(bcpddoor1, 755.86792, -1400.87695, 3000.06006, 2.5, 0.00000, 0.00000, 180.00000);
                    bcpddoor1 = 0;
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 5.0, 752.59412, -1400.57556, 3000.06006))
            {
                if(bcpd2 == 1)
                {
                    MoveDynamicObject(bcpddoor2, 752.59412, -1400.57556, 3000.06006,   0.00000, 0.00000, 180.00000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 5.0, 747.84210, -1400.22693, 3000.06006))
            {
                if(bcpd3 == 1)
                {
                    MoveDynamicObject(bcpddoor3, 747.84210, -1400.22693, 3000.06006,   0.00000, 0.00000, 90.00000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 5.0, 755.86792, -1400.87695, 3000.06006))
            {
                if(bcpd1 == 0)
                {
                    MoveDynamicObject(bcpddoor1, 755.86792, -1400.87695, 3000.06006,   0.00000, 0.00000, -90.00000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 5.0, 752.59412, -1400.57556, 3000.06006))
            {
                if(bcpd2 == 0)
                {
                    MoveDynamicObject(bcpddoor2, 752.59412, -1400.57556, 3000.06006,   0.00000, 0.00000, -90.00000);
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 5.0, 747.84210, -1400.22693, 3000.06006))
            {
                if(bcpd3 == 0)
                {
                    MoveDynamicObject(bcpddoor3, 747.84210, -1400.22693, 3000.06006,   0.00000, 0.00000, 180.00000);
                }
            }
            else return SendClientMessage(playerid, GREY, "You are not in range of any doors you can open.");
        }
        else return SendClientMessage(playerid, GREY, FactionOnly);
        return 1;
    }
And yeah, it doesn't say that I am not in range of any, so that's not the problem neither.
Reply
#2

Well, something I've noticed, is you are not setting the value for "bcpd1" and similar values when they open. Wouldn't hurt to try it and use the commands more than once. Also make an else if, for it the door is open, so it can close.
Reply
#3

I forgot to add a timing for the moving objects, can that be the issue? :3 Look at all the spaces in the MoveDynamicObjects
Reply
#4

why are you setting
pawn Код:
bcpddoor1 = 0;
when you have it defined as the object
pawn Код:
bcpddoor1 = CreateDynamicObject(1495, 755.86792, -1400.87695, 3000.06006,   0.00000, 0.00000, 180.00000);
I would imagine this could cause an issue.

I think you ment
pawn Код:
bcpd1 = 0;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)