Advertisement
Lighnat0r

GTA SA Paramedic Determine Spawn Location

Dec 30th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.06 KB | None | 0 0
  1. PARAMEDIC
  2. -------------------------------------------------------------------------------------
  3.  
  4. Hospital Locations:
  5. Nr X Y Z
  6. 1: 2004.96 -1442.96 12.56
  7. 2: 1180.85 -1325.57 12.58
  8. 3: - 316.3832 1056.045 18.7344
  9. 4: -1514.823 2527.119 54.7443
  10. 5: 1244.437 331.2261 18.5547
  11. 6: -2198.693 -2290.105 29.625
  12. 7: -2670.285 616.4364 13.4531
  13. 8: 1578.446 1770.682 9.8358
  14.  
  15. GET NEAREST HOSPITAL::
  16.  
  17. For 0 cities unlocked:
  18. {
  19. Get DistanceToHospital1
  20. Get DistanceToHospital2
  21. Get DistanceToHospital5
  22. Set NearestHospitalNr
  23. Goto LOCATIONS
  24. }
  25.  
  26. For 1 city unlocked:
  27. {
  28. Get DistanceToHospital1
  29. Get DistanceToHospital2
  30. Get DistanceToHospital5
  31. Get DistanceToHospital6
  32. Get DistanceToHospital7
  33. Set NearestHospitalNr
  34. Goto LOCATIONS
  35. }
  36.  
  37. For 2 cities unlocked:
  38. {
  39. Get DistanceToHospital1
  40. Get DistanceToHospital2
  41. Get DistanceToHospital3
  42. Get DistanceToHospital4
  43. Get DistanceToHospital5
  44. Get DistanceToHospital6
  45. Get DistanceToHospital7
  46. Get DistanceToHospital8
  47. Set NearestHospitalNr
  48. Goto LOCATIONS
  49. }
  50.  
  51.  
  52. if NearestHospitalNr = 1
  53. {
  54. HospitalX = 2004.96
  55. HospitalY = -1442.96
  56. HospitalZ = 12.56
  57. SpawnZoneLowerX = 1200.0
  58. SpawnZoneUpperX = 2930.0
  59. SpawnZoneLowerY = -2213.0
  60. SpawnZoneUpperY = -1012.0
  61. }
  62. Else If NearestHospitalNr = 2
  63. {
  64. HospitalX = 1180.85
  65. HospitalY = -1325.57
  66. HospitalZ = 12.58
  67. SpawnZoneLowerX = 450.0
  68. SpawnZoneUpperX = 1800.0
  69. SpawnZoneLowerY = -1900.0
  70. SpawnZoneUpperY = -870.0
  71. }
  72. Else If NearestHospitalNr = 3
  73. {
  74. HospitalX = -316.3832
  75. HospitalY = 1056.045
  76. HospitalZ = 18.7344
  77. SpawnZoneLowerX = -860.0
  78. SpawnZoneUpperX = 185.0
  79. SpawnZoneLowerY = 749.0
  80. SpawnZoneUpperY = 1616.0
  81. }
  82. Else If NearestHospitalNr = 4
  83. {
  84. HospitalX = -1514.006
  85. HospitalY = 2532.013
  86. HospitalZ = 54.7443
  87. SpawnZoneLowerX = -1684.0
  88. SpawnZoneUpperX = -702.0
  89. SpawnZoneLowerY = 1465.0
  90. SpawnZoneUpperY = 2749.9
  91. }
  92. Else If NearestHospitalNr = 5
  93. {
  94. HospitalX = 1225.0
  95. HospitalY = 302.0
  96. HospitalZ = 20.0
  97. SpawnZoneLowerX = 100.0
  98. SpawnZoneUpperX = 2604.0
  99. SpawnZoneLowerY = -720.0
  100. SpawnZoneUpperY = 465.0
  101. }
  102. Else If NearestHospitalNr = 6
  103. {
  104. HospitalX = -2198.693
  105. HospitalY = -2290.105
  106. HospitalZ = 29.625
  107. SpawnZoneLowerX = -2598.0
  108. SpawnZoneUpperX = -1500.0
  109. SpawnZoneLowerY = -2700.0
  110. SpawnZoneUpperY = -1700.0
  111. }
  112. Else If NearestHospitalNr = 7
  113. {
  114. HospitalX = -2670.285
  115. HospitalY = 616.4364
  116. HospitalZ = 13.4531
  117. SpawnZoneLowerX = -2820.0
  118. SpawnZoneUpperX = -1784.0
  119. SpawnZoneLowerY = 29.0
  120. SpawnZoneUpperY = 1180.0
  121. }
  122. Else If NearestHospitalNr = 8
  123. {
  124. HospitalX = 1578.446
  125. HospitalY = 1770.682
  126. HospitalZ = 9.8358
  127. SpawnZoneLowerX = 1000.0
  128. SpawnZoneUpperX = 2600.0
  129. SpawnZoneLowerY = 772.0
  130. SpawnZoneUpperY = 2400.0
  131. }
  132.  
  133. Loop %NumberOfPatientsToSpawn% ; For every patient that needs to be spawned, generate spawn coordinates.
  134. {
  135. gosub @PICK SPAWN COORDINATES
  136. Store Potential Patient Spawn to Current Patient Spawn
  137. }
  138. goto SUCCESS
  139.  
  140. SUCCESS::
  141. Create patients, set timer etc. Continue with the mission.
  142.  
  143.  
  144.  
  145. PICK SPAWN COORDINATES::
  146.  
  147. if ParamedicCurrentLevel < 8
  148. {
  149. SpawnZoneRadius := 60*ParamedicCurrentLevel
  150. SpawnZoneCurrentLevelLowerX := HospitalX-SpawnZoneRadius
  151. If SpawnZoneCurrentLevelLowerX < SpawnZoneLowerX
  152. SpawnZoneCurrentLevelLowerX := SpawnZoneLowerX
  153. SpawnZoneCurrentLevelUpperX := HospitalX+SpawnZoneRadius
  154. If SpawnZoneCurrentLevelUpperX < SpawnZoneUpperX
  155. SpawnZoneCurrentLevelUpperX := SpawnZoneUpperX
  156. SpawnZoneCurrentLevelLowerY := HospitalY-SpawnZoneRadius
  157. If SpawnZoneCurrentLevelLowerY < SpawnZoneLowerY
  158. SpawnZoneCurrentLevelLowerY := SpawnZoneLowerY
  159. SpawnZoneCurrentLevelUpperY := HospitalY+SpawnZoneRadius
  160. If SpawnZoneCurrentLevelUpperY < SpawnZoneUpperY
  161. SpawnZoneCurrentLevelLowerX := SpawnZoneUpperY
  162. }
  163. Else
  164. {
  165. SpawnZoneCurrentLevelLowerX := SpawnZoneLowerX
  166. SpawnZoneCurrentLevelUpperX := SpawnZoneUpperX
  167. SpawnZoneCurrentLevelLowerY := SpawnZoneLowerY
  168. SpawnZoneCurrentLevelUpperY := SpawnZoneUpperY
  169. }
  170. PatientPotentialX := Get a random X on the pedestrian paths between SpawnZoneCurrentLevelLowerX and SpawnZoneCurrentLevelUpperX
  171. PatientPotentialY := Get a random Y on the pedestrian paths between SpawnZoneCurrentLevelLowerY and SpawnZoneCurrentLevelUpperY
  172. PatientPotentialZ := Get ground for location (PatientPotentialX, PatientPotentialY)
  173.  
  174. if PatientPotentialZ < 6.0
  175. Goto PICK SPAWN COORDINATES
  176. If Distance between Player and Potential Patient Spawn < 50.0
  177. Goto PICK SPAWN COORDINATES
  178. If Distance between Hospital and Potential Patient Spawn < 50.0
  179. Goto PICK SPAWN COORDINATES
  180. if Distance between Potential Patient Spawn and Other Patients < 25.0
  181. Goto PICK SPAWN COORDINATES
  182. if Car exists in cube around Potential Patient Spawn ; Radius 25.0 25.0 10.0
  183. Goto PICK SPAWN COORDINATES
  184.  
  185. For 0 cities unlocked:
  186. {
  187. ; Check that the patient doesn't spawn in an area which hasn't been unlocked.
  188.  
  189. if ((PatientPotentialX < 78.4427) AND (PatientPotentialY < -699.519))
  190. Goto PICK SPAWN COORDINATES
  191. if ((PatientPotentialX < -252.6557) AND (PatientPotentialY < -285.766))
  192. Goto PICK SPAWN COORDINATES
  193. if (PatientPotentialX < -948.3447)
  194. Goto PICK SPAWN COORDINATES
  195. if ((PatientPotentialX > 1473.448) AND (PatientPotentialY > 403.7353))
  196. Goto PICK SPAWN COORDINATES
  197. if (PatientPotentialY > 578.6325)
  198. Goto PICK SPAWN COORDINATES
  199. if ((PatientPotentialX < 837.5551) AND (PatientPotentialY > 347.4097))
  200. Goto PICK SPAWN COORDINATES
  201. }
  202.  
  203. For 1 city unlocked:
  204. {
  205. ; Check that the patient doesn't spawn in an area which hasn't been unlocked.
  206.  
  207. if ((PatientPotentialX > 1473.448) AND (PatientPotentialY > 403.7353))
  208. Goto PICK SPAWN COORDINATES
  209. if ((PatientPotentialX > -1528.498) AND (PatientPotentialY > 578.6325))
  210. Goto PICK SPAWN COORDINATES
  211. if ((-1528.498 < PatientPotentialX < 837.5551) AND (PatientPotentialY > 347.4097))
  212. Goto PICK SPAWN COORDINATES
  213. if (PatientPotentialY > 1380.0)
  214. Goto PICK SPAWN COORDINATES
  215. }
  216.  
  217. ; Check that the patient doesn't spawn in a location where it can't (such as water?).
  218.  
  219. if ((1047.0 < PatientPotentialX < 1186.0) AND (-1567.0 < PatientPotentialY < -1406.0))
  220. Goto PICK SPAWN COORDINATES
  221. if ((1339.0 < PatientPotentialX < 1444.0) AND (-1504.0 < PatientPotentialY < -1450.0))
  222. Goto PICK SPAWN COORDINATES
  223. if ((1999.387 < PatientPotentialX < 2041.979) AND (-1445.462 < PatientPotentialY < -1408.708))
  224. Goto PICK SPAWN COORDINATES
  225. if ((1162.0 < PatientPotentialX < 1202.0) AND (-1250.0 < PatientPotentialY < -1238.0))
  226. Goto PICK SPAWN COORDINATES
  227. if ((1158.0 < PatientPotentialX < 1176.0) AND (1345.0 < PatientPotentialY < 1364.0))
  228. Goto PICK SPAWN COORDINATES
  229. if ((-2333.0 < PatientPotentialX < -2307.0) AND (1036.0 < PatientPotentialY < 1100.0))
  230. Goto PICK SPAWN COORDINATES
  231. if ((1989.0 < PatientPotentialX < 2009.0) AND (1513.0 < PatientPotentialY < 1571.0))
  232. Goto PICK SPAWN COORDINATES
  233. if ((2546.463 < PatientPotentialX < 2632.818) AND (-1144.012 < PatientPotentialY < -1129.673))
  234. Goto PICK SPAWN COORDINATES
  235. if ((-229.096 < PatientPotentialX < -222.5044) AND (1393.817 < PatientPotentialY < 1412.086))
  236. Goto PICK SPAWN COORDINATES
  237. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement