Advertisement
Guest User

Pizzaboy

a guest
Oct 25th, 2014
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. /*
  2. CREDITS:
  3. Created from scratch by Pawnify
  4. */
  5. #include <a_samp>
  6. #include <zcmd>
  7. #include <sscanf2>
  8.  
  9. main(){}
  10.  
  11. new OnJob[MAX_PLAYERS] = 0;
  12. new PizzaDelivered[MAX_PLAYERS] = 0;
  13.  
  14.  
  15. //ADD MORE COORDINATES HERE IF YOU WANT EXTRA PIZZA TO HOUSES.
  16. new Float:PizzaSpawns[][] =
  17. {
  18. {1909.4767,-1597.6576,14.3062,151.4326},
  19. {1578.2671,-1822.0808,13.3907,259.9920},
  20. {1560.0779,-1845.3982,13.5469,98.6238},
  21. {992.8955,-1817.6660,13.8969,158.4711},
  22. {791.6743,-1754.5459,13.4283,18.0240},
  23. {852.2607,-1422.2950,13.8082,174.4514}
  24. };
  25. new pbike1,pbike2,pbike3,pbike4,pbike5,pbike6,pbike7,pbike8,pbike9,pbike10;
  26.  
  27. forward GivePizzaCheckpoint(playerid);
  28. public GivePizzaCheckpoint(playerid)
  29. {
  30. new Random = random(sizeof(PizzaSpawns));
  31. SetPlayerCheckpoint(playerid, PizzaSpawns[Random][0], PizzaSpawns[Random][1], PizzaSpawns[Random][2], 2.0);
  32. SendClientMessage(playerid, -1, "{00FF00}You have a pizza to deliver. Head to the checkpoint.");
  33. return 1;
  34. }
  35.  
  36. public OnFilterScriptInit()
  37. {
  38. print("\n--------------------------------------");
  39. print(" Pizzaboy filterscript, by Pawnify. ");
  40. print("--------------------------------------\n");
  41.  
  42. pbike1 = CreateVehicle(448, 2122.2981, -1768.1520, 12.8729, 93.7800, -1, -1, 100);
  43. pbike2 = CreateVehicle(448, 2122.2188, -1770.5725, 12.8729, 93.7800, -1, -1, 100);
  44. pbike3 = CreateVehicle(448, 2122.1826, -1772.7524, 12.8729, 93.7800, -1, -1, 100);
  45. pbike4 = CreateVehicle(448, 2122.1814, -1774.6147, 12.8729, 93.7800, -1, -1, 100);
  46. pbike5 = CreateVehicle(448, 2122.2263, -1776.2585, 12.8729, 93.7800, -1, -1, 100);
  47. pbike6 = CreateVehicle(448, 2122.2053, -1777.9784, 12.8729, 93.7800, -1, -1, 100);
  48. pbike7 = CreateVehicle(448, 2122.1680, -1780.0364, 12.8729, 93.7800, -1, -1, 100);
  49. pbike8 = CreateVehicle(448, 2122.2488, -1781.9832, 12.8729, 93.7800, -1, -1, 100);
  50. pbike9 = CreateVehicle(448, 2122.2058, -1784.1187, 12.8729, 93.7800, -1, -1, 100);
  51. pbike10 = CreateVehicle(448, 2122.3621, -1765.5983, 12.8729, 91.8000, -1, -1, 100);
  52. return 1;
  53. }
  54.  
  55. public OnFilterScriptExit()
  56. {
  57. DestroyVehicle(pbike1),DestroyVehicle(pbike2),DestroyVehicle(pbike3),DestroyVehicle(pbike4),DestroyVehicle(pbike5),DestroyVehicle(pbike6),DestroyVehicle(pbike7),DestroyVehicle(pbike8),DestroyVehicle(pbike9),DestroyVehicle(pbike10);
  58. return 1;
  59. }
  60.  
  61. public OnPlayerStateChange(playerid, newstate, oldstate)
  62. {
  63. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  64. {
  65. new mycar = GetPlayerVehicleID(playerid);
  66. if(mycar == pbike1 || mycar == pbike2 || mycar == pbike3 || mycar == pbike4 || mycar == pbike5 || mycar == pbike6 ||mycar == pbike7 || mycar == pbike8 ||mycar == pbike9 || mycar == pbike10)
  67. {
  68. if(PizzaDelivered[playerid] == 0)
  69. {
  70. if(OnJob[playerid] == 0)
  71. {
  72. GivePizzaCheckpoint(playerid);
  73. OnJob[playerid] = 1;
  74. }
  75. }
  76. }
  77. }
  78. return 1;
  79. }
  80.  
  81. public OnPlayerEnterCheckpoint(playerid)
  82. {
  83. new mycar = GetPlayerVehicleID(playerid);
  84. if(mycar == pbike1 || mycar == pbike2 || mycar == pbike3 || mycar == pbike4 || mycar == pbike5 || mycar == pbike6 ||mycar == pbike7 || mycar == pbike8 ||mycar == pbike9 || mycar == pbike10)
  85. {
  86. if(OnJob[playerid] == 0)
  87. {
  88. SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  89. DisablePlayerCheckpoint(playerid);
  90. SendClientMessage(playerid, -1, "{00FF00}You have completed a delivery, get on another bike to start another delivery.");
  91. GivePlayerMoney(playerid, 20);
  92. OnJob[playerid] = 0;
  93. PizzaDelivered[playerid] = 0;
  94. }
  95.  
  96. if(!IsPlayerInRangeOfPoint(playerid, 2, 2128.1113, -1819.1235, 13.5534))
  97. {
  98. if(OnJob[playerid] == 1)
  99. {
  100. new tip, string[250]; tip = random(6);
  101. format(string, sizeof(string), "{00FF00}You have delivered a pizza, you earned a ($%i) tip. Return to the Pizza Parlour to earn your pay.", tip);
  102. GivePlayerMoney(playerid, tip);
  103. SendClientMessage(playerid, -1, string);
  104. SetPlayerCheckpoint(playerid, 2128.1113, -1819.1235, 13.5534, 3.0);
  105. OnJob[playerid] = 0;
  106. PizzaDelivered[playerid] = 1;
  107. }
  108. }
  109. }
  110. return 1;
  111. }
  112. public OnPlayerDisconnect(playerid, reason)
  113. {
  114. OnJob[playerid] = 0;
  115. PizzaDelivered[playerid] = 0;
  116. return 1;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement