Dome

ArbeitsAmt

Aug 4th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. ////News
  2. new Menu:Arbeitsamt;
  3.  
  4. ////Forward
  5. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  6.  
  7. OnGameModeInit()
  8. {
  9. Arbeitsamt = CreateMenu("Arbeitsamt", 2, 200.0, 100.0, 150.0, 150.0);
  10. AddMenuItem(Arbeitsamt, 0, "Dedektiev");
  11. AddMenuItem(Arbeitsamt, 0, "Waffenhändler");
  12. AddMenuItem(Arbeitsamt, 0, "Taxifahrer");
  13. AddMenuItem(Arbeitsamt, 0, "Busfahrer");
  14. AddMenuItem(Arbeitsamt, 0, "Farmer");
  15. AddMenuItem(Arbeitsamt, 0, "Eismann");
  16. AddMenuItem(Arbeitsamt, 0, "Bodyguard");
  17. AddMenuItem(Arbeitsamt, 0, "Hotdogverkäufer");
  18. AddMenuItem(Arbeitsamt, 0, "Trucker");
  19. return 1;
  20. }
  21. OnPlayerSelectedMenuRow(playerid,row)
  22. {
  23. new Menu:CurrentMenu = GetPlayerMenu(playerid);
  24. if(CurrentMenu == Arbeitsamt)
  25. {
  26. switch(row)
  27. {
  28. case 0: //Dedektiev
  29. {
  30. SendClientMessage(playerid, COLOR_RED, "Den Job Dedektiev findest du hier im Rathaus!");
  31. SendClientMessage(playerid, COLOR_RED, "Diesen Job findest du eine Etage weiter oben!");
  32. }
  33. case 1: //Waffenhändler
  34. {
  35. SendClientMessage(playerid, COLOR_RED, "");
  36. SendClientMessage(playerid, COLOR_RED, "");
  37. }
  38. case 2: //Taxifahrer
  39. {
  40. CP[playerid] = 30;
  41. SetPlayerCheckpoint(playerid, 2421.5234, -1221.7491, 25.3997, 3.0);
  42. SendClientMessage(playerid, COLOR_RED, "");
  43. SendClientMessage(playerid, COLOR_RED, "");
  44. }
  45. case 3: //Busfahrer
  46. {
  47. CP[playerid] = 31;
  48. SetPlayerCheckpoint(playerid, 2166.3771, -1675.383, 15.0859, 3.0);
  49. SendClientMessage(playerid, COLOR_RED, "");
  50. SendClientMessage(playerid, COLOR_RED, "");
  51. }
  52. case 4: //Farmer
  53. {
  54. CP[playerid] = 32;
  55. SetPlayerCheckpoint(playerid, 1109.3317, -1796.3042, 16.5937, 3.0);
  56. SendClientMessage(playerid, COLOR_RED, "");
  57. SendClientMessage(playerid, COLOR_RED, "");
  58. }
  59. case 5: //Eismann
  60. {
  61. CP[playerid] = 33;
  62. SetPlayerCheckpoint(playerid, -1932.3859, 276.2117, 41.0391, 3.0);
  63. SendClientMessage(playerid, COLOR_RED, "");
  64. SendClientMessage(playerid, COLOR_RED, "");
  65. }
  66.  
  67. case 6: //Hotdogverkäufer
  68. {
  69. CP[playerid] = 34;
  70. SetPlayerCheckpoint(playerid, 2226.1716, -1718.1792, 13.5165, 3.0);
  71. SendClientMessage(playerid, COLOR_RED, "");
  72. SendClientMessage(playerid, COLOR_RED, "");
  73. }
  74. case 11: //Trucker
  75. {
  76. CP[playerid] = 39;
  77. SetPlayerCheckpoint(playerid, -77.7288, -1136.3897, 1.078, 3.0);
  78. SendClientMessage(playerid, COLOR_RED, "Gehe nun aus dem Rathaus und zu dem roten Punkt auf der Map");
  79. SendClientMessage(playerid, COLOR_RED, "Dort kannst du den gewuenschten Job bekommen!");
  80. }
  81.  
  82.  
  83. }
  84. OnPlayerEnterCheckpoint(playerid)
  85. {
  86. else if(CP[playerid] == 30)
  87. {
  88. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  89. CP[playerid] = 0;
  90. DisablePlayerCheckpoint(playerid);
  91. }
  92. else if(CP[playerid] == 31)
  93. {
  94. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  95. CP[playerid] = 0;
  96. DisablePlayerCheckpoint(playerid);
  97. }
  98. else if(CP[playerid] == 32)
  99. {
  100. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  101. CP[playerid] = 0;
  102. DisablePlayerCheckpoint(playerid);
  103. }
  104. else if(CP[playerid] == 33)
  105. {
  106. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  107. CP[playerid] = 0;
  108. DisablePlayerCheckpoint(playerid);
  109. }
  110. else if(CP[playerid] == 34)
  111. {
  112. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  113. CP[playerid] = 0;
  114. DisablePlayerCheckpoint(playerid);
  115. }
  116. else if(CP[playerid] == 35)
  117. {
  118. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  119. CP[playerid] = 0;
  120. DisablePlayerCheckpoint(playerid);
  121. }
  122. else if(CP[playerid] == 36)
  123. {
  124. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  125. CP[playerid] = 0;
  126. DisablePlayerCheckpoint(playerid);
  127. }
  128. else if(CP[playerid] == 37)
  129. {
  130. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  131. CP[playerid] = 0;
  132. DisablePlayerCheckpoint(playerid);
  133. }
  134. else if(CP[playerid] == 38)
  135. {
  136. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  137. CP[playerid] = 0;
  138. DisablePlayerCheckpoint(playerid);
  139. }
  140. else if(CP[playerid] == 39)
  141. {
  142. SendClientMessage(playerid, COLOR_RED, "Begib dich in das i!");
  143. CP[playerid] = 0;
  144. DisablePlayerCheckpoint(playerid);
  145. }
  146. OnPlayerCommandText(playerid, cmdtext[])
  147. {
  148. if(strcmp(cmdtext, "/jobs", true) == 0)
  149. {
  150. if (PlayerToPoint(15.0, playerid, x, y, z)) //Hier Koordinaten einfügen
  151. {
  152. ShowMenuForPlayer(Arbeitsamt, playerid);
  153. SendClientMessage(playerid, COLOR_GRAD1, " Arbeitsamtsystem by Speedfight (Genesis-Esports)!");
  154. }
  155. else
  156. {
  157. SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht am Arbeitsamt !");
  158. }
  159. }
  160. return 1;
  161. }
  162.  
  163. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  164. {
  165. if(IsPlayerConnected(playerid))
  166. {
  167. new Float:oldposx, Float:oldposy, Float:oldposz;
  168. new Float:tempposx, Float:tempposy, Float:tempposz;
  169. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  170. empposx = (oldposx -x);
  171. tempposy = (oldposy -y);
  172. tempposz = (oldposz -z);
  173. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  174. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  175. {
  176. r eturn 1;
  177. }
  178. }
  179. return 0;
  180. }
Advertisement
Add Comment
Please, Sign In to add comment