OnObjectMoved problem
#1

Hi,

I am working on my own FilterScript of the LS Elevator and I have a question about the public OnObjectMoved(objectid)

This is what I have:
Quote:

if(ElevatorState == ELEVATOR_STATE_IDLE)
{
if(floor == 0)
{
SendClientMessage( playerid, WHITE, "You selected the Ground Floor" );
MoveDynamicObject(Elevator, 1786.678100, -1303.459472, 14.551476, 5);
ElevatorState = ELEVATOR_STATE_MOVING;
return 1;
}

This is for going to floor 0 wich is the street level.
For the first floor i have this:
Quote:

if(floor == 1)
{
SendClientMessage( playerid, WHITE, "You selected the 1st Floor" );
MoveDynamicObject(Elevator, 1786.678100, -1303.459472, 23.059376, 5);
ElevatorState = ELEVATOR_STATE_MOVING;
return 1;
}

as public I have this:
Quote:

public OnObjectMoved(objectid)
{
if(objectid == Elevator)
{
ElevatorState = ELEVATOR_STATE_IDLE;
return 1;
}
return 1;
}

When I test this out In-Game it keeps saying "Elevator is already moving. Wait a few seconds" this message is triggered when the elevator is moving:
Quote:

else
{
SendClientMessage(playerid, WHITE, "Elevator is already moving. Wait a few Seconds");
return 1;
}

(else is for if(ElevatorState = ELEVATOR_STATE_IDLE)

Can anyone help me with resolving this problem? Because what i'm trying to do is to have ELEVATOR_STATE_MOVING when it moves and ELEVATOR_STATE_IDLE when it is Idle (when it stopped moving).

Fixed. We got the original lselevator working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)