Advertisement
errur

Popflash script edit

Feb 8th, 2015
2,297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. /* nadetraining.nut
  2. * Popflash Training Script
  3. * by S0lll0s, Bidj and Rurre
  4. *
  5. * goes into /csgo/scripts/vscripts/nadetraining.nut
  6. *
  7. * USAGE, in console:
  8. * script_execute nadetraining
  9. * script nadeSetup()
  10. * bind "rctrl" "script nadeSavePos()"
  11. * bind "ralt" "script pauseScript()"
  12. * Press the key (right ctrl in this case) before every nade you want save, all following nades will fly the same path
  13. * regardless of how you throw them. To pause the script and throw nades freely use the other bind (right alt in this case).
  14. */
  15.  
  16. this.nadePos <- null;
  17. this.nadeVel <- null;
  18. this.nadeSaveMode <- true;
  19. this.nadeLastNade <- null;
  20. this.isPaused <- false;
  21.  
  22. function nadeSetup() {
  23. printl( @"[NT] nadetraining.nut" );
  24. printl( @"[NT] Popflash Training Script" );
  25. printl( @"[NT] by S0lll0s, Bidj and Rurre" );
  26. printl( @"[NT] USAGE:" );
  27. printl( @"[NT] bind ""ralt"" ""script nadeSavePos()""" );
  28. printl( @"[NT] bind ""rctrl"" ""script pauseScript()""" );
  29. printl( @"[NT] Press the key before every nade you save, all following nades will fly the same path" );
  30.  
  31. printl( @"[NT] starting setup..." );
  32. SendToConsole( @"sv_cheats 1" );
  33. SendToConsole( @"ent_remove nadeTimer" );
  34. SendToConsole( @"ent_create logic_timer" );
  35. SendToConsole( @"ent_fire logic_timer addoutput ""targetname nadeTimer""" );
  36. SendToConsole( @"ent_fire nadeTimer toggle" );
  37. SendToConsole( @"ent_fire nadeTimer addoutput ""refiretime 0.05""" );
  38. SendToConsole( @"ent_fire nadeTimer enable" );
  39. SendToConsole( @" ent_fire nadeTimer addoutput ""startdisabled 0""" );
  40. SendToConsole( @" ent_fire nadeTimer addoutput ""UseRandomTime 0""" );
  41. SendToConsole( @" ent_fire nadeTimer addoutput ""ontimer nadeTimer,RunScriptCode,nadeThink()""" );
  42. printl( @"[NT] done. You can turn off sv_cheats now." );
  43. }
  44.  
  45. function nadeSavePos() {
  46. nadeSaveMode = true;
  47. ScriptPrintMessageCenterAll( "Saving next Flashbang or Grenade" );
  48. }
  49. function nadeThink() {
  50. local nade = null;
  51.  
  52. while ( Entities.FindByClassname(nade, "flashbang_projectile") != null ) {
  53. nade = Entities.FindByClassname(nade, "flashbang_projectile");
  54. saveRestore( nade );
  55. }
  56.  
  57. nade = null;
  58. while ( Entities.FindByClassname(nade, "hegrenade_projectile") != null ) {
  59. nade = Entities.FindByClassname(nade, "hegrenade_projectile");
  60. saveRestore( nade );
  61. }
  62. }
  63. function pauseScript()
  64. {
  65. if(isPaused == false)
  66. {
  67. isPaused = true;
  68. ScriptPrintMessageCenterAll( "Pausing script. You can now throw grenades freely." );
  69. }
  70. else
  71. {
  72. isPaused = false;
  73. ScriptPrintMessageCenterAll( "Resuming script. Last saved grenade remembered." );
  74. }
  75. }
  76. function saveRestore( nade ) {
  77. if (isPaused == false){
  78. if ( nadeLastNade != nade ) {
  79. if ( nadeSaveMode ) {
  80. ScriptPrintMessageCenterAll( "Saved" );
  81. nadePos = nade.GetCenter();
  82. nadeVel = nade.GetVelocity();
  83. nadeSaveMode = false;
  84. } else {
  85. nade.SetAbsOrigin( nadePos );
  86. nade.SetVelocity( nadeVel );
  87. }
  88. nadeLastNade = nade;
  89. }
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement