Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. /***************************************************
  2. * FPS Boost *
  3. ***************************************************
  4. * Some people haz sandpz, plz fix *
  5. * *
  6. * LAST EDIT: 17.06.2017 *
  7. * CHANGES: Fixed messageloop *
  8. * BY: Dizzy *
  9. ***************************************************/
  10.  
  11. #include common_scripts\utility;
  12. #include maps\mp\_utility;
  13. #include maps\mp\gametypes\_hud_util;
  14.  
  15.  
  16. init()
  17. {
  18. level thread onPlayerConnect();
  19. }
  20.  
  21. onPlayerConnect()
  22. {
  23. for(;;)
  24. {
  25. level waittill( "connected", player );
  26.  
  27. if( !isDefined( player.message_shown) )
  28. player.message_shown = 0;
  29.  
  30. if( !isDefined( player.cur_bright ) )
  31. player.cur_bright = 0;
  32.  
  33. player thread watchButton();
  34. player thread onPlayerSpawned();
  35. }
  36. }
  37.  
  38. onPlayerSpawned()
  39. {
  40. self endon("disconnect");
  41.  
  42. for(;;)
  43. {
  44. self waittill("spawned_player");
  45.  
  46. if( !self.message_shown ) {
  47. self.message_shown = 1;
  48. self iPrintlnBold( "^7Press ^3[{+actionslot 1}] ^7to toggle ^3low graphics" );
  49. }
  50.  
  51. // Workaround for nightvision, this is very importanto!
  52. self _SetActionSlot( 1, "" );
  53. }
  54. }
  55.  
  56. watchButton()
  57. {
  58. self endon("disconnect");
  59.  
  60. self notifyOnPlayerCommand( "fpsboost", "+actionslot 1" );
  61.  
  62. for(;;) {
  63. self waittill( "fpsboost" );
  64.  
  65. self.cur_bright = !self.cur_bright;
  66. self setClientDvar( "r_fullbright", self.cur_bright );
  67.  
  68. if( self.cur_bright )
  69. self iPrintlnBold( "^7High FPS ^3On" );
  70. else
  71. self iPrintlnBold( "^7High FPS ^3Off" );
  72. }
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement