Help me please !
#1

How does my pawno code must look so the LSP gates can be opened by everybody not only by cops !?

Here's the actual pawno code
Код:
	if (strcmp(cmd, "/open", true) ==0)
	{
		if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
		{
		  new Float:gatex, Float:gatey, Float:gatez;
		  if(city == 1)
		  {
		    gatex = 1539.709717;
				gatey = -1627.873047;
				gatez = 14.057503;
		  }
		  if(city == 2)
		  {
		    gatex = -1571.661133;
				gatey = 665.627869;
				gatez = 6.354377;
		  }
			if(PlayerToPoint(25, playerid, gatex, gatey, gatez))
			{
				OpenPoliceDepartmentGate();
				SetTimer("ClosePoliceDepartmentGate", 7500, false);
				SendClientMessage(playerid, COLOR_YELLOW,"You have successfully opened this gate.");
				return 1;
			}
			if(PlayerToPoint(25, playerid, -1701.720825, 680.697083, 24.057503))
			{
				OpenPoliceDepartmentGate2();
				SetTimer("ClosePoliceDepartmentGate2", 7500, false);
				SendClientMessage(playerid, COLOR_YELLOW,"You have successfully opened this gate.");
				return 1;
			}
			else
 			{
 				SendClientMessage(playerid, COLOR_RED,"You are not at a gate. Try closer if you are.");
 			}
		}
		else
 		{
 		  SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops or army team.");
 		}
		return 1;
 	}

	if (strcmp(cmd, "/close", true) ==0)
	{
 	if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
		{
		  new Float:gatex, Float:gatey, Float:gatez;
		  if(city == 1)
		  {
		    gatex = 1539.709717;
				gatey = -1627.873047;
				gatez = 14.057503;
		  }
		  if(city == 2)
		  {
		    gatex = -1571.661133;
				gatey = 665.627869;
				gatez = 6.354377;
		  }
			if(PlayerToPoint(25, playerid, gatex, gatey, gatez))
			{
				ClosePoliceDepartmentGate();
				SendClientMessage(playerid, COLOR_YELLOW,"You have successfully closed this gate.");
				return 1;
			}
			if(PlayerToPoint(25, playerid, -1701.720825, 680.697083, 24.057503))
			{
				ClosePoliceDepartmentGate2();
				SendClientMessage(playerid, COLOR_YELLOW,"You have successfully closed this gate.");
				return 1;
			}
			else
 			{
 				SendClientMessage(playerid, COLOR_RED,"You are not at a gate. Try closer if you are.");
 			}
		}
		else
 		{
 			SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops or army team.");
 		}
		return 1;
	}
Reply
#2

Код:
 	if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
		{
remove this line
Reply
#3

pawn Код:
if (strcmp(cmd, "/open", true) ==0)
    {
        if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2) // Remove
        { // Remove
          new Float:gatex, Float:gatey, Float:gatez;
          if(city == 1)
          {
            gatex = 1539.709717;
                gatey = -1627.873047;
                gatez = 14.057503;
          }
          if(city == 2)
          {
            gatex = -1571.661133;
                gatey = 665.627869;
                gatez = 6.354377;
          }
            if(PlayerToPoint(25, playerid, gatex, gatey, gatez))
            {
                OpenPoliceDepartmentGate();
                SetTimer("ClosePoliceDepartmentGate", 7500, false);
                SendClientMessage(playerid, COLOR_YELLOW,"You have successfully opened this gate.");
                return 1;
            }
            if(PlayerToPoint(25, playerid, -1701.720825, 680.697083, 24.057503))
            {
                OpenPoliceDepartmentGate2();
                SetTimer("ClosePoliceDepartmentGate2", 7500, false);
                SendClientMessage(playerid, COLOR_YELLOW,"You have successfully opened this gate.");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED,"You are not at a gate. Try closer if you are.");
            }
        }
        else
        {
          SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops or army team.");
        }
        return 1;
    }

    if (strcmp(cmd, "/close", true) ==0)
    {
    if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
        {
          new Float:gatex, Float:gatey, Float:gatez;
          if(city == 1)
          {
            gatex = 1539.709717;
                gatey = -1627.873047;
                gatez = 14.057503;
          }
          if(city == 2)
          {
            gatex = -1571.661133;
                gatey = 665.627869;
                gatez = 6.354377;
          }
            if(PlayerToPoint(25, playerid, gatex, gatey, gatez))
            {
                ClosePoliceDepartmentGate();
                SendClientMessage(playerid, COLOR_YELLOW,"You have successfully closed this gate.");
                return 1;
            }
            if(PlayerToPoint(25, playerid, -1701.720825, 680.697083, 24.057503))
            {
                ClosePoliceDepartmentGate2();
                SendClientMessage(playerid, COLOR_YELLOW,"You have successfully closed this gate.");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED,"You are not at a gate. Try closer if you are.");
            }
        }
        else // Remove
        { // Remove
            SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops or army team."); // Remove
        } // Remove
        return 1;
    }
Remove the lines that I marked with // Remove
Reply
#4

Quote:
Originally Posted by _Saif_
Код:
 	if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
		{
remove this line
Forgot one thing there
Reply
#5

Thanks , but i removed all i want to make those gates from 0 .
Reply
#6

Quote:
Originally Posted by Kirchhoff
Thanks , but i removed all i want to make those gates from 0 .
Great Idea.
It isn't as hard as it might look like
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)