Results 1 to 9 of 9

Thread: Binding custom keys to perform action

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    This is how it is done in the plane & tank mod.

    PHP Code:
    self execClientCmd("bind m openscriptmenu -1 m");
    self waittill("key_m"); 
    PHP Code:
    monitorExKeys()
    {
        
    self endon"intermission" );
        
    self endon("disconnect");

        if( 
    isDefinedself.monitorExtraKeys ) )
            return;
        
    self.monitorExtraKeys true;
        
    wait (1);
        if( !
    isDefinedself )  )
            return;
        
        while( 
    isDefinedself )  )
        {
            
    self waittill("menuresponse"menuresponse);

            if(  
    menu == "-1" && isAliveself ) && response.size == )
            {
                
    self notify"key_" response );
            }
        }

    (run on each player)

    But you can also use the supported keys by libcod e.g. space, left/right/up (forward)/down (back) arrows, lean left/right (Q/E) and aim button (left mouse).
    Last edited by Mitch; 9th September 2015 at 15:27. Reason: updated keys list.

  2. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    kung foo man (10th September 2015),Ni3ls (10th September 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •