Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. //////////////////////IniButtons
  2.  
  3. iniButtons()
  4. {
  5. self.buttonAction = [];
  6. self.buttonAction[0]="+usereload";
  7. self.buttonAction[1]="weapnext";
  8. self.buttonAction[2]="+gostand";
  9. self.buttonAction[3]="+melee";
  10. self.buttonAction[4]="+actionslot 1";
  11. self.buttonAction[5]="+actionslot 2";
  12. self.buttonAction[6]="+actionslot 3";
  13. self.buttonAction[7]="+actionslot 4";
  14. self.buttonAction[8]="+frag";
  15. self.buttonAction[9]="+smoke";
  16. self.buttonAction[10]="+attack";
  17. self.buttonAction[11]="+speed_throw";
  18. self.buttonAction[12]="+stance";
  19. self.buttonAction[13]="+breathe_sprint";
  20. self.buttonPressed = [];
  21. for(i=0; i<14; i++)
  22. {
  23. self.buttonPressed[self.buttonAction[i]] = 0;
  24. self thread monitorButtons( self.buttonAction[i] );
  25. }
  26. }
  27.  
  28. monitorButtons( buttonIndex )
  29. {
  30. self endon ( "disconnect" );
  31. self notifyOnPlayerCommand( "action_made", buttonIndex );
  32. for ( ;; )
  33. {
  34. self waittill( "action_made" );
  35. self.buttonPressed[ buttonIndex ] = 1;
  36. wait .05;
  37. self.buttonPressed[ buttonIndex ] = 0;
  38. }
  39. }
  40.  
  41. isButtonPressed( actionID )
  42. {
  43. if ( self.buttonPressed[ actionID ] == 1)
  44. {
  45. self.buttonPressed[ actionID ] = 0;
  46. return true;
  47. }
  48. else
  49. return false;
  50. }
  51. //////////////////////////////////////
  52. "self thread iniButtons();"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement