I have 2 ideas on mind right now.
Solution number one, the surety method:
Once game begins, after you choose your name and see your role, you pay 5 points to the game. To get those points back you have to stay until the end, or die.
Solution number two, the joke's on you method:
Once game begins and you see your role, that role will be saved into your bank file as "last role recieved", another variable will hold a check to see if you left the game prematurely, it will be automatically turned on and will only turn off once you die or reach the game's conclusion. If you left prematurely, suicided that is, you will get, 100%, that same role on the next game you play. If you died or stayed until the end then you will not get the same role the next game.
So, in both cases you must die or stay until the end to avoid punishment. Say no to leavers! :P