put this in a constantly triggered command block (meaning turning on and off, like a repeat command block), and replace rgkewl with your username both times it comes up.
also, changing the r = value changes how far away an entity can be to be killed.
When replacing rgkewl with your username, be sure to leave the ! in front of the second time it shows up, or the only entity killed will be YOU!
WARNING: will kill ALL entities, including armor stands and other players, even if they are in creative (Not sure about Spectator)
will work in 1.8.x, and 1.9.x