SetPlayerTeam bug
#1

what's wrong with this commands? http://pastebin.com/YUKHMAcg but when i type /changeballas no effect
Reply
#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
#3

doesn't work with "||"
Reply
#4

Why do you check the players team using gTeam but then set it using SetPlayerTeam?
Reply
#5

and what function should i use?
Reply
#6

Quote:
Originally Posted by adytzu32
and what function should i use?
Well you can either get the players team using gTeam and set it using gTeam
Or you can get the players team using GetPlayerTeam and set it using SetPlayerTeam
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)