Gates Opened/Closed Command
#1

Код:
new HQGateOpen;
pawn Код:
if(strcmp(cmdtext,"/hqo", true) == 0)//Open
    {
      if(AdminLevel[playerid] >= 5)
      {
        MoveObject(HQgate, -505.77,2588.21,52.60,1.5000);
        format(gatestr, sizeof(gatestr), "%s Has Opened The Headquarter Gate", PlayerName);
        SendClientMessageToAll(COLOUR_GREY,gatestr);
        HQGateOpen = 1;
        return 1;
        }else{
        SendClientMessage(playerid,COLOUR_RED,"Only Andmins Can Open The Headquarter Gate!");
        }
    }
  if(strcmp(cmdtext,"/hqc", true) == 0)//Close
    {
      if(AdminLevel[playerid] >= 5)
      {
        MoveObject(HQgate, -505.91, 2597.04, 52.60, 1.5000);
        format(gatestr, sizeof(gatestr), "%s Has Closed The Headquarter Gate", PlayerName);
        SendClientMessageToAll(COLOUR_GREY,gatestr);
        HQGateOpen = 0;
        return 1;
        }else{
        SendClientMessage(playerid,COLOUR_RED,"Only Andmins Can Close The Headquarter Gate!");
        }
    }
//------------------------------------------------------------------------------
  if(strcmp(cmdtext,"/gates", true) == 0)//Is it open or closed
    {
      if (HQGateOpen == 0)
      {
        SendClientMessage(playerid, COLOUR_GREY,"The Headquarter Gate Is CLOSED");
        }else{
        SendClientMessage(playerid, COLOUR_GREY,"The Headquarter Gate Is OPEN");
//--------------------------------------
        if (MainGateOpen == 0)
      {
        SendClientMessage(playerid, COLOUR_GREY,"The Main Gatea Are CLOSED");
        }else{
        SendClientMessage(playerid, COLOUR_GREY,"The Main Gates Are OPEN");
        return 1;
        }
    }
}
It gives SERVER:Unknown Command when the HQ gates are closed and depending on wherther the gates are open it somwtimes wont even say if its closed or open. I think it has something to do with returns but it looks fine to me.
Reply


Messages In This Thread
Gates Opened/Closed Command - by Alec24 - 06.04.2009, 15:41
Re: Gates Opened/Closed Command - by REDRUM - 17.04.2009, 19:35
Re: Gates Opened/Closed Command - by Rks25 - 17.04.2009, 19:44

Forum Jump:


Users browsing this thread: 1 Guest(s)