Advertisement
Guest User

mRLuxuRy

a guest
Jan 28th, 2010
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.44 KB | None | 0 0
  1. /*
  2. Canli bomba sistemi By mR.LuxuRy~
  3. */
  4. //--[Include]--
  5. #include <a_samp>
  6. //--[enum]--
  7. enum bomba
  8. {
  9. Kuruldumu,
  10. Alindimi,
  11. }
  12. //--[new]--
  13. new oBilgi[MAX_PLAYERS][bomba];
  14. new patlayici;
  15. new bomba1;
  16. //--[forward]--
  17. forward patlama(playerid);
  18. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  19. //------------------------------------------------------------------------------
  20. public OnFilterScriptInit()
  21. {
  22. print("\n--------------------------------------");
  23. print("Canli bomba sistemi By mR.LuxuRy~");
  24. print("--------------------------------------\n");
  25. return true;
  26. }
  27. //------------------------------------------------------------------------------
  28. public OnPlayerConnect(playerid)
  29. {
  30. SendClientMessage(playerid,0x7FFF00AA,"Bu server mR.LuxuRy'nin canli bomba sistemini kullanmaktadir. Daha fazla bilgi i�in /bombayardim.");
  31. return 1;
  32. }
  33. //------------------------------------------------------------------------------
  34. public OnPlayerCommandText(playerid, cmdtext[])
  35. {
  36. new Float:X,Float:Y,Float:Z;
  37. GetPlayerPos(playerid,X,Y,Z);
  38. if (strcmp("/bombayardim", cmdtext, true, 10) == 0)
  39. {
  40. SendClientMessage(playerid,0x7FFF00AA,"~mR.LuxuRy' nin canli bomba sistemi yardim menusu~");
  41. SendClientMessage(playerid,0x7FFF00AA,"Silah�iya giderek /bombaal yazip bomba alabilirsiniz.");
  42. SendClientMessage(playerid,0x7FFF00AA,"Bombanizi aldiktan sonra, �st�n�ze kurmaniz gerekmektedir.");
  43. SendClientMessage(playerid,0x7FFF00AA,"Bombayi kurmak i�in, /bombakur yaziniz.");
  44. SendClientMessage(playerid,0x7FFF00AA,"Artik hersey tamam. Birtek patlatmak kaldi geriye.");
  45. SendClientMessage(playerid,0x7FFF00AA,"&#304;nsanlarin toplu oldugu gidin ve /bombapatlat yazarak bombayi patlatin.");
  46. return true;
  47. }
  48. if (strcmp("/bombaal", cmdtext, true, 10) == 0)
  49. {
  50. //Silahcida mi, degil mi kontrol ediyor.
  51. if(PlayerToPoint(50,playerid,286.148987,-40.644398,1001.569946) || PlayerToPoint(50,playerid,286.800995,-82.547600,1001.539978) || PlayerToPoint(50,playerid,296.919983,-108.071999,1001.569946) || PlayerToPoint(50,playerid,314.820984,-141.431992,999.661987) || PlayerToPoint(50,playerid,316.524994,-167.706985,999.661987) || PlayerToPoint(50,playerid,302.292877,-143.139099,1004.062500) || PlayerToPoint(50,playerid,280.795104,-135.203353,1004.062500))
  52. {
  53. //Alindi mi?
  54. if(oBilgi[playerid][Alindimi] == 1)
  55. {
  56. SendClientMessage(playerid,0x7FFF00AA,"Bombayi zaten aldin!");
  57. return false;
  58. }
  59. //Kuruldu mu?
  60. else if(oBilgi[playerid][Kuruldumu] == 1)
  61. {
  62. SendClientMessage(playerid,0x7FFF00AA,"Bomba zaten kurulu!");
  63. return false;
  64. }
  65. //Parasi var mi?
  66. else if(GetPlayerMoney(playerid) >= 1500)
  67. {
  68. //Alindi mi?
  69. if(oBilgi[playerid][Alindimi] == 1)
  70. {
  71. SendClientMessage(playerid,0x7FFF00AA,"Bombayi zaten aldin!");
  72. return false;
  73. }
  74. //Kuruldu mu?
  75. else if(oBilgi[playerid][Kuruldumu] == 1)
  76. {
  77. SendClientMessage(playerid,0x7FFF00AA,"Bomba zaten kurulu!");
  78. return false;
  79. //Eger varsa.
  80. }else{
  81. oBilgi[playerid][Alindimi] = 1;
  82. GivePlayerMoney(playerid,-1500);
  83. GameTextForPlayer(playerid,"~g~~h~~h~-1500",3000,1);
  84. SendClientMessage(playerid,0x7FFF00AA,"Bombayi satin aldin. /bombakur yazarak bombayi kurabilirsin.");
  85. }
  86. //Eger yoksa.
  87. }
  88. else
  89. {
  90. SendClientMessage(playerid,0x7FFF00AA,"Paran yok!");
  91. }
  92. //Silah�ida degilse.
  93. }
  94. else
  95. {
  96. SendClientMessage(playerid,0x7FFF00AA,"Silah�ida degilsin!");
  97. }
  98. return true;
  99. }
  100. //------------------------------------------------------------------------------
  101. if (strcmp("/bombakur", cmdtext, true, 10) == 0)
  102. {
  103. //Kuruldu mu?
  104. if(oBilgi[playerid][Kuruldumu] == 1)
  105. {
  106. SendClientMessage(playerid,0x7FFF00AA,"Bomba zaten kurulu!");
  107. return false;
  108. }
  109. //Alindi mi?
  110. else if(oBilgi[playerid][Alindimi] == 1)
  111. {
  112. //Kurulmadi mi?
  113. if(oBilgi[playerid][Kuruldumu] == 0)
  114. {
  115. oBilgi[playerid][Kuruldumu] = 1;
  116. bomba1 = CreateObject(1252,X,Y,Z,0,0,0);
  117. AttachObjectToPlayer(bomba1,playerid,1.5, 0, 0, 0, 0, 0);
  118. SendClientMessage(playerid,0x7FFF00AA,"Bombayi kurdun! /bombapatlat yazarak bombayi patlatabilirsin!");
  119. return true;
  120. }
  121. //Alinmadi mi?
  122. }
  123. else
  124. {
  125. SendClientMessage(playerid,0x7FFF00AA,"Bomban yok!");
  126. }
  127. return true;
  128. }
  129. //------------------------------------------------------------------------------
  130. if (strcmp("/bombapatlat", cmdtext, true, 10) == 0)
  131. {
  132. //Kurulmadi mi?
  133. if(oBilgi[playerid][Kuruldumu] == 0)
  134. {
  135. SendClientMessage(playerid,0x7FFF00AA,"Bomba kurulu degil!");
  136. return false;
  137. }
  138. //Alinmadi mi?
  139. else if(oBilgi[playerid][Alindimi] == 0)
  140. {
  141. SendClientMessage(playerid,0x7FFF00AA,"Bomban yok!");
  142. return false;
  143. //Alindi ve kurulmadi ise.
  144. }
  145. else
  146. {
  147. oBilgi[playerid][Kuruldumu] = 0;
  148. oBilgi[playerid][Alindimi] = 0;
  149. DestroyObject(bomba1);
  150. SetTimerEx("patlama",1000,true,"i",playerid);
  151. return true;
  152. }
  153. }
  154. return false;
  155. }
  156. //------------------------------------------------------------------------------
  157. public patlama(playerid)
  158. {
  159. new Float:X,Float:Y,Float:Z;
  160. GetPlayerPos(playerid,X,Y,Z);
  161. patlayici++;
  162. if(patlayici == 0)
  163. {
  164. CreateExplosion(X,Y+5,Z,7,15);
  165. return true;
  166. }
  167. if(patlayici == 1)
  168. {
  169. CreateExplosion(X+5,Y,Z,7,15);
  170. return true;
  171. }
  172. if(patlayici == 2)
  173. {
  174. CreateExplosion(X,Y,Z+5,7,15);
  175. return true;
  176. }
  177. if(patlayici == 3)
  178. {
  179. CreateExplosion(X,Y,Z,7,15);
  180. return true;
  181. }
  182. if(patlayici == 4)
  183. {
  184. CreateExplosion(X+5,Y+5,Z+5,7,15);
  185. return true;
  186. }
  187. return true;
  188. }
  189. //------------------------------------------------------------------------------
  190. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  191. {
  192. if(IsPlayerConnected(playerid))
  193. {
  194. new Float:oldposx, Float:oldposy, Float:oldposz;
  195. new Float:tempposx, Float:tempposy, Float:tempposz;
  196. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  197. tempposx = (oldposx -x);
  198. tempposy = (oldposy -y);
  199. tempposz = (oldposz -z);
  200. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  201. {
  202. return true;
  203. }
  204. }
  205. return false;
  206. }
  207. //----------------------------------SON-----------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement