Gate automatically closes
#2

here is an Example:
pawn Код:
//Top of script
forward objTimer();
new obj, objstatus = 1;


public OnGameModeInit()
{
    obj = CreateObject(objid, X, Y, Z, rX, rY, rZ);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/gate", true) == 0)
    {
        if(objstatus = 1)
        {
            MoveObject(obj, newX, newY, newZ);
            objstatus = 0;
        }
        SetTimer("objTimer", 5000, false);//5000 = 5 seconds
        return 1;
    }
    return 1;
}

public objTimer()
{
    if(objstatus == 0)
    {
        MoveObject(objID, oldX, oldY, oldZ);
        objstatus = 1;
    }
    return 1;
}
This should work, Hope you under stand this

newX/Y/Z = where to move
oldX/Y/Z = Original location to move back the opbject
Reply


Messages In This Thread
Gate automatically closes - by karla - 20.03.2009, 15:43
Re: Gate automatically closes - by Castle - 20.03.2009, 15:57
Re: Gate automatically closes - by karla - 20.03.2009, 16:03
Re: Gate automatically closes - by Castle - 20.03.2009, 16:12
Re: Gate automatically closes - by karla - 20.03.2009, 22:34
Re: Gate automatically closes - by Castle - 20.03.2009, 22:42

Forum Jump:


Users browsing this thread: 1 Guest(s)