move object wiht command then auto move back
#8

Aa ok. Here you go, try this:
pawn Code:
forward CloseGate();

CMD:gate(playerid, params[])
{
    if(INI_Open(getINI(playerid))) {
        PlayerInfo[playerid][Faction] = INI_ReadInt("Faction");
        PlayerInfo[playerid][Factionrank] = INI_ReadInt("Factionrank");
    }

    if(PlayerInfo[playerid][Faction] == LSPD) {
                                                  //Any rank
        if(PlayerInfo[playerid][Factionrank] > 0) {
            if(!isnull(params)) {
                return SendClientMessage(playerid,SYellow,"Usage: /gate.");
            }
            else {

                if(IsPlayerInRangeOfPoint(playerid, 10.0, 1588.90, -1637.94, 16.00)) {
                    SendClientMessage(playerid,SYellow,"The Lspd Garage gate is now opening.");
                    SetTimer("CloseGate", 10000, false);
                    return MoveObject(lspdgaragegate, 1596.90, -1637.94, 16.00, 6.0);
                }
                else {
                    return SendClientMessage(playerid,SYellow,"You must be near the gate to use this.");
                }

            }
        }
        return SendClientMessage(playerid,SYellow,"You must be atlest rank 1 LSPD to use this.");
    }                                             //RANK 1 END
    else return SendClientMessage(playerid,SYellow,"You must be LSPD to use that command.");
}


public CloseGate()
{
    MoveObject(lspdgaragegate, x, y, z, 6.0); // Change x, y, z to the coordinates of the gate closed.
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)