How to.
#1

Instead of stairs for my interior im using elevators.
How do i make it so if the lift is moving, And someone says,
/elevator 1st - To make it goto the 1st flooor,
So how do i make it so if someone says that command while the lift is moving,
The lift will continue moving but send the person the following message:
The lift is currently moving please wait.
So when someone says the command while its not moving, It will move,
But if its already moving, It wont, Like real elevators, I know this is possible,
I can remember seeing it somewhere
Reply
#2

pawn Код:
// Defines
new LiftMoving;
new Lift;

// OnGameModeInit

Lift = CreateObject(blah, blah...);
LiftMoving == 0;

// OnPlayerCommandText

// The MoveObject and the whole command goes here.
if(LiftMoving == 1)
{
    SendClientMessage(playerid, COLOR_RED, "The lift is currently moving, please wait.");
}
else if(LiftMoving == 0)
{
    MoveObject(lift, coords, speed);
    LiftMoving == 1;
}

// OnObjectMoved

if(objectid = Lift)
{
    LiftMoving == 0;
    return 1;
}
Reply
#3

Quote:
Originally Posted by JoeDaDude
Instead of stairs for my interior im using elevators.
How do i make it so if the lift is moving, And someone says,
/elevator 1st - To make it goto the 1st flooor,
Use an array with the zcoords, cell zero being the ground floor and ascending upwards from this is each floors height:

pawn Код:
new
  Float:gElevatorFloors[ FLOORS_AMOUNT_HERE ] = { 3.0, 13.0, 23.0, 33.0, 43.0 /*and so on*/ };


//in the command (DCMD format)
MoveObject( ..................., gElevatorFloors[ strval( params ) ]..................... );
Something like that would work along with a few checks, IsNumeric, current floor (playerZ) etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)