Any money paid to a player is included in team salary, even if the player has retired. For example, James Worthy retired in 1994, two years before his contract ended. He continued to receive his salary for the 1994-95 and 1995-96 seasons, so his salary was included in the Lakers' team salary in those seasons. It is at the team's discretion (or as the result of an agreement between the team and player) whether to continue to pay the player after he has retired.
There is one exception whereby a player can continue to receive his salary, but the salary is not included in the team's team salary. This is when a player is forced to retire for medical reasons and a league-appointed physician confirms that he is medically unfit to continue playing. There is a waiting period of one year following the injury or illness before a team can apply for this salary cap relief. If the waiting period expires mid-season (on any date prior to the last day of the regular season), then the player's entire salary for that season is removed from the team's team salary. For example, in March 2003 the Knicks were allowed to remove Luc Longley's entire 2002-03 salary from their books (and since the luxury tax is based on the team salary as of the last day of the regular season, the Knicks avoided paying any tax on Longley's salary). This provision can also be used when a player dies while under contract.
Teams are not allowed to trade for disabled players and then apply for this salary cap relief. Only the team for which the player was playing when he was disabled may request this relief.
If a player retires, even for medical reasons, his team does not receive a salary cap exception to acquire a replacement player.
Y por cierto, una cosa es retirarse porque te sale del nabo, aunque sea fake, caso de Jordan, y otra muy diferente no acabar de hacerlo aunque todo indique que es lo que deberías hacer aunque solo sea para que miles de personas no se caguen en tus muertos, caso de Allan Houston, o de Grant Hill cuando estaba por Orlando. Ambos zombies del resident evil durante años pero que seguieron ahí chupando de contrato porque iban a volver recuperados una tarde de primavera... pollasenvinagre.