Drugs runs problem.
#7

ok, so when you go to that place (point) you get the "SERVER: UNKNOWN COMMAND" message, but when you go out of that point (playertopoint) you get the message that you are not at that place (SendClientMessage ERROR: You are not at the drugs load place) - that's fine.

That means that there is a problem somewhere here:
pawn Код:
if(PlayerHaul[tmpcar][pDrugsx] == 0)
                {
          tmp = strtok(cmdtext, idx);
          new check = PlayerHaul[tmpcar][pDrugsx];
          if(check >= 50)
                    {
            format(string, sizeof(string), "  Your car is full.");
            SendClientMessage(playerid, COLOR_RED, string);
            return 1;
          }
          if(GetPlayerMoney(playerid) >= 500000)
                    {
            PlayerHaul[tmpcar][pDrugsx] = 50;
            format(string, sizeof(string), "    You bought [50] Kilograms of drugs.");
            SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
            GivePlayerMoney(playerid,-500000);
            return 1;
          }
          else
                    {
            format(string, sizeof(string), "[ERROR] You need $ 500.000 to buy drugs!");
            SendClientMessage(playerid, COLOR_RED, string);
            return 1;
          }
        }
        else
                {
          format(string, sizeof(string), "[ERROR] You already bought drugs.");
          SendClientMessage(playerid, COLOR_RED, string);
          return 1;
        }
check it through and there may be a problem there.

I'll give it a shot. try this:

pawn Код:
if(strcmp(cmd, "/pickdrugs", true) == 0)
{
  if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    if (IsPlayerInAnyVehicle(playerid))
        {
      if(PlayerToPoint(4.0, playerid, -72.8756,-1539.0819,2.6172))
            {
        if(PlayerHaul[tmpcar][pDrugsx] == 0)
                {
          tmp = strtok(cmdtext, idx);
          new check = PlayerHaul[tmpcar][pDrugsx];
          if(check >= 50)
                    {
            format(string, sizeof(string), "  Your car is full.");
            SendClientMessage(playerid, COLOR_RED, string);
            return 1;
          }
          if(GetPlayerMoney(playerid) >= 500000)
                    {
            PlayerHaul[tmpcar][pDrugsx] = 50;
            format(string, sizeof(string), "    You bought [50] Kilograms of drugs.");
            SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
            GivePlayerMoney(playerid,-500000);
            return 1;
          }
          else
                    {
            format(string, sizeof(string), "[ERROR] You need $ 500.000 to buy drugs!");
            SendClientMessage(playerid, COLOR_RED, string);
            return 1;
          }
          return 1;
        }
        else
                {
          format(string, sizeof(string), "[ERROR] You already bought drugs.");
          SendClientMessage(playerid, COLOR_RED, string);
          return 1;
        }
        return 1;
      }
      else
            {
        format(string, sizeof(string), "ERROR: You are not at the drugs load place.");
        SendClientMessage(playerid, COLOR_RED, string);
        return 1;
      }
    }
    else
        {
      format(string, sizeof(string), "ERROR: You are not in a car.");
      SendClientMessage(playerid, COLOR_RED, string);
      return 1;
    }
  }
  return 1;
}


if(strcmp(cmd, "/putdrugs", true) == 0)
{
  if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    if (IsPlayerInAnyVehicle(playerid))
        {
      if(Drugs <= 1000)
            {
        if(PlayerToPoint(4.0, playerid, 2735.5935,-2466.1265,13.6484))
                {
          if(PlayerHaul[tmpcar][pDrugsx] == 50)
                    {
            tmp = strtok(cmdtext, idx);
            new check = PlayerHaul[tmpcar][pDrugsx];
            if(check <= 50)
                        {
              format(string, sizeof(string), "  You don't have drugs in the car");
              SendClientMessage(playerid, COLOR_RED, string);
              return 1;
            }
            else if(check >= 50)
                        {
              PlayerHaul[tmpcar][pDrugsx] = 0;
              Drugs += 50;
              SaveStocks();
              format(string, sizeof(string), "  You sold 50Kg's of drugs and recieved $520.000 from the handler.");
              SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
              GivePlayerMoney(playerid,520000);
              PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
              return 1;
            }
            else
                        {
              format(string, sizeof(string), "ERROR: No drugs in the vehicle!");
              SendClientMessage(playerid, COLOR_RED, string);
              return 1;
            }
          }
        }
        else
                {
          format(string, sizeof(string), "ERROR: You aren't at drugs unload place.");
          SendClientMessage(playerid, COLOR_RED, string);
          return 1;
        }
      }
      else
            {
        format(string, sizeof(string), "ERROR: Drug stock full!!");
        SendClientMessage(playerid, COLOR_RED, string);
        return 1;
      }
    }
    else
        {
      format(string, sizeof(string), "ERROR: You are not in a car.");
      SendClientMessage(playerid, COLOR_RED, string);
      return 1;
    }
  }
  return 1;
}
indentation shows up wrong here, correct it when u paste it in pawn.
Reply


Messages In This Thread
Drugs runs problem. - by killerx100 - 13.05.2009, 10:31
Re: Drugs runs problem. - by member - 13.05.2009, 10:49
Re: Drugs runs problem. - by killerx100 - 13.05.2009, 10:55
Re: Drugs runs problem. - by member - 13.05.2009, 10:59
Re: Drugs runs problem. - by killerx100 - 13.05.2009, 11:02
Re: Drugs runs problem. - by killerx100 - 13.05.2009, 11:46
Re: Drugs runs problem. - by member - 13.05.2009, 12:12
Re: Drugs runs problem. - by killerx100 - 13.05.2009, 13:21
Re: Drugs runs problem. - by killerx100 - 13.05.2009, 16:58

Forum Jump:


Users browsing this thread: 1 Guest(s)