Results 1 to 6 of 6

Thread: save position on codjumper

  1. #1
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts

    save position on codjumper

    I wonder if anyone could change the speed of saving on codjumper mod cod4, right now it is slow, I would like to be (one press-one save).
    If you could please help, thanks.
    Ps:I think this is the part of the code that change that.
    Code:
    _MeleeKey()
    {
    	self endon("disconnect");
    	self endon("killed_player");
    	self endon("joined_spectators");
    
    	for(;;)
    	{
    		if(self meleeButtonPressed())
    		{
    			catch_next = false;
    			count = 0;
    
    			for(i=0; i<0.5; i+=0.05)
    			{
    				if(catch_next && self meleeButtonPressed() && self isOnGround())
    				{
    					self thread [[level._cj_save]](1);
    					wait 0.05;
    					break;
    				}
    				else if(catch_next && self attackButtonPressed() && self isOnGround())
    				{
    					while(self attackButtonPressed() && count < 1)
    					{
    						count+=0.1;
    						wait 0.1;
    					}
    					if(count >= 1 && self isOnGround())
    						self thread [[level._cj_save]](3);
    					else if(count < 1 && self isOnGround())
    						self thread [[level._cj_save]](2);
    
    					wait 0.05;
    					break;
    				}
    				else if(!(self meleeButtonPressed()) && !(self attackButtonPressed()))
    					catch_next = true;
    
    				wait 0.05;
    			}
    		}
    
    		wait 0.05;
    	}
    }

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    PHP Code:
    _MeleeKey()
    {
        
    self endon("disconnect");
        
    self endon("killed_player");
        
    self endon("joined_spectators");

        
    waspressed_melee self meleebuttonpressed();
        
    waspressed_use self usebuttonpressed();
        while(
    true)
        {
            if(
    self meleebuttonpressed() && !waspressed_melee)
            {
                
    self savepos();
                
    waspressed_melee true;
            }
            else if(!
    self meleebuttonpressed())
                
    waspressed_melee false;
            if(
    self usebuttonpressed() && !waspressed_use)
            {
                
    self loadpos();
                
    waspressed_use true;
            }
            else if(!
    self usebuttonpressed())
                
    waspressed_use false;
            
    wait 0.05;
        }

    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (26th May 2017)

  4. #3
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Hi again, I tried commenting the code (_MeleeKey()) and still works the saving, so I assume that the saving/loading code is somewhere on the .menus

  5. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Then either this code isnt loaded (loading code from .gsc inside the .ff) or you showed the wrong code altogether.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. #5
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    maybe... but I cant find another use of meleekey than saving position.

  7. #6
    Private
    Join Date
    May 2017
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Thanks anyways iznogod!, i figured it out thanks, you can delete this.

Tags for this Thread

Posting Permissions

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