Advertisement
Guest User

Untitled

a guest
Nov 14th, 2010
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.99 KB | None | 0 0
  1. forward OneSec();
  2. public OneSec( )
  3. {
  4. UpdateSpeedo();
  5.  
  6. foreach(Player, playerid) {
  7. new Float:Health;
  8. GetPlayerHealth(playerid, Health);
  9. SetProgressBarValue(healthbar[playerid], Health);
  10. UpdateProgressBar(healthbar[playerid], playerid);
  11. UpdateMoney(playerid);
  12. if(GetPVarInt(playerid, "Engine_Progress") > 0){
  13. SetPVarInt(playerid, "Engine_Progress", GetPVarInt(playerid, "Engine_Progress") + 1);
  14. }
  15. if(GetPVarInt(playerid, "Engine_Progress") == 4){
  16. SetPVarInt(playerid, "Engine_Progress", 0);
  17. format(string, sizeof(string), "Engine starts (( %s ))", AccountData[playerid][PlayerName]);
  18. SendLocalMessage(playerid, string, 10.0, COLOR_ME, COLOR_ME);
  19. new VehID = GetPlayerVehicleID(playerid);
  20. VehicleInfo[VehID][vEngine] = 1;
  21. TogglePlayerControllable(playerid, true);
  22. }
  23. if(GetPVarInt(playerid, "Been_Fuel") == 1) {
  24. TogglePlayerControllable(playerid, true);
  25. SetPVarInt(playerid, "Been_Fuel", 0);
  26. }
  27. if(IsPlayerInFishZone(playerid) == 1 && GetPVarInt(playerid, "FishZone") != 1) {
  28. SetPVarInt(playerid, "FishZone", 1);
  29. GameTextForPlayer(playerid, "~r~You have entered fish zone 1.", 9000, 5);
  30. //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 1, here you can catch~n~~y~Steel Pompano | Salema | Freckled porcupinefish | Blacksmith");
  31. }
  32. else
  33. if(IsPlayerInFishZone(playerid) == 2 && GetPVarInt(playerid, "FishZone") != 2) {
  34. SetPVarInt(playerid, "FishZone", 2);
  35. GameTextForPlayer(playerid, "~r~You have entered fish zone 2.", 9000, 5);
  36. //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 2, here you can catch~n~~y~Connie's Damsel | Black perch | Black tetra | Salema");
  37. }
  38. else
  39. if(IsPlayerInFishZone(playerid) == 3 && GetPVarInt(playerid, "FishZone") != 3) {
  40. SetPVarInt(playerid, "FishZone", 3);
  41. GameTextForPlayer(playerid, "~r~You have entered fish zone 3.", 9000, 5);
  42. //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 3, here you can catch~n~~y~Black perch | Yellow longnose butterflyfish | White-tailed damselfish | Panther grouper");
  43. }
  44. else
  45. if(IsPlayerInFishZone(playerid) == 4 && GetPVarInt(playerid, "FishZone") != 4) {
  46. SetPVarInt(playerid, "FishZone", 4);
  47. GameTextForPlayer(playerid, "~r~You have entered fish zone 4.", 9000, 5);
  48. // EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 4, here you can catch~n~~y~Harlequin tuskfish | Pacific spadefish | Blue-spotted jack | Green jack");
  49. }
  50. else
  51. if(IsPlayerInFishZone(playerid) == 5 && GetPVarInt(playerid, "FishZone") != 5) {
  52. SetPVarInt(playerid, "FishZone", 5);
  53. GameTextForPlayer(playerid, "~r~You have entered fish zone 5.", 9000, 5);
  54. //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 5, here you can catch~n~~y~Ornate Cowfish | Clown anemonefish | Zebra perch");
  55. }
  56. if(GetPVarInt(playerid, "Refueling") > -1) {
  57. if(GasInfo[GetPVarInt(playerid, "Refueling")][gAmount] < 0) {
  58. SendError(playerid, "There's no gas left!");
  59. TogglePlayerControllable(playerid, true);
  60. SetPVarInt(playerid, "Refueling", -1);
  61. }
  62. if(GetPlayerMoney(playerid) > GasInfo[GetPVarInt(playerid, "Refueling")][gPrice]) {
  63. new VehID = GetPlayerVehicleID(playerid);
  64. GivePlayerMoney(playerid, -1);
  65. VehicleInfo[VehID][Fuel] += 3;
  66. GasInfo[GetPVarInt(playerid, "Refueling")][gAmount] -= 3;
  67. GameTextForPlayer(playerid, "~r~Refueling!~n~Press ENTER to stop refueling.", 9000, 5);
  68. BusinessInfo[GasInfo[GetPVarInt(playerid, "Refueling")][gLinked]][bBank] += GasInfo[GetPVarInt(playerid, "Refueling")][gPrice]*3;
  69. SavePlayerGasStation(GetPVarInt(playerid, "Refueling"));
  70. if(VehicleInfo[VehID][Fuel] > 100) {
  71. VehicleInfo[VehID][Fuel] = 100;
  72. }
  73.  
  74. }
  75. else {
  76. SendError(playerid, "You don't have enough money!");
  77. TogglePlayerControllable(playerid, true);
  78. SetPVarInt(playerid, "Refueling", -1);
  79. }
  80. }
  81. if(IsPlayerInAnyVehicle(playerid)) {
  82. new VehID = GetPlayerVehicleID(playerid);
  83. if(VehicleInfo[VehID][Fuel] == 0) {
  84. GameTextForPlayer(playerid, "~r~This vehicle has no fuel!~n~Press ENTER to get out of it.", 3000, 5);
  85. //SendClientMessage(playerid, COLOR_GREY, "The vehicle is out of fuel, you should buy a gas can or you should call a mechanic!");
  86. TogglePlayerControllable(playerid, false);
  87. }
  88. }
  89. if(GetPVarInt(playerid, "Hotwire_Progress") > 0) {
  90. if(GetPVarInt(playerid, "Hotwire_Progress") == 30) {
  91. new Success = random(100);
  92. if(Success < 70) {
  93. SendClientMessage(playerid, COLOR_GREY, "You didn't succed to hotwire this vehicle, you can try again!");
  94. return 1;
  95. }
  96. new VehID;
  97. VehID = GetPlayerVehicleID(playerid);
  98. SetPVarInt(playerid, "Hotwire_Progress", 0);
  99. TogglePlayerControllable(playerid, true);
  100. VehicleInfo[VehID][vHotwired] = 1;
  101. format(string, sizeof(string), "Engine starts (( %s ))", AccountData[playerid][PlayerName]);
  102. SendLocalMessage(playerid, string, 10.0, COLOR_ME, COLOR_ME);
  103. //SendFormattedMessage(playerid, COLOR_YELLOW, "Progress %d ", GetPVarInt(playerid, "Hotwire_Progress"));
  104. return 1;
  105. //ClearAnimations(playerid);
  106. }
  107. SetPVarInt(playerid, "Hotwire_Progress", GetPVarInt(playerid, "Hotwire_Progress") + 1);
  108. GameTextForPlayer(playerid, "~g~Hotwiring...", 9000, 5);
  109. //SendFormattedMessage(playerid, COLOR_YELLOW, "Progress %d ", GetPVarInt(playerid, "Hotwire_Progress"));
  110. }
  111. if(AccountData[playerid][Other] > 0) {
  112. new FactoryID = GetPVarInt(playerid, "InFactory");
  113. if(IsPlayerInRangeOfPoint(playerid, 20.0, FactoryInfo[FactoryID][fPos][0],FactoryInfo[FactoryID][fPos][1],FactoryInfo[FactoryID][fPos][2]) != 1) return AccountData[playerid][Other] = 0;
  114. }
  115. foreach(House, h) {
  116. if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ])) {
  117. if(HouseInfo[h][hSQLIDowner] == -1) {
  118. format(string, sizeof(string), "~w~House For Sale~n~~w~Level:~r~ %d~n~~w~Sell Price:~r~ %s~n~~w~Rent Cost:~r~ %d", HouseInfo[h][hLevel], FormatMoney(HouseInfo[h][hSell]), HouseInfo[h][hRent]);
  119. EUM_ShowForPlayer(playerid, 1, "~g~House for sale!", string);
  120. //GameTextForPlayer(playerid, string, 3000, 4);
  121. Houseinfo[playerid] = 1;
  122. }
  123. if(HouseInfo[h][hSQLIDowner] != - 1) {
  124. format(string, sizeof(string), "~w~Owned House~n~~w~Level:~r~ %d~n~~w~Rent Cost:~r~ %d", HouseInfo[h][hLevel], HouseInfo[h][hRent]);
  125. EUM_ShowForPlayer(playerid, 1, "~r~Owned house!", string);
  126. //GameTextForPlayer(playerid, string, 3000, 4);
  127. Houseinfo[playerid] = 1;
  128. }
  129. }
  130. }
  131. new descriptionstring[128];
  132. foreach(Business, b) {
  133. if(IsPlayerInRangeOfPoint(playerid, 3.0, BusinessInfo[b][bPos][0], BusinessInfo[b][bPos][1], BusinessInfo[b][bPos][2])) {
  134. if(BusinessInfo[b][bType] == 1) { format(descriptionstring, 128, "This is a business what sells ~g~weapons."); }
  135. if(BusinessInfo[b][bType] == 2) { format(descriptionstring, 128, "This is business is a restaurant business."); }
  136. if(/*BusinessInfo[b][bSQLIDowner] == -1 &&*/ BusinessInfo[b][bSell] > 1 && BusinessInfo[b][bStatus] == 1) {
  137. format(string, sizeof(string), "~w~Business for sale~n~~w~Description:~n~%s~n~~n~~w~Base Price:~r~ %d~n~",descriptionstring, BusinessInfo[b][bSell]);
  138. //GameTextForPlayer(playerid, string, 3000, 4);
  139. EUM_ShowForPlayer(playerid, 1, "~g~Business for sale!", string);
  140. }
  141. if(BusinessInfo[b][bSQLIDowner] != -1) {
  142. format(string, sizeof(string), "~w~Owned Business~n~~w~Description:~n~%s",descriptionstring, BusinessInfo[b][bSell]);
  143. EUM_ShowForPlayer(playerid, 1, "~y~Owned Business!", string);
  144. //GameTextForPlayer(playerid, string, 3000, 4);
  145. }
  146. }
  147. foreach(Jobs, j) {
  148. if(IsPlayerInRangeOfPoint(playerid, 3.0, JobInfo[j][jPos][0], JobInfo[j][jPos][1], JobInfo[j][jPos][2])) {
  149. new JobString[24];
  150. format(string, sizeof(string), "~y~%s~n~~n~%s~n~Agreement:%i hours",JobInfo[j][jName], JobInfo[j][jDescription], JobInfo[j][jHours]);
  151. EUM_ShowForPlayer(playerid, 1, "~y~ ~<~ Job Information ~>~", string);
  152. }
  153. }
  154. new vehicleid;
  155. new trailerid;
  156. vehicleid = GetPlayerVehicleID(playerid);
  157. trailerid = GetVehicleTrailer(vehicleid);
  158. if(AccountData[playerid][Other] == 1) {
  159. if(TrailerInfo[trailerid][tType] == 1 && TrailerInfo[trailerid][pAmount] < 30) {
  160. if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
  161. new TakeOff = 1;
  162. if(TrailerInfo[trailerid][pAmount] == 29) {
  163. SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
  164. AccountData[playerid][Other] = 0;
  165. TrailerInfo[trailerid][pAmount] ++;
  166. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  167. format(string, sizeof(string), "~w~~n~Type:~y~Weapons~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
  168. EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
  169. return 1;
  170. }
  171. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  172. TrailerInfo[trailerid][pAmount] ++;
  173. format(string, sizeof(string), "~w~~n~Type:~y~Weapons~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  174. EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
  175. SendFormattedMessage(playerid, COLOR_YELLOW, " AN: %f", FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  176. return 1;
  177. }
  178. }
  179. if(GetPVarInt(playerid, "PlayerInBooth") < -1) {
  180. new i = GetPVarInt(playerid, "PlayerInBooth");
  181. if(IsPlayerInRangeOfPoint(playerid, 1.5,PhoneBooth[i][pbC][0], PhoneBooth[i][pbC][1], PhoneBooth[i][pbC][2]) == 1) {
  182. SendClientMessage(Caller[playerid], COLOR_GREY, "The caller has dropped the call!");
  183. SendClientMessage(playerid, COLOR_GREY, "You have dropped the call!");
  184. Pickup[playerid] = 0;
  185. Pickup[Caller[playerid]] = 0;
  186. Caller[playerid] = 0;
  187. Caller[Caller[playerid]] = 0;
  188. SetPVarInt(playerid, "PlayerInBooth", 0);
  189. PhoneBooth[i][Active] = 1;
  190. return 1;
  191. }
  192. }
  193. vehicleid = GetPlayerVehicleID(playerid);
  194. trailerid = GetVehicleTrailer(vehicleid);
  195. if(AccountData[playerid][Other] == 3) {
  196. if(TrailerInfo[trailerid][tType] == 3 && TrailerInfo[trailerid][pAmount] < 100) {
  197. if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
  198. new TakeOff = 1;
  199. if(TrailerInfo[trailerid][pAmount] == 99) {
  200. SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
  201. AccountData[playerid][Other] = 0;
  202. TrailerInfo[trailerid][pAmount] ++;
  203. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  204. format(string, sizeof(string), "~w~~n~Type:~y~Electronics~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
  205. EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
  206. return 1;
  207. }
  208. TrailerInfo[trailerid][pAmount] ++;
  209. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  210. format(string, sizeof(string), "~w~~n~Type:~y~Electronics~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  211. EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
  212. return 1;
  213. }
  214. }
  215. vehicleid = GetPlayerVehicleID(playerid);
  216. trailerid = GetVehicleTrailer(vehicleid);
  217. if(AccountData[playerid][Other] == 2) {
  218. if(TrailerInfo[trailerid][tType] == 2 && TrailerInfo[trailerid][pAmount] < 200) {
  219. if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
  220. new TakeOff = 1;
  221. if(TrailerInfo[trailerid][pAmount] == 199) {
  222. SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
  223. AccountData[playerid][Other] = 0;
  224. TrailerInfo[trailerid][pAmount] ++;
  225. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  226. format(string, sizeof(string), "~w~~n~Type:~y~Food~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
  227. EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
  228. return 1;
  229. }
  230. TrailerInfo[trailerid][pAmount] ++;
  231. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  232. format(string, sizeof(string), "~w~~n~Type:~y~Food~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  233. EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
  234. return 1;
  235. }
  236. }
  237. vehicleid = GetPlayerVehicleID(playerid);
  238. trailerid = GetVehicleTrailer(vehicleid);
  239. if(AccountData[playerid][Other] == 4) {
  240. if(TrailerInfo[trailerid][tType] == 4 && TrailerInfo[trailerid][pAmount] < 50) {
  241. if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
  242. new TakeOff = 1;
  243. if(TrailerInfo[trailerid][pAmount] == 49) {
  244. SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
  245. AccountData[playerid][Other] = 0;
  246. TrailerInfo[trailerid][pAmount] ++;
  247. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  248. format(string, sizeof(string), "~w~~n~Type:~y~Other~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
  249. EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
  250. return 1;
  251. }
  252. TrailerInfo[trailerid][pAmount] ++;
  253. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  254. format(string, sizeof(string), "~w~~n~Type:~y~Other~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  255. EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
  256. //SendFormattedMessage(playerid, COLOR_YELLOW, " AN: %0.2f", FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  257. return 1;
  258. }
  259. }
  260. vehicleid = GetPlayerVehicleID(playerid);
  261. trailerid = GetVehicleTrailer(vehicleid);
  262. if(AccountData[playerid][Other] == 5) {
  263. if(TrailerInfo[trailerid][tType] == 5 && TrailerInfo[trailerid][pAmount] < 300) {
  264. if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
  265. new TakeOff = 1;
  266. if(TrailerInfo[trailerid][pAmount] == 299) {
  267. SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
  268. AccountData[playerid][Other] = 0;
  269. TrailerInfo[trailerid][pAmount] ++;
  270. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  271. format(string, sizeof(string), "~w~~n~Type:~y~Drinks~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
  272. EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
  273. return 1;
  274. }
  275. TrailerInfo[trailerid][pAmount] ++;
  276. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  277. format(string, sizeof(string), "~w~~n~Type:~y~Drinks~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  278. EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
  279. SendFormattedMessage(playerid, COLOR_YELLOW, " AN: %0.2f", FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  280. return 1;
  281. }
  282. }
  283. vehicleid = GetPlayerVehicleID(playerid);
  284. trailerid = GetVehicleTrailer(vehicleid);
  285. if(AccountData[playerid][Other] == 6) {
  286. if(TrailerInfo[trailerid][tType] == 6 && TrailerInfo[trailerid][pAmount] < 500) {
  287. if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
  288. new TakeOff = 4;
  289. if(TrailerInfo[trailerid][pAmount] == 499) {
  290. SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
  291. AccountData[playerid][Other] = 0;
  292. TrailerInfo[trailerid][pAmount] += 4;
  293. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  294. format(string, sizeof(string), "~w~~n~Type:~y~Oil (litres)~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
  295. EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
  296. return 1;
  297. }
  298. TrailerInfo[trailerid][pAmount] += 4;
  299. FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
  300. format(string, sizeof(string), "~w~~n~Type:~y~Oil~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
  301. EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
  302. return 1;
  303. }
  304. }
  305. foreach(Factory, f) {
  306. if(FactoryInfo[f][fBank] < 2) { continue; }
  307. FactoryInfo[f][fStock] += FactoryInfo[f][ProduceRate];
  308. }
  309.  
  310. }
  311.  
  312. }
  313.  
  314.  
  315. return 1;
  316. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement