SA-MP Forums Archive
How can I combine these... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can I combine these... (/showthread.php?tid=165463)



How can I combine these... - Luis_Leone - 04.08.2010

https://sampforum.blast.hk/showthread.php?tid=118379
And
https://sampforum.blast.hk/showthread.php?tid=149416

So I have one big script?


Re: How can I combine these... - Kar - 04.08.2010

just put in in one another..


Re: How can I combine these... - Luis_Leone - 05.08.2010

Quote:
Originally Posted by Kar
Посмотреть сообщение
just put in in one another..
Could you possibly give me an example?


Re: How can I combine these... - Kar - 05.08.2010

/facepalm
._.

just copy the codes out of house and put in biz.


Re: How can I combine these... - Luis_Leone - 05.08.2010

Quote:
Originally Posted by Kar
Посмотреть сообщение
/facepalm
._.

just copy the codes out of house and put in biz.
Alright, I'll post any Errors, if i get any .


Re: How can I combine these... - Luis_Leone - 05.08.2010

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?


Re: How can I combine these... - marharth - 05.08.2010

Quote:
Originally Posted by Luis_Leone
Посмотреть сообщение
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?
What do you mean?


Re: How can I combine these... - VictorMartinez - 05.08.2010

rename every single pickup


Re: How can I combine these... - Luis_Leone - 05.08.2010

All i want is for all of that to be in one big OnPlayerPickup?

Quote:
Originally Posted by VictorMartinez
Посмотреть сообщение
rename every single pickup
How do you mean?


Re: How can I combine these... - Kayla.S - 05.08.2010

Maybe post the errors you're getting when you try to compile it like that. It'll be easier for us to understand what's not working properly.