Advertisement
Bomber07

Vehicle Bomb System By Bomber07 V1

Jan 4th, 2017
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4.  
  5. new bomb[MAX_VEHICLES];
  6. new bombegem[MAX_PLAYERS];
  7. new vehlo[MAX_PLAYERS];
  8.  
  9. #define ROT 0xFF0000FF
  10.  
  11. #define PRESSED(%0) \
  12. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  13.  
  14. #define RELEASED(%0) \
  15. (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
  16.  
  17. #if defined FILTERSCRIPT
  18.  
  19. public OnFilterScriptInit()
  20. {
  21. AntiDeAMX();
  22. print("\n--------------------------------------");
  23. print(" Special Car Bomb");
  24. print("--------------------------------------\n");
  25. return 1;
  26. }
  27.  
  28. #else
  29. #endif
  30.  
  31. stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
  32.  
  33. public OnPlayerCommandText(playerid, cmdtext[])
  34. {
  35. if (strcmp("/veh", cmdtext, true, 10) == 0)
  36. {
  37. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,ROT,"You must enter a Vehicle!");
  38. {
  39. if(bomb[GetPlayerVehicleID(playerid)] != 0) return SendClientMessage(playerid,ROT,"In this Car is Allready a Bomb!");
  40. {
  41. SendClientMessage(playerid,ROT,"Bomb created!");
  42. bombegem[playerid] = 1;
  43. }
  44. }
  45. return 1;
  46. }
  47. if(strcmp("/car", cmdtext, true ,10) == 0)
  48. {
  49. if(IsPlayerAdmin(playerid))
  50. {
  51. new Float:x,Float:y,Float:z;
  52. GetPlayerPos(playerid,x,y,z);
  53. CreateVehicle(555,x,y,z,0,1,1,100);
  54. }
  55. }
  56. return 0;
  57. }
  58.  
  59. public OnPlayerExitVehicle(playerid, vehicleid)
  60. {
  61. if(bombegem[playerid] == 1)
  62. {
  63. vehlo[playerid] = GetPlayerVehicleID(playerid);
  64. SetTimer("Warte",6000,false);
  65. bombegem[playerid] = 0;
  66. SendClientMessage(playerid,ROT,"Bomb would be activated in 6 Seconds!");
  67. }
  68. if(bomb[vehicleid] == 1)
  69. {
  70. new Float:x,Float:y,Float:z;
  71. GetVehiclePos(vehicleid,x,y,z);
  72. CreateExplosion(x,y,z,5,10.0);
  73. SetPlayerHealth(playerid,0);
  74. SetPlayerArmour(playerid,0);
  75. GameTextForPlayer(playerid, "~r~Any Player Has Fucked You!", 5000, 2);
  76. bomb[vehicleid] = 0;
  77. }
  78. return 1;
  79. }
  80. forward Bombecount(playerid);
  81. public Bombecount(playerid)
  82. {
  83. new Float:x,Float:y,Float:z;
  84. GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
  85. CreateExplosion(x,y,z,5,10.0);
  86. SetPlayerHealth(playerid,0);
  87. SetPlayerArmour(playerid,0);
  88. GameTextForPlayer(playerid, "~r~Any Player Has Fucked You!", 5000, 2);
  89. bomb[GetPlayerVehicleID(playerid)] = 0;
  90. return 1;
  91. }
  92. forward Warte(playerid);
  93. public Warte(playerid)
  94. {
  95. bomb[vehlo[playerid]] = 1;
  96. return 1;
  97. }
  98. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  99. {
  100. if(bomb[vehicleid] == 1)
  101. {
  102. GameTextForPlayer(playerid,"~r~Worning: This car carrying a bomb",2,1);
  103. SendClientMessage(playerid,ROT,"Worning: This car carrying a bomb");
  104. }
  105. return 1;
  106. }
  107. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  108. {
  109. if(IsPlayerInAnyVehicle(playerid) && bomb[GetPlayerVehicleID(playerid)] == 1)
  110. {
  111. if(newkeys & KEY_HANDBRAKE)
  112. {
  113. new Float:x,Float:y,Float:z;
  114. GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
  115. CreateExplosion(x,y,z,5,10.0);
  116. SetPlayerHealth(playerid,0);
  117. SetPlayerArmour(playerid,0);
  118. GameTextForPlayer(playerid, "~r~Any Player Has Fucked You!", 5000, 2);
  119. bomb[GetPlayerVehicleID(playerid)] = 0;
  120. }
  121. }
  122. return 1;
  123. }
  124. AntiDeAMX()
  125. {
  126. new a[][] =
  127. {
  128. "Unarmed (Fist)",
  129. "Brass K"
  130. };
  131. #pragma unused a
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement