heres a poison item for anyone who's interested
it basically kills a users pet. this action is non-reversible.
just save the code in a file called Poison.php also attached to this post is a poison bottle item image with a transparent background.
<?php
/**********************************************************************************
* SMFShop item *
***********************************************************************************
* SMFShop: Shop MOD for Simple Machines Forum *
* =============================================================================== *
* Software Version: SMFShop 3.0 (Build 12) *
* $Date:: 2007-01-18 19:26:55 +1100 (Thu, 18 Jan 2007) $ *
* $Id:: Steal.php 79 2007-01-18 08:26:55Z daniel15 $ *
* Software by: DanSoft Australia (http://www.dansoftaustralia.net/)*
* Copyright 2005-2007 by: DanSoft Australia (http://www.dansoftaustralia.net/)*
* Support, News, Updates at: http://www.dansoftaustralia.net/ *
* *
* Forum software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2006-2007 by: Simple Machines LLC (http://www.simplemachines.org) *
* 2001-2006 by: Lewis Media (http://www.lewismedia.com) *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under *
* the terms of the provided license as published by Simple Machines LLC. *
* *
* This program is distributed in the hope that it is and will be useful, but *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
* The latest version of the license can always be found at *
* http://www.simplemachines.org. *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');
class item_Poison extends itemTemplate
{
function getItemDetails()
{
$this->authorName = 'Inkstains';
$this->authorWeb = 'http://nurcharecords.com';
$this->authorEmail = 'scrawl@nurcharecords.com';
$this->name = 'Pet Poison';
$this->desc = 'Put your pet down!';
$this->price = 50;
$this->require_input = true;
$this->can_use_item = true;
}
function getUseInput()
{
global $db_prefix, $ID_MEMBER;
$result = db_query("SELECT numpets FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
if ($row['numpets'] == 0) {
return "You have no pets. Using this item will simply cause it to fail and you to lose money.";
}
$string .= "<select name = 'petid'>";
$result = db_query("SELECT * FROM {$db_prefix}shop_pets WHERE ownerid = {$ID_MEMBER}", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result)) {
$string .= "<option value = '{$row['pet_id']}'>{$row['name']}</option>";
}
$string .= "</select>";
return "<b><br />This is a permanent non-reversible action</b> if you would like to continue please select which pet you would like to poison: <br /><br />".$string;
}
function onUse()
{
global $db_prefix, $ID_MEMBER, $item_info;
if (!isset($_POST['petid'])) {
return "I told you it would fail!";
}
else {
$result = db_query("DELETE FROM {$db_prefix}shop_pets WHERE pet_id = {$_POST['petid']} AND ownerid = {$ID_MEMBER}", __FILE__, __LINE__);
return "Your pet eats the poison and dies!";
}
}
}
?>