SetPlayerTeam bug
#2

pawn Код:
if(strcmp(cmdtext, "/changeaztecas", true) == 0)
  {
        if(gTeam[playerid] == TEAM_GROVE || gTeam[playerid] == TEAM_BALLAS || gTeam[playerid] == TEAM_COP)
    {
      SetPlayerTeam(playerid, 5);
      return 1;
    }
  }
  if(strcmp(cmdtext, "/changecops", true) == 0)
  {
        if(gTeam[playerid] == TEAM_GROVE || gTeam[playerid] == TEAM_BALLAS)
    {
      SetPlayerTeam(playerid, 3);
      return 1;
    }
  }
  if(strcmp(cmdtext, "/changeballas", true) == 0)
  {
        if(gTeam[playerid] == TEAM_GROVE || gTeam[playerid] == TEAM_COP)
    {
      SetPlayerTeam(playerid, 2);
      return 1;
    }
  }
  if(strcmp(cmdtext, "/changeitalian", true) == 0)
  {
        if(gTeam[playerid] == TEAM_GROVE || gTeam[playerid] == TEAM_BALLAS || gTeam[playerid] == TEAM_COP)
    {
      SetPlayerTeam(playerid, 4);
      return 1;
    }
  }
  if(strcmp(cmdtext, "/changegrove", true) == 0)
  {
        if(gTeam[playerid] == TEAM_BALLAS || gTeam[playerid] == TEAM_COP)
    {
      SetPlayerTeam(playerid, 1);
      return 1;
    }
  }
Ok should work, you have more than one instance of the same command, you only need one, you can place more than one check in one if() statement using the "||" "&&" thingies.
Reply


Messages In This Thread
SetPlayerTeam bug - by adytzu32 - 10.04.2010, 16:22
Re: SetPlayerTeam bug - by Joe_ - 10.04.2010, 16:29
Re: SetPlayerTeam bug - by adytzu32 - 10.04.2010, 16:39
Re: SetPlayerTeam bug - by Torran - 10.04.2010, 16:46
Re: SetPlayerTeam bug - by adytzu32 - 10.04.2010, 16:51
Re: SetPlayerTeam bug - by Torran - 10.04.2010, 16:57

Forum Jump:


Users browsing this thread: 3 Guest(s)