How can I combine these...
#6

I am having trouble with this,

pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid) //If you have one of these add the stuff in this to your on‌e =]
{
  for(new C; C<BusinessCount+1; C++)//Loops through all businesses
  {
    if(pickupid == BusinessPickup[C]) //Checks if the pickup is for a business
    {
      new str[150];//Creates a string.
      if(BusinessInfo[C][BusOwner] == -1) format(str, sizeof(str), "%s ~n~~r~Cost price: $%d ~b~Sale price: $%d ~n~ ~g~Earn ammount: $%d", BusinessInfo[C][BusName], BusinessInfo[C][BusCost], BusinessInfo[C][BusSell], BusinessInfo[C][BusEarn]); //Makes the string for a business with no owner.
      if(BusinessInfo[C][BusOwner] != -1)
      {
        new Pname[24]; //Creates player name variable
        GetPlayerName(BusinessInfo[C][BusOwner], Pname, 24); //Gets player name
        format(str, sizeof(str), "%s ~n~~r~Cost price: $%d ~b~Sale price: $%d ~n~ ~g~Earn ammount: $%d~n~~w~Owner: %s(%d)", BusinessInfo[C][BusName], BusinessInfo[C][BusCost], BusinessInfo[C][BusSell], BusinessInfo[C][BusEarn], Pname, BusinessInfo[C][BusOwner]);
        GameTextForPlayer(playerid, str, 3000, 3);
      }
    }
  }
  return 1;
}

{
  for(new J; J<MAX_HOUSES; J++) //Loops through all houses
  {
    if(pickupid == PickupID[J]) //If the pickupid is one of our house ones
    {
      new str[75];
      if(HouseInfo[J][Owned] == 1)
      {
        format(str, sizeof(str), "~r~House Info~n~~g~Owner: ~w~%s", HouseInfo[J][HouseOwner]);
      }
      if(HouseInfo[J][Owned] == 0)
      {
        format(str, sizeof(str), "~r~House Info~n~~g~Owner: ~w~Nobody");
        SendClientMessage(playerid, 0x67F6F6AA, "This house is up for sale! Type /buy to buy it");
      }
      new str2[100];
      format(str2, sizeof(str2), "~g~Cost price:~w~ %d ~n~~g~Sell Price:~w~ %d", HouseInfo[J][HouseCost], HouseInfo[J][HouseSell]);
      new str3[150];
      format(str3, sizeof(str3), "%s~n~%s", str, str2);
      GameTextForPlayer(playerid, str3, 3500, 3);
      return 1;
    }
  }
  return 1;
}
They are both under OnPlayerPickup, Are you able to just make that in to one thing please?
Reply


Messages In This Thread
How can I combine these... - by Luis_Leone - 04.08.2010, 23:51
Re: How can I combine these... - by Kar - 04.08.2010, 23:55
Re: How can I combine these... - by Luis_Leone - 05.08.2010, 00:02
Re: How can I combine these... - by Kar - 05.08.2010, 00:03
Re: How can I combine these... - by Luis_Leone - 05.08.2010, 00:08
Re: How can I combine these... - by Luis_Leone - 05.08.2010, 00:19
Re: How can I combine these... - by marharth - 05.08.2010, 01:27
Re: How can I combine these... - by VictorMartinez - 05.08.2010, 01:36
Re: How can I combine these... - by Luis_Leone - 05.08.2010, 01:47
Re: How can I combine these... - by Kayla.S - 05.08.2010, 01:49

Forum Jump:


Users browsing this thread: 1 Guest(s)