I actually have three characters in a roleplay set up to die and one in my gundam rp that is doomed to die immediately by virtue of him being one character's obi-wan. I don't make a habit of killing of characters unless it benefits the story in some way, shape, or form. A character's death should be for something unless they were made to be a throw away character in the first place. Very rarely should you kill off a character for just shock value because chances are it won't help hit your roleplayers. I have hard enough time getting people invested in THEIR characters let alone a NPC. As for how I write them out I write them out like any other character giving them flaws, good bits, and other sorts of stuff. If they die it's because the situation demands it or they simply had enough of life and want to go out with a bang.