Advertisement
Guest User

Untitled

a guest
Jan 13th, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.46 KB | None | 0 0
  1. public update_zones()
  2. {
  3. new line1[10], line2[10];
  4. foreach(Character, i)
  5. {
  6. if(IsPlayerInPolygonZone(i) == 1) continue;
  7. UserInfo[i][zoneupdates] = 1;
  8. if(GetPlayerVirtualWorld(i) == 1236 && UserInfo[i][CurrentInterior] == 6)
  9. {
  10. format(UserInfo[i][LocationZone], 100, "Admin Hangout");
  11. PlayerTextDrawSetString(i, plaInfoLocation[i], "Admin Hangout");
  12. continue;
  13. }
  14. if(GetPlayerVirtualWorld(i) == 1505 && UserInfo[i][CurrentInterior] == 17)
  15. {
  16. format(UserInfo[i][LocationZone], 100, "Powerplant in Missionary Hill");
  17. PlayerTextDrawSetString(i, plaInfoLocation[i], "Powerplant ~n~in Missionary Hill");
  18. continue;
  19. }
  20. if(UserInfo[i][zoneupdates] == 1)
  21. {
  22. player_zone_before[i] = player_zone[i];
  23. player_zone[i] = -1;
  24. if(IsPlayerJailed2(i) == 1)
  25. {
  26. if(CityType == 1)
  27. {
  28. format(UserInfo[i][LocationZone], 100, "San Fierro Police Dept");
  29. PlayerTextDrawSetString(i, plaInfoLocation[i], "San Fierro Police Dept");
  30. }
  31. else if(CityType == 2)
  32. {
  33. format(UserInfo[i][LocationZone], 100, "Las Venturas Police Dept");
  34. PlayerTextDrawSetString(i, plaInfoLocation[i], "Las Venturas Police Dept");
  35. }
  36. else if(CityType == 3)
  37. {
  38. format(UserInfo[i][LocationZone], 100, "Los Santos Police Dept");
  39. PlayerTextDrawSetString(i, plaInfoLocation[i], "Los Santos Police Dept");
  40. }
  41. continue;
  42. }
  43. if(UserInfo[i][InHouseID] >= 0 || UserInfo[i][InStoreID] >= 0)
  44. {
  45. if(UserInfo[i][InHouseID] >= 0)
  46. {
  47. NormalString[0] = EOS;
  48. new h = UserInfo[i][InHouseID];
  49.  
  50. if(TimeTillHouseExit[i] >= 1)
  51. {
  52. format(UserInfo[i][LocationZone], 100, "House in %s", HouseInfo[h][HouseLoc]);
  53. format(UserInfo[i][LocZone], 100, UserInfo[i][LocationZone]);
  54. new position = strfind(UserInfo[i][LocationZone], " in ", true);
  55. if(position != -1)
  56. {
  57. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  58. strins(UserInfo[i][LocZone], "~n~", position);
  59. }
  60. else
  61. {
  62. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  63. }
  64. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  65. }
  66. else
  67. {
  68. if(strcmp(HouseInfo[h][HouseMessage],"Unknown Message",true) && strcmp(HouseInfo[h][HouseMessage],"Unowned House",true))
  69. {
  70. format(UserInfo[i][LocationZone], 100, "%s in %s", HouseInfo[h][HouseMessage], HouseInfo[h][HouseLoc]);
  71. format(UserInfo[i][LocZone], 100, UserInfo[i][LocationZone]);
  72. new position = strfind(UserInfo[i][LocationZone], " in ", true);
  73. if(position != -1)
  74. {
  75. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  76. strins(UserInfo[i][LocZone], "~n~", position);
  77. }
  78. else
  79. {
  80. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  81. }
  82. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  83. }
  84. else
  85. {
  86. format(UserInfo[i][LocationZone], 100, "%s's House in %s", HouseInfo[h][HOwner], HouseInfo[h][HouseLoc]);
  87. format(UserInfo[i][LocZone], 100, UserInfo[i][LocationZone]);
  88. new position = strfind(UserInfo[i][LocationZone], " in ", true);
  89. if(position != -1)
  90. {
  91. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  92. strins(UserInfo[i][LocZone], "~n~", position);
  93. }
  94. else
  95. {
  96. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  97. }
  98. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  99. }
  100. }
  101. continue;
  102. }
  103. new b = UserInfo[i][InStoreID];
  104. if(UserInfo[i][InStoreID] >= 0 && StoreInfo[b][StoreType] != 9 && StoreInfo[b][StoreType] != 10 && StoreInfo[b][StoreType] != 11 && StoreInfo[b][StoreType] != 13 && StoreInfo[b][StoreType] != 15 && StoreInfo[b][StoreType] != 26 && StoreInfo[b][StoreType] != 27)
  105. {
  106. NormalString[0] = EOS;
  107. format(NormalString, sizeof(NormalString),"%s In %s",StoreInfo[UserInfo[i][InStoreID]][StoreMessage],StoreInfo[UserInfo[i][InStoreID]][StoreLoc]);
  108. format(UserInfo[i][LocationZone], 100, NormalString);
  109. format(UserInfo[i][LocZone], 100, UserInfo[i][LocationZone]);
  110. new position = strfind(UserInfo[i][LocationZone], " in ", true);
  111. if(position != -1)
  112. {
  113. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  114. strins(UserInfo[i][LocZone], "~n~", position);
  115. }
  116. else
  117. {
  118. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  119. }
  120. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  121. }
  122. continue;
  123. }
  124.  
  125. for(new j=0; j<sizeof(zones);j++)
  126. {
  127. if(IsPlayerInZone(i,j) && player_zone[i] == -1)
  128. {
  129. player_zone[i] = j;
  130. format(line1,10,"p%dzone",i);
  131. format(line2,10,"%d",j);
  132. PropertySet(line1,line2);
  133. if(!strcmp(zones[j][zone_name],"Palomino Creek",true) && GetPlayerVirtualWorld(i) == 100)
  134. {
  135. strreplace2(zones[j][zone_name],"Palomino Creek","Bank of San Andreas",true);
  136. }
  137. SetStoreNames(i,j,GetPlayerVirtualWorld(i));
  138. if(UserInfo[i][CurrentInterior] != 0)
  139. {
  140. if(strcmp(ShopLocation[i]," ",true) && strcmp(ShopLocation[i],"REMOVED ",true))
  141. {
  142. NormalString[0] = EOS;
  143.  
  144. format(NormalString, sizeof(NormalString),"%s in %s",zones[j][zone_name],ShopLocation[i]);
  145. UserInfo[i][LocationZone][0] = EOS;
  146. format(UserInfo[i][LocationZone], 100, NormalString);
  147. format(UserInfo[i][LocZone], 100, UserInfo[i][LocationZone]);
  148. new position = strfind(UserInfo[i][LocationZone], " in ", true);
  149. if(position != -1)
  150. {
  151. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  152. strins(UserInfo[i][LocZone], "~n~", position);
  153. }
  154. else
  155. {
  156. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  157. }
  158. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  159. }
  160. new zoner = player_zone_before[i];
  161. new zoner2 = player_zone_before_area[i];
  162. if(i >= 0 && zoner != -1 && zoner2 != -1)
  163. {
  164. if(zoner2 == 0)
  165. {
  166. if(!strcmp(ShopLocation[i]," ",true) && strcmp(zones[zoner][zone_name],zones[j][zone_name],true) && strcmp(ShopLocation[i],"REMOVED ",true))
  167. {
  168. NormalString[0] = EOS;
  169. format(NormalString, sizeof(NormalString),"%s in %s",zones[j][zone_name],zones[zoner][zone_name]);
  170. format(UserInfo[i][LocZone], 100, NormalString);
  171. new position = strfind(NormalString, "in", true);
  172. if(position != -1)
  173. {
  174. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  175. strins(UserInfo[i][LocZone], "~n~", position);
  176. }
  177. else
  178. {
  179. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  180. }
  181. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  182. player_zoner[i][0] = EOS;
  183. format(player_zoner[i],24,"%s",zones[zoner][zone_name]);
  184. UserInfo[i][LocationZone][0] = EOS;
  185. format(UserInfo[i][LocationZone], 100, NormalString);
  186. }
  187. }
  188. else if(zoner2 >= 1 && zoner2 < sizeof(DynamicZone))
  189. {
  190. if(!strcmp(ShopLocation[i]," ",true) && strcmp(ShopLocation[i],"REMOVED ",true))
  191. {
  192. NormalString[0] = EOS;
  193. format(NormalString, sizeof(NormalString),"%s in %s",zones[j][zone_name],DynamicZone[zoner2][ZoneName]);
  194. format(UserInfo[i][LocZone], 100, NormalString);
  195. new position = strfind(NormalString, "in", true);
  196. if(position != -1)
  197. {
  198. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  199. strins(UserInfo[i][LocZone], "~n~", position);
  200. }
  201. else
  202. {
  203. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  204. }
  205. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  206. player_zoner[i][0] = EOS;
  207. format(player_zoner[i],24,"%s",DynamicZone[zoner2][ZoneName]);
  208. UserInfo[i][LocationZone][0] = EOS;
  209. format(UserInfo[i][LocationZone], 100, NormalString);
  210. }
  211. }
  212. }
  213. if(!strcmp(ShopLocation[i],"REMOVED ",true) && UserInfo[i][InHouseID] == -1)
  214. {
  215. NormalString[0] = EOS;
  216. format(NormalString, sizeof(NormalString),"%s",zones[j][zone_name]);
  217. UserInfo[i][LocationZone][0] = EOS;
  218. format(UserInfo[i][LocZone], 100, NormalString);
  219. new position = strfind(NormalString, "in", true);
  220. if(position != -1)
  221. {
  222. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  223. strins(UserInfo[i][LocZone], "~n~", position);
  224. }
  225. else
  226. {
  227. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  228. }
  229. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  230. format(UserInfo[i][LocationZone], 100, NormalString);
  231. }
  232. if(UserInfo[i][InHouseID] == -1 && !strcmp(zones[j][zone_name],"Las Venturas Police Dept",true) || !strcmp(zones[j][zone_name],"Los Santos Police Dept",true) || !strcmp(zones[j][zone_name],"San Fierro Police Dept",true))
  233. {
  234. NormalString[0] = EOS;
  235. format(NormalString, sizeof(NormalString),"%s",zones[j][zone_name]);
  236. format(UserInfo[i][LocZone], 100, NormalString);
  237. new position = strfind(NormalString, "in", true);
  238. if(position != -1)
  239. {
  240. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  241. strins(UserInfo[i][LocZone], "~n~", position);
  242. }
  243. else
  244. {
  245. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  246. }
  247. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  248. UserInfo[i][LocationZone][0] = EOS;
  249. format(UserInfo[i][LocationZone], 100, NormalString);
  250. }
  251. if(UserInfo[i][InHouseID] == -1 && !strcmp(zones[j][zone_name],"Las Venturas Police Dept",true) || !strcmp(zones[j][zone_name],"Los Santos Police Dept",true) || !strcmp(zones[j][zone_name],"San Fierro Police Dept",true))
  252. {
  253. NormalString[0] = EOS;
  254. format(NormalString, sizeof(NormalString),"%s",zones[j][zone_name]);
  255. format(UserInfo[i][LocZone], 100, NormalString);
  256. new position = strfind(NormalString, "in", true);
  257. if(position != -1)
  258. {
  259. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  260. strins(UserInfo[i][LocZone], "~n~", position);
  261. }
  262. else
  263. {
  264. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  265. }
  266. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  267. UserInfo[i][LocationZone][0] = EOS;
  268. format(UserInfo[i][LocationZone], 100, NormalString);
  269. }
  270. }
  271. else
  272. {
  273. format(NormalString, sizeof(NormalString),"%s",zones[j][zone_name]);
  274. UserInfo[i][LocationZone][0] = EOS;
  275. format(UserInfo[i][LocationZone], 100, zones[j][zone_name]);
  276. format(UserInfo[i][LocZone], 100, UserInfo[i][LocationZone]);
  277. new position = strfind(UserInfo[i][LocationZone], " in ", true);
  278. if(position != -1)
  279. {
  280. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  281. strins(UserInfo[i][LocZone], "~n~", position);
  282. }
  283. else
  284. {
  285. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  286. }
  287. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  288. player_zone[i] = j;
  289. format(line1,10,"p%dzone",i);
  290. format(line2,10,"%d",j);
  291. PropertySet(line1,line2);
  292. }
  293. }
  294. if(GetPlayerVirtualWorld(i) >= 1005 && UserInfo[i][CurrentInterior] >= 18)
  295. {
  296. NormalString[0] = EOS;
  297. format(NormalString, sizeof(NormalString),"Powerplant in Missionary Hill");
  298. format(UserInfo[i][LocZone], 100, NormalString);
  299. new position = strfind(NormalString, "in", true);
  300. if(position != -1)
  301. {
  302. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ");
  303. strins(UserInfo[i][LocZone], "~n~", position);
  304. }
  305. else
  306. {
  307. PlayerTextDrawSetString(i, plaInfoBox[i], "~n~ ~n~ ~n~ ~n~ ~n~ ");
  308. }
  309. PlayerTextDrawSetString(i, plaInfoLocation[i], UserInfo[i][LocZone]);
  310. UserInfo[i][LocationZone][0] = EOS;
  311. format(UserInfo[i][LocationZone], 100, NormalString);
  312. }
  313. if(UserInfo[i][CurrentInterior] == 7 && j == 405)
  314. {
  315. if(player_zone[i] == -1) player_zone[i] = player_zone_before[i];
  316. break;
  317. }
  318. }
  319. if(player_zone[i] == -1) player_zone[i] = player_zone_before[i];
  320. }
  321. }
  322. return 1;
  323. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement