SA-MP Forums Archive
Gates Opened/Closed Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gates Opened/Closed Command (/showthread.php?tid=72146)



Gates Opened/Closed Command - Alec24 - 06.04.2009

Код:
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.


Re: Gates Opened/Closed Command - REDRUM - 17.04.2009

Код:
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?


Re: Gates Opened/Closed Command - Rks25 - 17.04.2009

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?