Movable Gates?
#5

Only one gate?
pawn Код:
public OnGameModeInit()
{
    new iGate,iGatePos; //Variables.
    iGate = CreateObject(11416,664.79998779297,1824,7.0999999046326,0,0,349.99145507813,10);
    iGatePos = 0; //Gate is closed.
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/open", cmdtext, true, 10) == 0) //Open command
    {
        if(iGatePos == 0) { //Checking if the gate is actually closed.
            MoveObject(iGate,664.70001220703,1824,11,2,0,0,349.99694824219); //Moving
            SendClientMessage(playerid,-1,"The gate has been opened.");
            iGatePos = 1; //Gate is opened.
        } else {
            SendClientMessage(playerid,-1,"The gate is already opened!");
        }
        return 1;
    }
    if (strcmp("/close", cmdtext, true, 10) == 0) //Close command
    {
        if(iGatePos == 1) { //Checking if the gate is actually closed.
            MoveObject(iGate,664.79998779297,1824,7.0999999046326,2,0,0,349.99145507813); //Moving
            SendClientMessage(playerid,-1,"The gate has been closed.");
            iGatePos = 0; //Gate is closed.
        } else {
            SendClientMessage(playerid,-1,"The gate is already closed!");
        }
        return 1;
    }
    return 0;
}
Then there you go.

EDIT: Corrected.
Reply


Messages In This Thread
Movable Gates? - by Gooday - 27.12.2011, 19:56
Re: Movable Gates? - by Seven_of_Nine - 27.12.2011, 20:04
Re: Movable Gates? - by Gooday - 27.12.2011, 20:34
Re: Movable Gates? - by kizla - 27.12.2011, 20:39
Re: Movable Gates? - by Seven_of_Nine - 27.12.2011, 20:40
Re: Movable Gates? - by Gooday - 27.12.2011, 20:46

Forum Jump:


Users browsing this thread: 1 Guest(s)