Tropic Thunder
(2008)

After being threatened by studio exec Les Grossman (Tom Cruise) that his war film is going to be shut down, director Damien Cockburn (Steve Coogan) follows the advice of his consultant, armless Vietnam veteran, Four Leaf Tayback (Nick Nolte) and takes his five lead actors -- action star Tugg Speedman (Ben Stiller), 5-time Oscar-winning method actor Kirk Lazarus (Robert Downey Jr.), comedian Jeff "Fats" Portnoy (Jack Black), rapper Alpa Chino (Brandon T. Jackson), and rookie Kevin Sandusky (Jay Baruchel) -- into the jungle to film the movie guerrilla style.

Cockburn is killed almost instantly when he steps onto an old landmine, which results in everybody but Speedman to doubt that they are still filming a movie (especially after they are attacked by local drug smugglers). Tayback and the pyrotechnician Cody (Danny McBride) are later captured by the smugglers after they return to the jungle to check on the cast (and Tayback is revealed to be fraud, having never lost his arms or been to Vietnam).

Later, when it is decided they are lost, Lazarus (stuck in the persona of the African-American sergeant he is playing) convinces everyone, except Speedman, to try and go back to the clearing they landed in. Speedman goes off on his own (still thinking he is in the movie).

Speedman is eventually captured by the drug smugglers and brought to their camp, where the child kingpin recognizes him from his earlier role of "Simple Jack" and forces him to portray the whole film live for the camp. The rest of the cast find them camp and decide to infiltrate it to rescue Speedman.

The cast infiltrate the camp and find Speedman, as well as Tayback and Cody. Cody uses his pyrotechnic equipment to create a diversion, while the cast escapes to the helicopter. As they cross the bridge, Speedman decides to go back, saying that he has grown comfortable there with his new "son". However, he instantly changes his mind when his "son" starts stabbing him in the shoulder.

Tayback blows up the bridge to prevent the drug smugglers from following and everyone gets into the helicopter to leave. The kingpin aims a bazooka at the helicopter, however Speedman's agent Rick (Matthew McConaughey) shows up with Speedman's contractually obligated TiVO and throws it in front of the bazooka's rocket, which allows the helicopter get away.

At the end it shows that all the events were filmed (using, assumably, the hidden cameras that were set up by Cockburn) and it is revealed that the film won 8 Oscars (including Best Actor for Speedman).

That's the summary. There are a few things I couldn't really fit into the summary, such as Portnoy going through a heroin withdrawal for most of the film, which results in his behaviour becoming more and more erratic.

Thanks Sean!