Restricting a command to a faction.
#1

pawn Код:
CMD:chiefdoor(playerid, params[])
{
  if(PlayerInfo[playerid][pFaction] == 1) || PlayerInfo[playerid][pFaction] == 10) {
    if(ChiefStatus == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 222.2000000,69.1000000,1004.0000000))
        {
            MoveObject(ChiefOffice, 222.2000000,67.3000000,1004.0000000, 5);
            SendClientMessage(playerid, 0xEF994300, "The door is opening!");
            ChiefStatus = 1;
        }
        else
        {
            SendClientMessage(playerid, 0xEF994300, "You are not in range of the door / are not in the LSPD or SASD!");
        }
    }
    else if(ChiefStatus == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 222.2000000,69.1000000,1004.0000000))
        {
            MoveObject(ChiefOffice,  222.2000000,69.1000000,1004.0000000, 5);
            SendClientMessage(playerid, 0xEF994300, "The door is closing!");
            ChiefStatus = 0;
        }
        else
        {
            SendClientMessage(playerid, 0xEF994300, "You are not in range of a door!");
        }
    }
    return 1;
    }
It's got errors - creates random ones irrelevant to the code.

What's wrong with it?
Reply


Messages In This Thread
Restricting a command to a faction. [+REP] - by Jing_Chan - 01.01.2014, 20:11
Re: Restricting a command to a faction. - by Jing_Chan - 01.01.2014, 22:08
Re: Restricting a command to a faction. - by Scrillex - 01.01.2014, 22:42
Re: Restricting a command to a faction. - by Jing_Chan - 01.01.2014, 22:52
Re: Restricting a command to a faction. - by EiresJason - 01.01.2014, 22:59
Re: Restricting a command to a faction. - by Jing_Chan - 01.01.2014, 23:00
Re: Restricting a command to a faction. - by EiresJason - 01.01.2014, 23:03
Re: Restricting a command to a faction. - by Jing_Chan - 01.01.2014, 23:05
Re: Restricting a command to a faction. - by EiresJason - 01.01.2014, 23:08
Re: Restricting a command to a faction. - by Jing_Chan - 01.01.2014, 23:26

Forum Jump:


Users browsing this thread: 1 Guest(s)