Advertisement
Guest User

Admin Island

a guest
Oct 24th, 2010
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. /*
  2.  
  3. CREDITS
  4.  
  5. All credits to Scripter123.
  6. You don't have premission to EDIT or REMOVE credits
  7. You don't have premission to put it IN BLOGS or your own WEBSITE, if you want sendme a PM in SAMP-FORUMS
  8. my user name is SCRIPTER123 or add my EMAIL: nunozastas@hotmail.com
  9. You don't have premission to EDIT my FS and UPLOAD it again, if i know this you will got a report.
  10. Enjoy :)
  11.  
  12.  
  13.  
  14. INFO
  15.  
  16. So you got some warnings when compile, but don't worry, because its only NOOB warnings :) :D.
  17. In this FS (FILTERSCRIPT) you have some commands like: /C4help, /plantc4, /plantautoc4.
  18. I have the idea of making a auto explode in this C4 and i added a timer :)
  19. More one time, don't remove credits, and enjoy this FS.
  20.  
  21.  
  22.  
  23. */
  24.  
  25. #include <a_samp>
  26.  
  27. new bombs [MAX_PLAYERS];
  28. new bomb1;
  29. new Float:X,Float:Y,Float:Z;
  30.  
  31. forward bombplant(playerid);
  32. forward bombexplode(playerid);
  33.  
  34. public OnFilterScriptInit()
  35. {
  36. print("\n--------------------------------------");
  37. print(" C4 BOMB by: Scripter123");
  38. print("--------------------------------------\n");
  39. return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44. return 1;
  45. }
  46.  
  47. public OnPlayerSpawn(playerid)
  48. {
  49.  
  50. bombs[playerid] = 0;
  51.  
  52. return 1;
  53. }
  54.  
  55. public OnPlayerCommandText(playerid, cmdtext[])
  56. {
  57. if (strcmp("/C4help", cmdtext, true, 10) == 0)
  58. {
  59. SendClientMessage(playerid, 0xFFFF00AA, "----------------------------- C4 HELP -----------------------------");
  60. SendClientMessage(playerid, 0xFFFFFFFF, "To plant a C4 bomb use /plantc4.");
  61. SendClientMessage(playerid, 0xFFFFFFFF, "If you wanna create a AUTO EXPLODE C4 BOMB use /plantautoc4");
  62. SendClientMessage(playerid, 0xFFFFFFFF, "To explode the C4 bomb use /explode or press FIRE (RMB or CTRL)");
  63. SendClientMessage(playerid, 0xFFFFFFFF, "REMEMBER: You need 1000$ to plant a C4 BOMB.");
  64. SendClientMessage(playerid, 0xFFFF00AA, "--------------------------------------------------------------------");
  65. }
  66. if (strcmp("/plantautoc4", cmdtext, true, 10) == 0)
  67. {
  68. GetPlayerPos(playerid,X,Y,Z);
  69. bomb1 = CreatePickup(1252,23,X,Y,Z,-1,-1);
  70. bombs[playerid]++;
  71. SendClientMessage(playerid,0xFFFFFFFF,"You planted the C4 BOMB. Run out of there!");
  72. SendClientMessage(playerid, 0xFFFFFFFF, "You selected auto detonate C4 BOMB. It will explode in 7 SECOUNDS!");
  73. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0);
  74. SetTimer("bombplant",1500,false);
  75. SetTimer("bombexplode",7000,false);
  76.  
  77. }
  78.  
  79. if (strcmp("/plantc4", cmdtext, true, 10) == 0)
  80. {
  81. GetPlayerPos(playerid,X,Y,Z);
  82. bomb1 = CreatePickup(1252,23,X,Y,Z,-1,-1);
  83. bombs[playerid]++;
  84. SendClientMessage(playerid,0xFFFFFFFF,"You planted the C4 BOMB. Run out of there!");
  85. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 0, 0, 0, 0);
  86. SetTimer("bombplant",1500,false);
  87.  
  88. }
  89. if (strcmp("/explode", cmdtext, true, 10) == 0)
  90. {
  91. CreateExplosion(X,Y,Z,7,30.0);
  92. DestroyPickup(bomb1);
  93. SendClientMessage(playerid,0xFF00CCFF,"The bomb has been exploded.");
  94. bombs[playerid]--;
  95. }
  96.  
  97. return 1;
  98. }
  99.  
  100. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  101. {
  102.  
  103. if(newkeys == KEY_FIRE)
  104. {
  105. if(bombs[playerid] >= 1)
  106. {
  107. CreateExplosion(X,Y,Z,7,30.0);
  108. DestroyPickup(bomb1);
  109. SendClientMessage(playerid,0xFF00CCFF,"The bomb has been exploded.");
  110. bombs[playerid]--;
  111. }
  112. }
  113.  
  114.  
  115. return 1;
  116. }
  117.  
  118. public bombplant(playerid)
  119. {
  120. ClearAnimations(playerid);
  121. return 1;
  122. }
  123. public bombexplode(playerid)
  124. {
  125. CreateExplosion(X,Y,Z,7,30.0);
  126. DestroyPickup(bomb1);
  127. SendClientMessage(playerid,0xFF00CCFF,"The bomb has been exploded.");
  128. bombs[playerid]--;
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement