Move Object problem
#1

I have a problem with move object. Everything else works, the messages are show and animations are applied like it should to but the objects don't move.

I use Incognito's Streamer.

OnPlayerKeyStateChange
pawn Код:
if(newkeys & 16)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.0, 266.8070,79.8379,1001.0391)){
            ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
            // FACTION CHECK HERE !
            if(!pddooropen[0]){
                MoveObject(pddoor[0], 266.30, 83.97, 1001.27, 2, 0, 0, 270);
                pddooropen[0] = true;
                return PlayerActionMsg(playerid, "opens the cell gate");
            }
            MoveObject(pddoor[0], 266.31, 82.97, 1001.27, 2, 0, 0, 270);
            pddooropen[0] = false;
            return PlayerActionMsg(playerid, "closes the cell gate");
        }
        if(IsPlayerInRangeOfPoint(playerid, 1.0, 266.37, 84.35, 1001.57)){
            ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
            // FACTION CHECK HERE !
            if(!pddooropen[1]){
                MoveObject(pddoor[0], 266.30, 79.50, 1001.27, 1.5, 0, 0, 270);
                pddooropen[1] = true;
                return PlayerActionMsg(playerid, "opens the cell gate");
            }
            MoveObject(pddoor[01], 266.31, 82.97, 1001.27, 1.5, 0, 0, 270);
            pddooropen[1] = false;
            return PlayerActionMsg(playerid, "closes the cell gate");
        }
        if(IsPlayerInRangeOfPoint(playerid, 1.0, 266.36, 88.59, 1001.57)){
            ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
            // FACTION CHECK HERE !
            if(!pddooropen[2]){
                MoveObject(pddoor[2], 266.29, 84.79, 1001.27, 1.5, 0, 0, 270);
                pddooropen[2] = true;
                return PlayerActionMsg(playerid, "opens the cell gate");
            }
            MoveObject(pddoor[2], 266.31, 87.47, 1001.27, 1.5, 0, 0, 270);
            pddooropen[2] = false;
            return PlayerActionMsg(playerid, "closes the cell gate");
        }
    }
OnFilterScriptInit
pawn Код:
// SD Cells
    pddoor[0] = CreateDynamicObject(19302, 266.31, 82.97, 1001.27,   0.00, 0.00, 270.00, -1, -1, -1, 50); // door 1
    //Opened: 266.30, 83.97, 1001.27
    pddoor[1] = CreateDynamicObject(19302, 266.29, 78.47, 1001.27,   0.00, 0.00, 270.00, -1, -1, -1, 50); // door 2
    //Opened:266.30, 79.50, 1001.27
    pddoor[2] = CreateDynamicObject(19302, 266.31, 87.47, 1001.27,   0.00, 0.00, 270.00, -1, -1, -1, 50); // door 3
    //Opened: 266.29, 84.79, 1001.27
on top of the FS
pawn Код:
new pddoor[3]; // 0 - cell1 1 - cell2 2 - cell3
new bool:pddooropen[3];
What am I doing wrong here?
Reply
#2

Use:
pawn Код:
MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed);
Not:
pawn Код:
MoveObject(//blah blah
See if that helps.
Reply
#3

pawn Код:
MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed);
Stigg beat me to it!
Reply
#4

Well it works but the rotation is messed up :/
Reply
#5

Quote:
Originally Posted by Outcast
Посмотреть сообщение
Well it works but the rotation is messed up :/
Ensure your coordinates are correct for where you are moving to. Even if you are 100% sure, check again.
Reply
#6

MoveDynamicObject doesn't have the RotX, Y, Z option, and it sets it to 0, instead of 270 as I set it. :/
Reply
#7

Quote:
Originally Posted by Outcast
Посмотреть сообщение
MoveDynamicObject doesn't have the RotX, Y, Z option, and it sets it to 0, instead of 270 as I set it. :/
pawn Код:
GetDynamicObjectRot(objectid, Float:rx, Float:ry, Float:rz);
SetDynamicObjectRot(objectid, Float:rx, Float:ry, Float:rz);
- Does this help? (I know it might look bad, depends how much rotating you are doing?)
Reply
#8

I think I'll leave those three objects out of the streamer, won't cause much problems.
Reply
#9

Quote:
Originally Posted by Outcast
Посмотреть сообщение
I think I'll leave those three objects out of the streamer, won't cause much problems.
I used to do this when I used MidoStream on 0.2, probably the best idea
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)