Advertisement
Guest User

Sampi

a guest
May 1st, 2009
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.28 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. /*
  4. =========Nebenjob Los Santos Bahnhof+Neuer Bahnhof=========
  5. =========Version 1.0 von Sampi=========
  6. DAS NICHT ENTFERNEN!!!
  7. =========|||>BEFEHLE<|||=========
  8. =/onduty - In Dienst gehen
  9. =/offduty - Ausser Dienst gehen
  10. =/cam1 - Kamera 1 ansehen
  11. =/cam2 - Kamera 2 ansehen
  12. =/back - Kamera 1 oder 2 ausschalten
  13. =========|||>FUNKIONEN<|||=========
  14. =Dienstkleidung
  15. =Zwei Kameras
  16. =Gehalt
  17. */
  18.  
  19. #define COLOR_GREY 0xAFAFAFAA
  20. #define COLOR_LIGHTBLUE 0x33CCFFAA
  21.  
  22. new lse;
  23. new lsa;
  24. new cam1;
  25. new cam2;
  26. new OldSkin[MAX_PLAYERS] = -1;
  27. new gehalt;
  28.  
  29. forward gehalt2(playerid);
  30.  
  31. public OnGameModeInit()
  32. {
  33. // Pickups
  34. lse = CreatePickup(1239, 23, 1733.5177,-1929.0050,13.5711); // LS Bahnhof Eingang
  35. lsa = CreatePickup(1239, 23, 2540.5537,-1671.6218,-87.7424); // LS Bahnhof Ausgang
  36. cam1 = CreatePickup(1239, 23, 2508.8137,-1670.8013,-87.7359); // Kamera 1
  37. cam2 = CreatePickup(1239, 23, 2508.4312,-1672.9854,-87.7424); // Kamera 2
  38. // Objecte
  39. CreateObject(638, 1777.262085, -1949.639648, 13.806588, 0.0000, 0.0000, 270.0000);
  40. CreateObject(638, 1774.586670, -1949.632324, 13.806588, 0.0000, 0.0000, 270.0000);
  41. CreateObject(638, 1765.231323, -1949.784912, 13.806588, 0.0000, 0.0000, 270.0000);
  42. CreateObject(638, 1762.626953, -1949.786133, 13.806588, 0.0000, 0.0000, 270.0000);
  43. CreateObject(638, 1741.922241, -1949.799927, 13.814221, 0.0000, 0.0000, 270.0000);
  44. CreateObject(638, 1739.244507, -1949.792725, 13.814221, 0.0000, 0.0000, 270.0000);
  45. CreateObject(638, 1730.272339, -1949.693726, 13.814221, 0.0000, 0.0000, 270.0000);
  46. CreateObject(638, 1727.614014, -1949.688110, 13.814221, 0.0000, 0.0000, 270.0000);
  47. CreateObject(638, 1712.119751, -1949.826538, 13.814221, 0.0000, 0.0000, 270.0000);
  48. CreateObject(638, 1709.437378, -1949.833740, 13.814221, 0.0000, 0.0000, 270.0000);
  49. CreateObject(638, 1698.235718, -1949.742188, 13.814221, 0.0000, 0.0000, 270.0000);
  50. CreateObject(638, 1695.541382, -1949.713745, 13.814221, 0.0000, 0.0000, 270.0000);
  51. CreateObject(982, 1774.747314, -1955.762939, 13.230430, 0.0000, 0.0000, 270.0000);
  52. CreateObject(982, 1749.121094, -1955.756958, 13.230430, 0.0000, 0.0000, 270.0000);
  53. CreateObject(982, 1723.529785, -1955.742432, 13.222657, 0.0000, 0.0000, 270.0000);
  54. CreateObject(982, 1697.890259, -1955.747192, 13.230430, 0.0000, 0.0000, 270.0000);
  55. CreateObject(983, 1681.867554, -1955.766235, 13.230430, 0.0000, 0.0000, 270.0000);
  56. CreateObject(1231, 1735.711182, -1949.755859, 15.847580, 0.0000, 0.0000, 270.0000);
  57. CreateObject(1231, 1705.001831, -1949.803345, 15.847580, 0.0000, 0.0000, 270.0000);
  58. CreateObject(1231, 1769.679443, -1949.716675, 15.839947, 0.0000, 0.0000, 270.0000);
  59. CreateObject(1232, 1751.778442, -1951.151123, 15.753830, 0.0000, 0.0000, 0.0000);
  60. CreateObject(1232, 1719.763062, -1951.209229, 15.753830, 0.0000, 0.0000, 0.0000);
  61. CreateObject(850, 1692.526245, -1958.350098, 7.361493, 0.0000, 0.0000, 0.0000);
  62. CreateObject(850, 1716.174438, -1945.740479, 12.667857, 0.0000, 0.0000, 0.0000);
  63. CreateObject(853, 1693.397949, -1955.518311, 7.649912, 0.0000, 0.0000, 56.2500);
  64. CreateObject(1264, 1693.256470, -1958.433228, 7.721244, 0.0000, 0.0000, 0.0000);
  65. CreateObject(1265, 1692.869629, -1956.694702, 7.717765, 0.0000, 0.0000, 0.0000);
  66. CreateObject(1328, 1693.797363, -1958.929688, 7.764764, 0.0000, 0.0000, 0.0000);
  67. CreateObject(1349, 1693.096802, -1960.596680, 7.820385, 0.0000, 0.0000, 45.0000);
  68. CreateObject(1349, 1684.308228, -1962.546509, 13.662573, 0.0000, 352.2651, 33.7500);
  69. CreateObject(1359, 1770.552979, -1949.526855, 13.808111, 0.0000, 0.0000, 0.0000);
  70. CreateObject(1359, 1736.416992, -1949.717896, 13.815744, 0.0000, 0.0000, 0.0000);
  71. CreateObject(1359, 1705.856812, -1949.906616, 13.815744, 0.0000, 0.0000, 0.0000);
  72. CreateObject(1369, 1693.350098, -1952.844360, 7.871065, 0.0000, 0.0000, 326.2500);
  73. CreateObject(1358, 1813.111572, -1962.704956, 13.750422, 0.0000, 0.0000, 0.0000);
  74. CreateObject(1429, 1691.654785, -1956.092529, 7.502806, 0.0000, 0.0000, 33.7500);
  75. CreateObject(1462, 1694.031128, -1949.033203, 7.314497, 0.0000, 0.0000, 270.0000);
  76. CreateObject(1549, 1694.944092, -1932.111572, 12.557828, 0.0000, 0.0000, 180.0000);
  77. CreateObject(1549, 1733.104614, -1949.792603, 13.117992, 0.0000, 0.0000, 180.0000);
  78. CreateObject(1549, 1759.046265, -1949.804810, 13.110359, 0.0000, 0.0000, 180.0000);
  79. CreateObject(1572, 1760.521606, -1936.487183, 13.154594, 0.0000, 0.0000, 0.0000);
  80. CreateObject(1572, 1760.584717, -1937.038818, 13.263676, 0.0000, 0.0000, 0.0000);
  81. CreateObject(1572, 1760.598389, -1937.490356, 13.285769, 0.0000, 0.0000, 0.0000);
  82. CreateObject(2670, 1761.367065, -1936.989624, 12.674360, 0.0000, 0.0000, 78.7500);
  83. CreateObject(2670, 1691.116211, -1957.224731, 7.342052, 0.0000, 0.0000, 90.0000);
  84. CreateObject(2671, 1691.926636, -1954.034668, 7.252551, 0.0000, 0.0000, 67.5000);
  85. CreateObject(2672, 1692.667969, -1959.004517, 7.529462, 0.0000, 0.0000, 45.0000);
  86. CreateObject(2673, 1742.493774, -1954.244019, 12.634703, 0.0000, 0.0000, 45.0000);
  87. CreateObject(2674, 1732.635742, -1950.042114, 13.138927, 0.0000, 0.0000, 0.0000);
  88. CreateObject(2670, 1735.541870, -1949.612671, 13.197410, 0.0000, 0.0000, 270.0000);
  89. CreateObject(2672, 1736.742798, -1949.410645, 13.396649, 0.0000, 0.0000, 45.0000);
  90. CreateObject(2676, 1772.518433, -1949.705688, 13.212878, 0.0000, 0.0000, 0.0000);
  91. CreateObject(2677, 1706.118530, -1950.206787, 13.389205, 0.0000, 0.0000, 0.0000);
  92. CreateObject(2676, 1708.054565, -1953.958984, 12.650199, 0.0000, 0.0000, 33.7500);
  93. CreateObject(2673, 1760.027100, -1953.823975, 12.634703, 0.0000, 0.0000, 45.0000);
  94. CreateObject(2671, 1773.998779, -1953.909912, 12.549426, 0.0000, 0.0000, 0.0000);
  95. CreateObject(3594, 1828.783203, -1947.727417, 13.178052, 0.0000, 0.0000, 236.2501);
  96. CreateObject(12957, 1799.285400, -1986.206909, 13.403619, 0.0000, 0.0000, 315.0000);
  97. // Interior
  98. CreateObject(18553, 2517.442871, -1655.865479, -87.450432, 179.5183, 359.1406, 91.7189);
  99. CreateObject(14602, 2526.675781, -1671.642090, -83.375191, 0.0000, 0.0000, 0.0000);
  100. CreateObject(18553, 2522.952148, -1678.866821, -87.450432, 179.5183, 359.1406, 91.7189);
  101. CreateObject(1522, 2541.370605, -1672.370605, -88.760590, 0.0000, 0.0000, 90.0000);
  102. CreateObject(1663, 2509.104004, -1671.966797, -88.275658, 0.0000, 0.0000, 90.0000);
  103. CreateObject(14772, 2509.214844, -1674.295532, -87.825294, 0.0000, 0.0000, 202.5000);
  104. CreateObject(14772, 2509.829590, -1673.835815, -87.825294, 0.0000, 0.0000, 225.0000);
  105. CreateObject(14772, 2510.305908, -1673.246338, -87.825294, 0.0000, 0.0000, 236.2501);
  106. CreateObject(14772, 2510.619385, -1672.589722, -87.818611, 0.0000, 0.0000, 247.5000);
  107. CreateObject(14772, 2510.762451, -1671.814941, -87.825294, 0.0000, 0.0000, 270.0000);
  108. CreateObject(14772, 2510.643555, -1671.035889, -87.825294, 0.0000, 0.0000, 292.5000);
  109. CreateObject(14772, 2510.295654, -1670.333740, -87.825294, 0.0000, 0.0000, 303.7500);
  110. CreateObject(14772, 2509.711426, -1669.763794, -87.825294, 0.0000, 0.0000, 326.2500);
  111. CreateObject(14772, 2509.088135, -1669.419678, -87.825294, 0.0000, 0.0000, 337.5000);
  112. CreateObject(14772, 2508.416260, -1669.295532, -87.818611, 0.0000, 0.0000, 0.0000);
  113. CreateObject(14772, 2508.402100, -1674.451416, -87.825294, 0.0000, 0.0000, 180.0000);
  114. CreateObject(955, 2525.776123, -1656.365356, -88.332832, 0.0000, 0.0000, 0.0000);
  115. CreateObject(956, 2522.089355, -1678.608276, -88.338364, 0.0000, 0.0000, 180.0000);
  116.  
  117. return 1;
  118. }
  119.  
  120. public OnGameModeExit()
  121. {
  122. return 1;
  123. }
  124.  
  125. public OnPlayerRequestClass(playerid, classid)
  126. {
  127. return 1;
  128. }
  129.  
  130. public OnPlayerRequestSpawn(playerid)
  131. {
  132. return 1;
  133. }
  134.  
  135. public OnPlayerConnect(playerid)
  136. {
  137. return 1;
  138. }
  139.  
  140. public OnPlayerDisconnect(playerid, reason)
  141. {
  142. return 1;
  143. }
  144.  
  145. public OnPlayerSpawn(playerid)
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerDeath(playerid, killerid, reason)
  151. {
  152. return 1;
  153. }
  154.  
  155. public OnVehicleSpawn(vehicleid)
  156. {
  157. return 1;
  158. }
  159.  
  160. public OnVehicleDeath(vehicleid, killerid)
  161. {
  162. return 1;
  163. }
  164.  
  165. public OnPlayerText(playerid, text[])
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnPlayerPrivmsg(playerid, recieverid, text[])
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnPlayerCommandText(playerid, cmdtext[])
  176. {
  177. if(strcmp(cmdtext, "/onduty", true) == 0 || strcmp(cmdtext, "/indienst", true) == 0)
  178. {
  179. if(PlayerToPoint(3, playerid, 1733.5177,-1929.0050,13.5711))
  180. {
  181. if(OldSkin[playerid] == -1)
  182. {
  183. SetPlayerPos(playerid,2537.9233,-1671.5131,-87.7424);
  184. GameTextForPlayer(playerid, "Du bist nun in ~g~Dienst~n~~w~Beachte nun bitte den Bahnverkehr.", 5000, 5);
  185. OldSkin[playerid] = GetPlayerSkin(playerid);
  186. SetPlayerSkin(playerid, 166);
  187. gehalt = SetTimer("gehalt2", 600000, 1);
  188. return 1;
  189. }
  190. }
  191. }
  192. if(strcmp(cmdtext, "/offduty", true) == 0 || strcmp(cmdtext, "/ausserdienst", true) == 0)
  193. {
  194. if(PlayerToPoint(3, playerid, 2540.5537,-1671.6218,-87.7424))
  195. {
  196. GameTextForPlayer(playerid, "Du bist nun ausser ~r~Dienst.", 5000, 5);
  197. SetPlayerPos(playerid,1730.8274,-1928.8726,13.5703);
  198. SetPlayerSkin(playerid, OldSkin[playerid]);
  199. OldSkin[playerid] = -1;
  200. KillTimer(gehalt);
  201. return 1;
  202. }
  203. }
  204. if(strcmp(cmdtext, "/cam1", true) == 0 || strcmp(cmdtext, "/kamera1", true) == 0)
  205. {
  206. if(PlayerToPoint(1, playerid, 2508.8137,-1670.8013,-87.7359))
  207. {
  208. SetPlayerCameraPos(playerid, 1706.4597,-1954.2412,13.5469);
  209. SetPlayerCameraLookAt(playerid, 1679.2902,-1953.9602,13.5469);
  210. GameTextForPlayer(playerid, "Kamera ~r~1.", 3000, 5);
  211. TogglePlayerControllable(playerid,0);
  212. SendClientMessage(playerid, COLOR_GREY, "***Benutze /back um die Kamera auszuschalten.");
  213. return 1;
  214. }
  215. }
  216. if(strcmp(cmdtext, "/cam2", true) == 0 || strcmp(cmdtext, "/kamera2", true) == 0)
  217. {
  218. if(PlayerToPoint(1, playerid, 2508.4312,-1672.9854,-87.7424))
  219. {
  220. SetPlayerCameraPos(playerid, 1846.5137,-1954.2433,13.5547);
  221. SetPlayerCameraLookAt(playerid, 1846.5137,-1954.2433,13.5547);
  222. GameTextForPlayer(playerid, "Kamera ~r~2.", 3000, 5);
  223. TogglePlayerControllable(playerid,0);
  224. SendClientMessage(playerid, COLOR_GREY, "***Benutze /back um die Kamera auszuschalten.");
  225. return 1;
  226. }
  227. }
  228. if(strcmp(cmdtext, "/back", true) == 0 || strcmp(cmdtext, "/zurueck", true) == 0)
  229. {
  230. if(PlayerToPoint(3, playerid, 2508.8137,-1670.8013,-87.7359))
  231. {
  232. GameTextForPlayer(playerid, "Kamera ~b~1~w~ ~r~ausgeschaltet.", 5000, 5);
  233. SetPlayerPos(playerid,2508.8137,-1670.8013,-87.7359);
  234. SetCameraBehindPlayer(playerid);
  235. TogglePlayerControllable(playerid,1);
  236. return 1;
  237. }
  238. else if(PlayerToPoint(3, playerid, 2508.4312,-1672.9854,-87.7424))
  239. {
  240. GameTextForPlayer(playerid, "Kamera ~b~2~w~ ~r~ausgeschaltet.", 5000, 5);
  241. SetPlayerPos(playerid,2508.4312,-1672.9854,-87.7424);
  242. SetCameraBehindPlayer(playerid);
  243. TogglePlayerControllable(playerid,1);
  244. return 1;
  245. }
  246. }
  247. return 0;
  248. }
  249.  
  250. public OnPlayerInfoChange(playerid)
  251. {
  252. return 1;
  253. }
  254.  
  255. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  256. {
  257. return 1;
  258. }
  259.  
  260. public OnPlayerExitVehicle(playerid, vehicleid)
  261. {
  262. return 1;
  263. }
  264.  
  265. public OnPlayerStateChange(playerid, newstate, oldstate)
  266. {
  267. return 1;
  268. }
  269.  
  270. public OnPlayerEnterCheckpoint(playerid)
  271. {
  272. return 1;
  273. }
  274.  
  275. public OnPlayerLeaveCheckpoint(playerid)
  276. {
  277. return 1;
  278. }
  279.  
  280. public OnPlayerEnterRaceCheckpoint(playerid)
  281. {
  282. return 1;
  283. }
  284.  
  285. public OnPlayerLeaveRaceCheckpoint(playerid)
  286. {
  287. return 1;
  288. }
  289.  
  290. public OnRconCommand(cmd[])
  291. {
  292. return 1;
  293. }
  294.  
  295. public OnObjectMoved(objectid)
  296. {
  297. return 1;
  298. }
  299.  
  300. public OnPlayerObjectMoved(playerid, objectid)
  301. {
  302. return 1;
  303. }
  304.  
  305. public OnPlayerPickUpPickup(playerid, pickupid)
  306. {
  307. if(pickupid == lse)
  308. {
  309. GameTextForPlayer(playerid, "Benutze ~g~/onduty~w~ um in Dienst zugehen.", 5000, 5);
  310. }
  311. if(pickupid == lsa)
  312. {
  313. GameTextForPlayer(playerid, "Benutze ~r~/offduty~w~ um ausser Dienst zugehen.", 5000, 5);
  314. }
  315. if(pickupid == cam1)
  316. {
  317. GameTextForPlayer(playerid, "Benutze ~g~/cam1~w~ um Kamera 1 einzuschalten.", 5000, 5);
  318. }
  319. if(pickupid == cam2)
  320. {
  321. GameTextForPlayer(playerid, "Benutze ~g~/cam2~w~ um Kamera 2 einzuschalten.", 5000, 5);
  322. }
  323. return 1;
  324. }
  325.  
  326. public OnPlayerSelectedMenuRow(playerid, row)
  327. {
  328. return 1;
  329. }
  330.  
  331. public OnPlayerExitedMenu(playerid)
  332. {
  333. return 1;
  334. }
  335.  
  336. public gehalt2(playerid)
  337. {
  338. for (new i = 0; i < MAX_PLAYERS; i++) {
  339. SendClientMessage(i,COLOR_LIGHTBLUE,"Gehalt: 1000$");
  340. GivePlayerMoney(playerid, 1000); // Gehalt
  341. }
  342. return 1;
  343. }
  344.  
  345. PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
  346. {
  347. new Float:oldpos[3], Float:temppos[3];
  348. GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
  349. temppos[0] = (oldpos[0] -X);
  350. temppos[1] = (oldpos[1] -Y);
  351. temppos[2] = (oldpos[2] -Z);
  352. if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  353. {
  354. return true;
  355. }
  356. return false;
  357. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement