Results 1 to 5 of 5

Thread: isThrowingGrenade function

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    This monitors a grenade after a grenade is thrown:

    PHP Code:
    // Called from Callback_StartGametype
    {
        
    level thread TrackGrenades()
    }
    /************************************
        This function is snaffled from 
        the eXtreme+ mod for COD2
    *************************************/
    TrackGrenades()
    {
        for( ;; )
        {
            
    nades getentarray"grenade""classname" );
            if( 
    isDefinednades ) )
            {
                for( 
    0nades.sizei++ )
                {
                    
    nade nades[i];
                    if( !
    isDefinednade.monitored ) )
                        
    nade thread monitorNade();
                }
            }

            
    wait0.05 );
        }
    }

    /************************************
        This function is snaffled from 
        the eXtreme+ mod for COD2
    *************************************/
    monitorNade()
    {
        
    self.monitored true;
        
        
    players getentarray"player""classname" );
        for( 
    0players.sizei++ )
        {
            
    player players[i];
            if( 
    self istouchingplayer ) )
                
    self.nadeThrower player;
        }

        if( !
    isDefinedself.nadeThrower ) ) return;

        if( !
    isAliveself.nadeThrower ) )
        {
            if( 
    isDefinedself ) ) 
                
    self delete();
            return;
        }

        
    self.nadeType self.nadeThrower getcurrentoffhand();
        
    self.nadeThrower notify"grenade_thrown"selfself.nadeType );
        
    self.nadeThrower iprintlnbold"throwing Grenade" );
        


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

    guiismiti (25th March 2017),Jeplaa (17th October 2013),kung foo man (17th October 2013),Ni3ls (18th October 2013)

Posting Permissions

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