Huge thanks to Basil Beard and TechnoDragon for making this item
The item is still in testing
With this item no one can bash your karma, steal your credits, change your member title, or rob your bank.
Install the package
If you would like insurance from an item that isn't listed then edit one of theses two into the item.
Add this code to each item you want insurances to block (Single member affects, ie: steal your credits, bash karma)
$result = db_query("SELECT insurance from {$db_prefix}members WHERE id_member = ($_POST['target'])", __FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
if ($row > 0) {
db_query("UPDATE {$db_prefix}members SET insurance = (insurance - 1) WHERE id_member = ($_POST['target']))", __FILE__, __LINE__);
return "That user has insurance, and wasn't affected.";
}
else {
//rest of code goes here
}
And as for multiple member affects, (ie: Rob the bank, Karmageddon)
$result = db_query("SELECT insurance from {$db_prefix}members WHERE id_member = ($_POST['target'])", __FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
if ($row > 0) {
db_query("UPDATE {$db_prefix}members SET insurance = (insurance - 1) WHERE insurance > 0)", __FILE__, __LINE__);
return "Some users have insurance and weren't affected.";
}
else {
//rest of code goes here
}