Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. bool recoil, nospread, massive_kill;
  2. BaseWeapon current_weapon;
  3. WeaponManager weapon_manager;
  4.  
  5. void Update()
  6. {
  7. if (Time.frameCount % 60 == 0)
  8. {
  9. WeaponManager[] wmgers = GameObject.FindObjectsOfType(typeof(WeaponManager)) as WeaponManager[];
  10.  
  11. foreach (WeaponManager wm in wmgers)
  12. {
  13. if (wm.isActiveAndEnabled)
  14. {
  15. weapon_manager = wm;
  16. }
  17. }
  18.  
  19. if (weapon_manager.ActiveWeapon)
  20. {
  21. current_weapon = weapon_manager.ActiveWeapon;
  22. }
  23.  
  24.  
  25. }
  26.  
  27. if (current_weapon)
  28. {
  29. if (recoil)
  30. {
  31. current_weapon.Accuracy.aimAccuracy = 0;
  32. current_weapon.Accuracy.maxRecoilAngle = 0;
  33. current_weapon.Accuracy.recoilFireDeltaAngle = 0;
  34. current_weapon.Accuracy.runAccuracyFactor = 0;
  35. current_weapon.Accuracy.standAccuracy = 0;
  36. current_weapon.Accuracy.recoilReductionDelta = 0;
  37. }
  38.  
  39. if (nospread)
  40. {
  41. current_weapon.Accuracy.errorAngle = 0;
  42. current_weapon.Accuracy.errorAngleFactor = 0;
  43. }
  44. }
  45.  
  46.  
  47. if (massive_kill)
  48. {
  49. if (Time.frameCount % 120 == 0)
  50. {
  51. PlayerDamage[] Players_dmg = GameObject.FindObjectsOfType(typeof(PlayerDamage)) as PlayerDamage[];
  52.  
  53. foreach (PlayerDamage dmg in Players_dmg)
  54. {
  55. dmg.SendMessage("KillPlayer", SendMessageOptions.DontRequireReceiver);
  56. }
  57. }
  58. }
  59.  
  60. }
  61.  
  62. void OnGUI()
  63. {
  64.  
  65. if (current_weapon)
  66. {
  67. GUILayout.Label("WEAPON_AVAILABLE: " + current_weapon.WeaponName);
  68. }
  69. else
  70. {
  71. GUILayout.Label("WEAPON_AVAILABLE: NOT_FOUND!");
  72. }
  73.  
  74. if (GUILayout.Button("Recoil: "+recoil))
  75. {
  76. recoil = !recoil;
  77. }
  78. if (GUILayout.Button("NoSpread: " + nospread))
  79. {
  80. nospread = !nospread;
  81. }
  82. if (GUILayout.Button("Massive Kills: " + massive_kill))
  83. {
  84. massive_kill = !massive_kill;
  85. }
  86.  
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement