Angle of gate won't move
#1

Object won't move. It spawns, it loads perfectly, just not sure why the angle won't move.

The object is ID 968, but i don't know what's wrong:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, GateInfo[gate][gRange], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ]))
                {
                    if(GateInfo[gate][gModel] == 968)
                    {
                        if(GateInfo[gate][gStatus] == STATUS_GATE_CLOSED)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]+90, 7.0);
                            GateInfo[gate][gStatus] = STATUS_GATE_OPEN;
                        }
                        else if(GateInfo[gate][gStatus] == STATUS_GATE_OPEN)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]-90, 7.0);
                            GateInfo[gate][gStatus] = STATUS_GATE_CLOSED;
                        }
                    }
                    else
                    {
                        if(GateInfo[gate][gStatus] == STATUS_GATE_CLOSED)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]+90, 7.0);
                        }
                        else if(GateInfo[gate][gStatus] == STATUS_GATE_OPEN)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]-90, 7.0);
                        }
                    }
                }
Reply
#2

In order for MoveObject to work correctly, the object has to be moved, even if it's just by 0.001 units.
Reply
#3

Yeah, just looked it up on the wiki moments before you replied. Thanks anyhow!
Reply
#4

Still not moving the object, put +0.001 on the X axis and it's not working.
Reply
#5

Repost your code I know you will have issues with this...

MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]-90, 7.0);

You don't need -90 since it has to move to it's return position.
Reply
#6

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Repost your code I know you will have issues with this...

MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]-90, 7.0);

You don't need -90 since it has to move to it's return position.
Sorry I don't understand what you mean?

If you're looking for the code here it is:

pawn Код:
if(gate != -1)
            {
                if(IsPlayerInRangeOfPoint(playerid, GateInfo[gate][gRange], GateInfo[gate][gX], GateInfo[gate][gY], GateInfo[gate][gZ]))
                {
                    if(GateInfo[gate][gModel] == 968)
                    {
                        if(GateInfo[gate][gStatus] == STATUS_GATE_CLOSED)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX]+0.001, GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]+90, 7.0);
                            GateInfo[gate][gStatus] = STATUS_GATE_OPEN;
                        }
                        else if(GateInfo[gate][gStatus] == STATUS_GATE_OPEN)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX]-0.001, GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]-90, 7.0);
                            GateInfo[gate][gStatus] = STATUS_GATE_CLOSED;
                        }
                    }
                    else
                    {
                        if(GateInfo[gate][gStatus] == STATUS_GATE_CLOSED)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX]+0.001, GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]+90, 7.0);
                        }
                        else if(GateInfo[gate][gStatus] == STATUS_GATE_OPEN)
                        {
                            MoveDynamicObject(GateInfo[gate][gModel], GateInfo[gate][gX]-0.001, GateInfo[gate][gY], GateInfo[gate][gZ], GateInfo[gate][gRX], GateInfo[gate][gRY], GateInfo[gate][gRZ]-90, 7.0);
                        }
                    }
                }
            }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)