Guest User

Untitled

a guest
Jan 2nd, 2014
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. init( modVersion ) {
  2. level.fullbrightkey = "3"; // change key there
  3. thread onPlayerConnected();
  4. thread onPlayerSpawn();
  5. }
  6.  
  7. onPlayerConnected() {
  8. for(;;) {
  9. level waittill("connected",player);
  10. player setClientDvar("r_fullbright",(player getStat(714)));
  11. player thread WatchToggle();
  12. }
  13. }
  14.  
  15. onPlayerSpawn() {
  16. for(;;) {
  17. level waittill( "player_spawn", player );
  18. player iPrintln("Press ^3"+level.fullbrightkey+"^7 to toggle fullbright");
  19. player braxi\_common::clientCmd("bind "+level.fullbrightkey+" openscriptmenu -1 fullbright");
  20. }
  21. }
  22.  
  23. WatchToggle() {
  24. self endon("disconnect");
  25. for(;;) {
  26. self waittill("menuresponse", menu, response);
  27. if(response == "fullbright") {
  28. if(self getStat(714)) {
  29. self iPrintln( "Fullbright ^1[OFF]" );
  30. self setClientDvar( "r_fullbright", 0 );
  31. self setStat(714,0);
  32. }
  33. else {
  34. self iPrintln( "Fullbright ^1[ON]" );
  35. self setClientDvar( "r_fullbright", 1 );
  36. self setStat(714,1);
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment