Originally Posted by Spudster
I have tried that better whenever die is called it kills the whole forum instead of the plugin itself.
Which is normal. Die doesn't terminate an inclusion, it halts the processor.
If you want it to stop, you have one of two options. The first is to deal only within the branches which is what I'd recommend, and the other is to issue a return which halts the current script that was included and returns the control to the caller. Consider it as a recursive call to the main() method, where the return of the inclusion only terminates the inner main.