Guest User

Untitled

a guest
May 17th, 2014
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. new mclass[MAX_PLAYERS], // set to one to activate class
  5. mtog[MAX_PLAYERS], // toggles like a bool
  6. mbul[MAX_PLAYERS] = 3, //bullets, I recommend three.
  7. Float:x, // var for explosion
  8. Float:y, // var for explosion
  9. Float:z, // var for explosion
  10. Float:x1, // useless var for GetPlayerLastShotVectors only
  11. Float:y1, // useless var for GetPlayerLastShotVectors only
  12. Float:z1; // useless var for GetPlayerLastShotVectors only
  13.  
  14. #define TIMEMS 100 //How much M/S will it explode after you shot a weapon
  15. #define PRESSED(%0) \
  16. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  17.  
  18. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  19. {
  20. if (PRESSED(KEY_YES))
  21. {
  22. if(mclass[playerid] == 1 && mtog[playerid] == 1 && GetPlayerWeapon(playerid) == 31)
  23. {
  24. if(mbul[playerid] == 0) return SendClientMessage(playerid, -1, "Joolt has no bullets left.");
  25. mtog[playerid] = 0;
  26. SendClientMessage(playerid, -1, "Joolt unloaded.");
  27. return 1;
  28. }
  29. if(mclass[playerid] == 1 && mtog[playerid] == 0 && GetPlayerWeapon(playerid) == 31)
  30. {
  31. if(mbul[playerid] == 0) return SendClientMessage(playerid, -1, "Joolt has no bullets left.");
  32. mtog[playerid] = 1;
  33. SendClientMessage(playerid, -1, "Joolt loaded.");
  34. return 1;
  35. }
  36. }
  37. return 1;
  38. }
  39.  
  40. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  41. {
  42. if(mclass[playerid] == 1 && mtog[playerid] == 1 && weaponid == 31)
  43. {
  44. if(mbul[playerid] == 0) return SendClientMessage(playerid, -1, "Joolt has no bullets left.");
  45. SetTimerEx("exp", TIMEMS, false, "i", playerid);
  46. mbul[playerid]--;
  47. return 1;
  48. }
  49. return 1;
  50. }
  51.  
  52. forward exp(playerid);
  53. public exp(playerid)
  54. {
  55. GetPlayerLastShotVectors(playerid, x1, y1, z1, x, y, z);
  56. CreateExplosion(x, y, z, 12, 20.0);
  57. return 1;
  58. }
  59.  
  60. //only for debug
  61. CMD:lel(playerid, params[])
  62. {
  63. mclass[playerid] = 1;
  64. return 1;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment