MyBB-Plugins Forums

Full Version: How to throw error.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I would like for my addon to throw an error and stop installing for a condition... like this...

PHP Code:
function buynewpoints_activate(){
//check if newpoints is installed before we do anything of this.
if(! $db->table_exists("newpoints_settings")){
//throw error and stop execution.
echo"Newpoints is not installed";

Usually when you install, it says it was successfully or unsuccessfully installed at the top of the page, the error I'm throwing I want to be displayed there.
I've replied to your PM, hope it fixes your problem

PHP Code:
flash_message('NewPoints is not activated.''error');