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
#2

Код:
C:\Documents and Settings\Eric\Desktop\REDRUM~1.PWN(8676) : error 017: undefined symbol "AdminLevel"
C:\Documents and Settings\Eric\Desktop\REDRUM~1.PWN(8676) : warning 215: expression has no effect
C:\Documents and Settings\Eric\Desktop\REDRUM~1.PWN(8676) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Eric\Desktop\REDRUM~1.PWN(8676) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Eric\Desktop\REDRUM~1.PWN(8676) : fatal error 107: too many error messages on one line
whats wrong?
Reply
#3

you are using a variable which isn't defined, which admin fs are you using?

or a better question in this case, are you using one?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)