Advertisement
Guest User

C4TX

a guest
Nov 7th, 2014
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <streamer>
  4. #include <sscanf2>
  5.  
  6. #pragma tabsize 0
  7.  
  8. #define COLOR_GREEN 0x33AA33AA
  9. #define COLOR_RED 0xAA3333AA
  10. #define FILTERSCRIPT
  11.  
  12. #define PRESSED(%0) \
  13. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  14.  
  15. new c4[MAX_PLAYERS];
  16. new pc4[11][MAX_PLAYERS];
  17. new Float:c4x[11][MAX_PLAYERS];
  18. new Float:c4y[11][MAX_PLAYERS];
  19. new Float:c4z[11][MAX_PLAYERS];
  20.  
  21. public OnFilterScriptInit()
  22. {
  23. print("\n--------------------------------------");
  24. print("ThunderX PlantC4 IS LOADED");
  25. print("--------------------------------------\n");
  26. return 1;
  27. }
  28. public OnFilterScriptExit()
  29. {
  30. print("\n--------------------------------------");
  31. print("ThunderX PlantC4 IS NOT LOAD");
  32. print("--------------------------------------\n");
  33. return 1;
  34. }
  35. public OnPlayerConnect(playerid)
  36. {
  37. for(new A;A < 11;A++)
  38. {
  39. c4x[A][playerid] = 9999;
  40. c4y[A][playerid] = 9999;
  41. c4z[A][playerid] = 9999;
  42. }
  43. c4[playerid] = 0;
  44. return 1;
  45. }
  46. public OnPlayerDisconnect(playerid, reason)
  47. {
  48. for(new A;A < 11;A++)
  49. {
  50. c4x[A][playerid] = 9999;
  51. c4y[A][playerid] = 9999;
  52. c4z[A][playerid] = 9999;
  53. DestroyDynamicObject(pc4[A][playerid]);
  54. }
  55. c4[playerid] = 0;
  56. return 1;
  57. }
  58.  
  59. CMD:C4C(playerid,params[])
  60. {
  61. SendClientMessage(playerid,COLOR_GREEN,"====================[CREDITS]====================");
  62. SendClientMessage(playerid,COLOR_RED,"Credits: ThunderX AND TX-TEAM");
  63. SendClientMessage(playerid,COLOR_GREEN,"=================================================");
  64. return 1;
  65. }
  66. CMD:plantc4(playerid,params[])
  67. {
  68. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"You cannot plant C4 in a vehicle!!");
  69. if(c4[playerid] == 5) return SendClientMessage(playerid,-1,"Error:- You can only plant 5 C4");
  70. new A;
  71. c4[playerid] ++;
  72. A = c4[playerid];
  73. new Float:x,Float:y,Float:z;
  74. GetPlayerPos(playerid,x,y,z);
  75. c4x[A][playerid] = x;
  76. c4y[A][playerid] = y;
  77. c4z[A][playerid] = z;
  78. GivePlayerWeapon(playerid, 40, 1);
  79. SendClientMessage(playerid,-1,"Press FIRE key to explode it or use /bomb.");
  80. pc4[A][playerid] = CreateDynamicObject(363,x,y,z-0.9,-90,0,0,-1,-1,-1,200); // <------- C4 VERTION 2.0
  81. return 1;
  82. }
  83. CMD:bomb(playerid,params[])
  84. {
  85. if(c4[playerid] != 0)
  86. {
  87. for(new A; A < 11;A++)
  88. {
  89. if(c4x[A][playerid] != 9999 && c4y[A][playerid] != 9999 && c4z[A][playerid] != 9999)
  90. {
  91. CreateExplosion(c4x[A][playerid],c4y[A][playerid],c4z[A][playerid],7,30.0);
  92. SendClientMessage(playerid,-1,"C4 explode!!!.");
  93. DestroyDynamicObject(pc4[A][playerid]);
  94. c4x[A][playerid] = 9999;
  95. c4y[A][playerid] = 9999;
  96. c4z[A][playerid] = 9999;
  97. }
  98. }
  99. c4[playerid] = 0;
  100. }
  101.  
  102. return 1;
  103. }
  104.  
  105. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  106. {
  107. if(PRESSED(KEY_FIRE))
  108. {
  109. if(GetPlayerWeapon(playerid) == 40)
  110. {
  111. if(c4[playerid] != 0)
  112. {
  113. for(new A; A < 11;A++)
  114. {
  115. if(c4x[A][playerid] != 9999 && c4y[A][playerid] != 9999 && c4z[A][playerid] != 9999)
  116. {
  117. CreateExplosion(c4x[A][playerid],c4y[A][playerid],c4z[A][playerid],7,30.0);
  118. SendClientMessage(playerid,-1,"C4 explode!!!.");
  119. DestroyDynamicObject(pc4[A][playerid]);
  120. c4x[A][playerid] = 9999;
  121. c4y[A][playerid] = 9999;
  122. c4z[A][playerid] = 9999;
  123. }
  124. }
  125. c4[playerid] = 0;
  126. }
  127. }
  128. }
  129. return 1;
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement