All pastes #784636 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-19 19:56 UTC
rendered paste body
public CustomPickups()
{
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new string[128];
	NameTimer();
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			GetPlayerPos(i, oldposx, oldposy, oldposz);
			new tmpcar = GetPlayerVehicleID(i);
			if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
			{
				for(new h = 0; h < sizeof(SBizzInfo); h++)
				{
					if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
					{
						format(string, sizeof(string), "~w~%s~n~~r~Products Required~w~: %d~n~~y~Price per Product: ~w~: $%d~n~~g~Funds: ~w~: $%d",SBizzInfo[h][sbMessage],(SBizzInfo[h][sbMaxProducts]-SBizzInfo[h][sbProducts]),SBizzInfo[h][sbPriceProd],SBizzInfo[h][sbTill]);
						GameTextForPlayer(i, string, 5000, 3);
						return 1;
					}
					if(PlayerToPoint(2.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
					{
						if(SBizzInfo[h][sbOwned] == 1)
						{
							format(string, sizeof(string), "~w~%s~w~~n~Owner : %s~n~Extortion by : %s~n~Entrance Fee : ~g~$%d ~w~Level : %d ~n~to enter type /enter",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
						}
						else
						{
							format(string, sizeof(string), "~w~%s~w~~n~This Business is for sale~n~Cost: ~g~$%d ~w~Level : %d ~n~to buy this Business type /buybiz",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
						}
						GameTextForPlayer(i, string, 5000, 3);
						return 1;
					}
				}
				for(new h = 0; h < sizeof(HouseInfo); h++)
				{
					if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
					{
						if(HouseInfo[h][hOwned] == 1)
						{
							if(HouseInfo[h][hRentabil] == 0)
							{
								format(string, sizeof(string), "~w~This House is owned by~n~%s~n~Level : %d",HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
							}
							else
							{
								format(string, sizeof(string), "~w~This House is owned by~n~%s~n~Rent: $%d Level : %d~n~Type /rentroom to rent a room",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
							}
							GameTextForPlayer(i, string, 5000, 3);
							return 1;
						}
						else
						{
							format(string, sizeof(string), "~w~This House is for sale~n~Discription: %s ~n~Cost: ~g~$%d~n~~w~ Level : %d~n~to buy this house type /buyhouse",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
						}
						GameTextForPlayer(i, string, 5000, 3);
						return 1;
					}
				}
				for(new h = 0; h < sizeof(BizzInfo); h++)
				{
					if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
					{
						format(string, sizeof(string), "~w~%s~n~~r~Products Required~w~: %d~n~~y~Price per Product: ~w~: $%d~n~~g~Funds: ~w~: $%d",BizzInfo[h][bMessage],(BizzInfo[h][bMaxProducts]-BizzInfo[h][bProducts]),BizzInfo[h][bPriceProd],BizzInfo[h][bTill]);
						GameTextForPlayer(i, string, 5000, 3);
						return 1;
					}
					if(PlayerToPoint(2.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
					{
						if(BizzInfo[h][bOwned] == 1)
						{
							format(string, sizeof(string), "~w~%s~w~~n~Owner : %s~n~Extortion by : %s~n~Entrance Fee : ~g~$%d ~w~Level : %d ~n~to enter type /enter",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
						}
						else
						{
							format(string, sizeof(string), "~w~%s~w~~n~This Business is for sale~n~Cost: ~g~$%d ~w~Level : %d ~n~to buy this Business type /buybiz",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
						}
						GameTextForPlayer(i, string, 5000, 3);
						return 1;
					}
				}

			}//custompickups end
			if (PlayerToPoint(2.0, i, 1173.2563,-1323.3102,15.3943))
			{// Hospital near Ammu
				GameTextForPlayer(i, "~w~Type /healme to cure yourself", 5000, 5);
			}
			else if (PlayerToPoint(2.0, i, 2029.5945,-1404.6426,17.2512))
			{// Hospital near speedway
				GameTextForPlayer(i, "~w~Type /healme to cure yourself", 5000, 5);
			}
			else if (PlayerToPoint(2.0, i, 323.0342,1118.5804,1083.8828))
			{//Buyable Drugs for Drug Dealers
			    GameTextForPlayer(i, "~w~Type /get drugs, to get some ~r~Drugs~y~~n~Skill Level matters to price", 5000, 3);
			}
			else if (PlayerToPoint(3, i,-2162.2554,-2385.9541,30.6250))
			{
			    GameTextForPlayer(i, "~y~Welcome to the ~r~City Hall~n~~w~Type /enter to go in", 5000, 5);
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,359.5408,206.7693,1008.3828))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Detective~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,347.7374,193.7241,1014.1875))
			{
			    if(PlayerInfo[i][pJob] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Lawyer~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,1215.1304,-11.8431,1000.9219))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Whore~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,2166.3772,-1675.3829,15.0859))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Drugs Dealer~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,1109.3318,-1796.3042,16.5938))
			{
			    if(PlayerInfo[i][pJob] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Car Jacker~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,-2050.8962,460.0262,35.1719))
			{
			    if(PlayerInfo[i][pMember] == 9 || PlayerInfo[i][pLeader] == 9) { GameTextForPlayer(i, "~w~Type ~r~/paper ~w~to create a newspaper",5000,3); }
			    else if(PlayerInfo[i][pJob] == 15) { GameTextForPlayer(i, "~w~Type ~r~/papers ~w~to see all the made newspapers",5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,-1932.3859,276.2117,41.0391))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Car Mechanic~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,2226.1716,-1718.1792,13.5165))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Bodyguard~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,1366.4325,-1275.2096,13.5469))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Arms Dealer~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,531.7930,-1292.4044,17.2422))
			{
			    if(PlayerInfo[i][pJob] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Car Dealer~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,766.0804,14.5133,1000.7004))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Boxer~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,1154.2208,-1770.8203,16.5992))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Bus Driver~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,-77.7288,-1136.3896,1.0781))
			{
			    if(PlayerInfo[i][pJob] > 0 || PlayerInfo[i][pMember] > 0) {}
			    else { GameTextForPlayer(i, "~g~Welcome,~n~~y~you can become a ~r~Trucker~y~ here ~n~~w~Type /join if you wish to become one", 5000, 3); }
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,1381.0413,-1088.8511,27.3906))
			{
			    GameTextForPlayer(i, "~g~Welcome,~n~~y~Use /mission to take on a Mission", 5000, 3);
			}
			else if(PlayerToPoint(2.0, i,1073.0619,-344.5148,73.9922))
			{
		    }
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,1568.625122,-1690.535766,5.890600))
			{
			    //Police Armory
			    SetPlayerPos(i, 245.6500,-1347.1898,107.1833);
			    GameTextForPlayer(i, "~r~Los Santos Police Armory",5000,3);
			    SetPlayerInterior(i,0);
			}
			else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,247.6063,-1345.8665,107.1833))
			{
			    //Police Armory
			    SetPlayerPos(i, 1570.625122,-1690.535766,5.890600);
			    GameTextForPlayer(i, "~r~Los Santos Police Garage",5000,3);
			    SetPlayerInterior(i,0);
			}

    if(OrderReady[i] > 0)
			    {
			        switch (OrderReady[i])
			        {
			            case 1:
			            {
			                GivePlayerWeapon(i, 24, 50); GivePlayerWeapon(i, 29, 500); GivePlayerWeapon(i, 25, 50); GivePlayerWeapon(i, 4, 1);
			                GivePlayerMoney(i, - 5000);
			                SendClientMessage(i, COLOR_LIGHTBLUE, "* You picked up your Ordered Package.");
			            }
			            case 2:
			            {
			                GivePlayerWeapon(i, 24, 50); GivePlayerWeapon(i, 29, 500); GivePlayerWeapon(i, 25, 50); GivePlayerWeapon(i, 31, 500); GivePlayerWeapon(i, 4, 1);
			                GivePlayerMoney(i, - 6000);
			                SendClientMessage(i, COLOR_LIGHTBLUE, "* You picked up your Ordered Package.");
			            }
			            case 3:
			            {
			                GivePlayerWeapon(i, 24, 50); GivePlayerWeapon(i, 29, 500); GivePlayerWeapon(i, 25, 50); GivePlayerWeapon(i, 30, 500); GivePlayerWeapon(i, 4, 1);
			                GivePlayerMoney(i, - 6000);
			                SendClientMessage(i, COLOR_LIGHTBLUE, "* You picked up your Ordered Package.");
			            }
			            case 4:
			            {
			                GivePlayerWeapon(i, 24, 50); GivePlayerWeapon(i, 29, 500); GivePlayerWeapon(i, 25, 50); GivePlayerWeapon(i, 31, 500); GivePlayerWeapon(i, 4, 1); GivePlayerWeapon(i, 34, 20);
			                GivePlayerMoney(i, - 8000);
			                SendClientMessage(i, COLOR_LIGHTBLUE, "* You picked up your Ordered Package.");
			            }
			            case 5:
			            {
			                GivePlayerWeapon(i, 24, 50); GivePlayerWeapon(i, 29, 500); GivePlayerWeapon(i, 25, 50); GivePlayerWeapon(i, 30, 500); GivePlayerWeapon(i, 4, 1); GivePlayerWeapon(i, 34, 20);
			                GivePlayerMoney(i, - 8000);
			                SendClientMessage(i, COLOR_LIGHTBLUE, "* You picked up your Ordered Package.");
			            }
			            case 6:
			            {
			                GivePlayerWeapon(i, 24, 50); GivePlayerWeapon(i, 29, 500); GivePlayerWeapon(i, 25, 50); GivePlayerWeapon(i, 31, 500); GivePlayerWeapon(i, 4, 1); GivePlayerWeapon(i, 34, 20);
							GivePlayerMoney(i, - 8500);
							SendClientMessage(i, COLOR_LIGHTBLUE, "* You picked up your Ordered Package.");
			            }
			            case 7:
			            {
			                GivePlayerWeapon(i, 24, 50); GivePlayerWeapon(i, 29, 500); GivePlayerWeapon(i, 25, 50); GivePlayerWeapon(i, 30, 500); GivePlayerWeapon(i, 4, 1); GivePlayerWeapon(i, 34, 20);
			                GivePlayerMoney(i, - 8500);
			                SendClientMessage(i, COLOR_LIGHTBLUE, "* You picked up your Ordered Package.");
			            }
			        }
			        OrderReady[i] = 0;
			    }
			}//Hitman delivery stuff
			else if(PlayerOnMission[i] > 0 && PlayMission[kToggle] == 0)
			{
			    if(MissionCheckpoint[i] == 1 && PlayerToPoint(10.0, i,PlayMission[kCP1][0],PlayMission[kCP1][1],PlayMission[kCP1][2]))
				{
				    RingTone[i] = 20;
				    format(string, sizeof(string), "%s", PlayMission[kGText1]);
					GameTextForPlayer(i, string, 8000, 3);
					format(string, sizeof(string), "%s", PlayMission[kText4]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText5]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText6]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					MissionCheckpoint[i] = 2;
				}
				else if(MissionCheckpoint[i] == 2 && PlayerToPoint(10.0, i,PlayMission[kCP2][0],PlayMission[kCP2][1],PlayMission[kCP2][2]))
				{
				    RingTone[i] = 20;
				    format(string, sizeof(string), "%s", PlayMission[kGText2]);
					GameTextForPlayer(i, string, 8000, 3);
					format(string, sizeof(string), "%s", PlayMission[kText7]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText8]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText9]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					MissionCheckpoint[i] = 3;
				}
				else if(MissionCheckpoint[i] == 3 && PlayerToPoint(10.0, i,PlayMission[kCP3][0],PlayMission[kCP3][1],PlayMission[kCP3][2]))
				{
				    RingTone[i] = 20;
				    format(string, sizeof(string), "%s", PlayMission[kGText3]);
					GameTextForPlayer(i, string, 8000, 3);
					format(string, sizeof(string), "%s", PlayMission[kText10]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText11]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText12]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					MissionCheckpoint[i] = 4;
				}
				else if(MissionCheckpoint[i] == 4 && PlayerToPoint(10.0, i,PlayMission[kCP4][0],PlayMission[kCP4][1],PlayMission[kCP4][2]))
				{
				    RingTone[i] = 20;
				    format(string, sizeof(string), "%s", PlayMission[kGText4]);
					GameTextForPlayer(i, string, 8000, 3);
					format(string, sizeof(string), "%s", PlayMission[kText13]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText14]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText15]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					MissionCheckpoint[i] = 5;
				}
				else if(MissionCheckpoint[i] == 5 && PlayerToPoint(10.0, i,PlayMission[kCP5][0],PlayMission[kCP5][1],PlayMission[kCP5][2]))
				{
				    RingTone[i] = 20;
				    format(string, sizeof(string), "%s", PlayMission[kGText5]);
					GameTextForPlayer(i, string, 8000, 3);
					format(string, sizeof(string), "%s", PlayMission[kText16]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText17]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					format(string, sizeof(string), "%s", PlayMission[kText18]);
					SendClientMessage(i, COLOR_YELLOW2, string);
					MissionCheckpoint[i] = 6;
				}
				else if(MissionCheckpoint[i] == 6 && PlayerToPoint(10.0, i,PlayMission[kCP6][0],PlayMission[kCP6][1],PlayMission[kCP6][2]))
				{
				    RingTone[i] = 20;
				    format(string, sizeof(string), "%s", PlayMission[kGText6]);
					GameTextForPlayer(i, string, 8000, 3);
					format(string, sizeof(string), "..:: Mission Passed : %s | Reward received: $%d ::..", PlayMission[kTitle], PlayMission[kReward]);
					SendClientMessage(i, COLOR_GREEN, string);
					GivePlayerMoney(i, PlayMission[kReward]);
					PlayerInfo[i][pMissionNr] = PlayerOnMission[i];
					MissionCheckpoint[i] = 0;
					PlayerOnMission[i] = 0;
				}
			}
		}
    return 1;
	}