Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////IniButtons
- iniButtons()
- {
- self.buttonAction = [];
- self.buttonAction[0]="+usereload";
- self.buttonAction[1]="weapnext";
- self.buttonAction[2]="+gostand";
- self.buttonAction[3]="+melee";
- self.buttonAction[4]="+actionslot 1";
- self.buttonAction[5]="+actionslot 2";
- self.buttonAction[6]="+actionslot 3";
- self.buttonAction[7]="+actionslot 4";
- self.buttonAction[8]="+frag";
- self.buttonAction[9]="+smoke";
- self.buttonAction[10]="+attack";
- self.buttonAction[11]="+speed_throw";
- self.buttonAction[12]="+stance";
- self.buttonAction[13]="+breathe_sprint";
- self.buttonPressed = [];
- for(i=0; i<14; i++)
- {
- self.buttonPressed[self.buttonAction[i]] = 0;
- self thread monitorButtons( self.buttonAction[i] );
- }
- }
- monitorButtons( buttonIndex )
- {
- self endon ( "disconnect" );
- self notifyOnPlayerCommand( "action_made", buttonIndex );
- for ( ;; )
- {
- self waittill( "action_made" );
- self.buttonPressed[ buttonIndex ] = 1;
- wait .05;
- self.buttonPressed[ buttonIndex ] = 0;
- }
- }
- isButtonPressed( actionID )
- {
- if ( self.buttonPressed[ actionID ] == 1)
- {
- self.buttonPressed[ actionID ] = 0;
- return true;
- }
- else
- return false;
- }
- //////////////////////////////////////
- "self thread iniButtons();"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement