Guest User

Untitled

a guest
May 18th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. //________Sommerferien________//
  2.  
  3.  
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7. #include <foreach>
  8.  
  9. #define MIN_OS 4 //Anzahl der Spieler die da sein müssen.
  10. #define START_OS 20 //Zeit wann es Starten soll
  11.  
  12. #define X 2140.1648 // Position X
  13. #define Y 993.7104 // Position Y
  14. #define Z 10.8203 // Position Z
  15.  
  16. new SpeicherEvent[MAX_PLAYERS];
  17. new BlockEvent[MAX_PLAYERS];
  18.  
  19. new SpeicherOneshoot[MAX_PLAYERS];
  20. new SpielerOneshoot;
  21. new StartOneshoot;
  22. new TimeOneshoot;
  23. new TimerOneshoot;
  24. new Text:Oneshoot;
  25.  
  26. new Float:RandomOnedeSpawn[][] =
  27. {
  28. {288.7459, 169.3509, 1007.1718},
  29. {273.3204, 188.1061, 1007.1719},
  30. {263.6746, 170.5629, 1003.0234},
  31. {236.7647, 195.1310, 1008.1719},
  32. {257.2431, 185.3781, 1008.1719},
  33. {213.7057, 147.3681, 1003.0234},
  34. {212.9781, 166.3744, 1003.0234},
  35. {197.2282, 158.1888, 1003.0234},
  36. {210.9119, 184.9424, 1003.0313}
  37. };
  38.  
  39. public OnPlayerConnect(playerid)
  40. {
  41. SpeicherOneshoot[playerid] = 0;
  42. BlockEvent[playerid] = 0;
  43. SpeicherEvent[playerid] = 0;
  44. return 1;
  45. }
  46. public OnPlayerDisconnect(playerid)
  47. {
  48. if(SpeicherOneshoot[playerid] == 1) SpielerOneshoot--;
  49. return 1;
  50. }
  51. public OnPlayerCommandReceived(playerid, cmdtext[])
  52. {
  53. if(BlockEvent[playerid] == 1 && strcmp(cmdtext, "/osexit", true)) return SendClientMessage(playerid, -1, "Schreibe /osexit um OneShoot zu verlassen."), 0;
  54. return 1;
  55. }
  56.  
  57. public OnPlayerDeath(playerid, killerid, reason)
  58. {
  59. if(StartOneshoot == 1)
  60. {
  61. if(SpeicherOneshoot[playerid] == 1)
  62. {
  63. SpeicherOneshoot[playerid] = 0;
  64. SpeicherEvent[playerid] = 0;
  65. BlockEvent[playerid] = 0;
  66. TextDrawHideForPlayer(playerid, Oneshoot);
  67. }
  68. SpielerOneshoot--;
  69. }
  70. return 1;
  71. }
  72.  
  73. public OnFilterScriptInit()
  74. {
  75. StartOneshoot = 0;
  76. Oneshoot = TextDrawCreate(519.000000, 344.000000, "OneShoot: Spieler: Zeit:");
  77. TextDrawBackgroundColor(Oneshoot, 255);
  78. TextDrawFont(Oneshoot, 1);
  79. TextDrawLetterSize(Oneshoot, 0.519999, 1.099999);
  80. TextDrawColor(Oneshoot, -1);
  81. TextDrawSetOutline(Oneshoot, 0);
  82. TextDrawSetProportional(Oneshoot, 1);
  83. TextDrawSetShadow(Oneshoot, 1);
  84. TextDrawUseBox(Oneshoot, 1);
  85. TextDrawBoxColor(Oneshoot, 0x00000060);
  86. TextDrawTextSize(Oneshoot, 607.000000, 0.000000);
  87. return 1;
  88. }
  89. public OnFilterScriptExit()
  90. {
  91. for(new i = 0; i < GetMaxPlayers(); i++) TextDrawDestroy(Oneshoot);
  92. return 1;
  93. }
  94.  
  95. cmd(oneshoot, playerid, params[])
  96. {
  97. if(StartOneshoot == 1) return SendClientMessage(playerid, -1, "OneShoot ist Gestartet. ");
  98. if(SpeicherOneshoot[playerid] == 1) return SendClientMessage(playerid, -1, "Du bist schon fuer OneShoot Angemeldet. ");
  99. if(SpeicherEvent[playerid] == 1) return SendClientMessage(playerid, -1, "Du hast keine Zeit. ");
  100.  
  101. SendClientMessage(playerid, -1, "Du nimmst am OneShoot teil, um zu verlassen schreibe /osexit");
  102. SpielerOneshoot++;
  103. SpeicherOneshoot[playerid] = 1;
  104. SpeicherEvent[playerid] = 1;
  105.  
  106. if(SpielerOneshoot == MIN_OS)
  107. {
  108. SendClientMessageToAll(-1, "In 20 Sekunden Startet /OneShoot.");
  109. SetTimer("StartOneShoot", START_OS*1000, 0);
  110. }
  111. return 1;
  112. }
  113.  
  114. cmd(osexit, playerid, params[])
  115. {
  116. if(SpeicherOneshoot[playerid] == 0) return SendClientMessage(playerid, -1, "Du nimmst am OneShoot nicht Teil. ");
  117. if(StartOneshoot == 1)
  118. {
  119. if(SpeicherOneshoot[playerid] == 1)
  120. {
  121. SpielerOneshoot--;
  122. SetPlayerPos(playerid, X, Y, Z);
  123. SpeicherOneshoot[playerid] = 0;
  124. BlockEvent[playerid] = 0;
  125. SpeicherEvent[playerid] = 0;
  126. TextDrawHideForPlayer(playerid, Oneshoot);
  127. SetPlayerInterior(playerid, 0);
  128. SetPlayerVirtualWorld(playerid, 0);
  129. }
  130. }
  131. SpeicherOneshoot[playerid] = 0;
  132. BlockEvent[playerid] = 0;
  133. SpeicherEvent[playerid] = 0;
  134. SendClientMessage(playerid, -1, "Du hast Oneshoot verlassen ");
  135. return 1;
  136. }
  137.  
  138. forward StartOneShoot();
  139. public StartOneShoot()
  140. {
  141. StartOneshoot = 1;
  142. SendClientMessageToAll(-1, "OneShoot Gestartet. ");
  143. new LosujArene[1];
  144. foreach(Player, i)
  145. {
  146. if(SpeicherOneshoot[i] == 1)
  147. {
  148. TextDrawShowForPlayer(i, Oneshoot);
  149. BlockEvent[i] = 1;
  150. SetPlayerHealth(i, 25);
  151. SetPlayerArmour(i, 0);
  152. ResetPlayerWeapons(i);
  153. GivePlayerWeapon(i, 24, 500);
  154. switch(LosujArene[0])
  155. {
  156. case 0:
  157. {
  158. SetPlayerInterior(i, 3);
  159. SetPlayerVirtualWorld(i, 15);
  160. new rand = random(sizeof(RandomOnedeSpawn));
  161. SetPlayerPos(i, RandomOnedeSpawn[rand][0], RandomOnedeSpawn[rand][1], RandomOnedeSpawn[rand][2]);
  162. }
  163.  
  164. }
  165. }
  166. }
  167. TimeOneshoot = 0;
  168. TimeOneshoot = 180;
  169. KillTimer(TimerOneshoot);
  170. TimerOneshoot = SetTimer("EndeOneshoot", 1000, 1);
  171. return 1;
  172. }
  173.  
  174. forward EndeOneshoot();
  175. public EndeOneshoot()
  176. {
  177. TimeOneshoot--;
  178. new string[128];
  179. format(string, sizeof string, "~y~OneShoot: ~n~~g~Zeit: ~b~%d~n~~g~Spieler: ~b~%d", TimeOneshoot, SpielerOneshoot);
  180. TextDrawSetString(Oneshoot, string);
  181.  
  182. if(TimeOneshoot == 0)
  183. {
  184. SendClientMessageToAll(-1, "Niemand hat OneShoot Gewonnen, Restart!. ");
  185. KillTimer(TimerOneshoot);
  186. SpielerOneshoot = 0;
  187. StartOneshoot = 0;
  188. foreach(Player, i)
  189. {
  190. if(SpeicherOneshoot[i] == 1)
  191. {
  192. SpeicherOneshoot[i] = 0;
  193. BlockEvent[i] = 0;
  194. SpeicherEvent[i] = 0;
  195. TextDrawHideForPlayer(i, Oneshoot);
  196. SetPlayerPos(i, X, Y, Z);
  197. }
  198. }
  199. }
  200. if(SpielerOneshoot == 1)
  201. {
  202. KillTimer(TimerOneshoot);
  203. SpielerOneshoot = 0;
  204. StartOneshoot = 0;
  205. new string2[120];
  206. foreach(Player, i)
  207. {
  208. if(SpeicherOneshoot[i] == 1)
  209. {
  210. format(string2, sizeof string2, "Spieler %s [ID: %d] Gewinnt OneShoot. Preis 50000 € und 50 Respektpunkte. ", PlayerName(i), i);
  211. SendClientMessageToAll(-1, string2);
  212. SetPlayerScore(i, GetPlayerScore(i) +50);
  213. GameTextForPlayer(i, "respekt~n~~g~+50", 1000, 1);
  214. GivePlayerMoney(i, 50000);
  215. SpeicherOneshoot[i] = 0;
  216. SpeicherEvent[i] = 0;
  217. BlockEvent[i] = 0;
  218. TextDrawHideForPlayer(i, Oneshoot);
  219. SetPlayerVirtualWorld(i, 0);
  220. SetPlayerInterior(i, 0);
  221. SetPlayerPos(i, X, Y, Z);
  222. }
  223. }
  224. }
  225. if(SpielerOneshoot == 0)
  226. {
  227. KillTimer(TimerOneshoot);
  228. SpielerOneshoot = 0;
  229. StartOneshoot = 0;
  230. }
  231. return 1;
  232. }
  233.  
  234. stock PlayerName(playerid)
  235. {
  236. new name[24];
  237. GetPlayerName(playerid, name, sizeof name);
  238. return name;
  239. }
Advertisement
Add Comment
Please, Sign In to add comment