Guest User

aBomb System

a guest
Apr 19th, 2011
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. /*
  2. |||||||||||||||||||||||||||||||||
  3. ||aBomb System By AlexzzPro ||
  4. ||Please keep the credits to me||
  5. ||Do not claim this as your own||
  6. ||Enjoy ||
  7. |||||||||||||||||||||||||||||||||
  8. */
  9. #define FILTERSCRIPT
  10. #include <a_samp>
  11. #include <zcmd>
  12. #define COLOR_RED 0xAA3333AA
  13. #define COLOR_GREEN 0x21DD00FF
  14. #define BombBuy 1
  15. new Planted[MAX_PLAYERS];
  16. new bombprice = 2500;
  17. new iBomb;
  18. new GotBombs[MAX_PLAYERS];
  19. new bombplanted[MAX_PLAYERS];
  20. forward bombtimer(playerid);
  21. new bombtime = 30000;
  22. #if defined FILTERSCRIPT
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n--------------------------------------");
  27. print(" aBomb System By AlexzzPro");
  28. print("--------------------------------------\n");
  29. iBomb = CreatePickup(1252, 23, 1424.3972,-1319.2443,13.5547);
  30. return 1;
  31. }
  32.  
  33. public OnFilterScriptExit()
  34. {
  35. DestroyPickup(iBomb);
  36. return 1;
  37. }
  38.  
  39. #else
  40.  
  41. #endif
  42. public bombtimer(playerid)
  43. {
  44. new Float:x,Float:y,Float:z;
  45. GetObjectPos(bombplanted[playerid],x,y,z);
  46. CreateExplosion(x,y,z,2,10.50);
  47. CreateExplosion(x,y,z,6,10.50);
  48. CreateExplosion(x,y,z,7,10.50);
  49. CreateExplosion(x,y,z,13,10.50);
  50. CreateExplosion(x,y,z,9,10.50);
  51. CreateExplosion(x,y,z,3,10.50);
  52. CreateExplosion(x,y,z,4,10.50);
  53. CreateExplosion(x,y,z,5,10.50);
  54. CreateExplosion(x,y,z,0,10.50);
  55. CreateExplosion(x,y,z,10,10.50);
  56. DestroyObject(bombplanted[playerid]);
  57. SetPlayerAttachedObject(playerid, 0, 363, 1, 0.300000, -0.14,0.2, 0.000000, 90, 359.5022,1,1,1);
  58. Planted[playerid] = 0;
  59. return 1;
  60. }
  61. public OnPlayerUpdate(playerid)
  62. {
  63. if(GotBombs[playerid] == 0)
  64. {
  65. RemovePlayerAttachedObject(playerid,0);
  66. return 1;
  67. }
  68. return 1;
  69. }
  70. public OnPlayerPickUpPickup(playerid, pickupid)
  71. {
  72. if(pickupid == iBomb)
  73. {
  74. ShowPlayerDialog(playerid, BombBuy, DIALOG_STYLE_MSGBOX, "Purchase Bombs","Do you wish to purchase bombs for {FF0000}2500","Buy","No");
  75. return 1;
  76. }
  77. return 1;
  78. }
  79. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  80. {
  81. if(dialogid == BombBuy)
  82. {
  83. if(response)
  84. {
  85. if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, COLOR_RED, " You dont have $2500");
  86. {
  87. GotBombs[playerid] += 5;
  88. SendClientMessage(playerid, COLOR_GREEN, "You purchased 5 bombs for $2500");
  89. GivePlayerMoney(playerid, -bombprice);
  90. SetPlayerAttachedObject(playerid, 0, 363, 1, 0.300000, -0.14,0.2, 0.000000, 90, 359.5022,1,1,1);
  91. }
  92. }
  93. if(!response)
  94. {
  95. SendClientMessage(playerid, COLOR_RED, "Come back if you need bombs");
  96. }
  97. }
  98. return 1;
  99. }
  100. CMD:plantbomb(playerid,params[])
  101. {
  102. if(GotBombs[playerid] == 0)
  103. {
  104. SendClientMessage(playerid, COLOR_RED, "You dont have any bombs");
  105. return 1;
  106. }
  107. if(Planted[playerid] == 1)
  108. {
  109. SendClientMessage(playerid, COLOR_RED, "You already planted a bomb, wait for it to explode");
  110. return 1;
  111. }
  112. new Float:x,Float:y,Float:z;
  113. GetPlayerPos(playerid,x,y,z);
  114. bombplanted[playerid] = CreateObject(1252, x,y,z,0,0,0);
  115. GotBombs[playerid] =- 1;
  116. RemovePlayerAttachedObject(playerid,0);
  117. SetTimerEx("bombtimer", bombtime, false, "i", playerid);
  118. bombseconds(playerid);
  119. Planted[playerid] = 1;
  120. return 1;
  121. }
  122. stock bombseconds(playerid)
  123. {
  124. SendClientMessage(playerid, COLOR_GREEN, "Your bomb will explode in 30 seconds");
  125. return 1;
  126. }
Advertisement
Add Comment
Please, Sign In to add comment