Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - checho_vacan

Pages: [1]
1
Items / Help with my Item: Soul Eater
« on: December 14, 2006, 11:50:28 pm »
Hi, im noob on this... so i want to make some items... i had like 3 now n_n

This item it's called "Soul Eater" (aka Chupasangre)

the code is very simple, but i want to implement a little more of code


What i does?

- Steal 15 Karma point to a user and give it to you (>=D)
- you need to use 30 extra gold when use it

My problem is that if the user have 0 gold, still can use the item ¬¬.... please some one fix this :D

chupasangre.php
Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2006 DanSoft Australia           |
|      http://www.dansoftaustralia.net/        |
\**********************************************/

//File: testitem.php
//      Test Item (requires NO input)

// VERSION: 2.3 (Build 11)
// $Date: 2006-10-21 13:34:18 +1000 (Sat, 21 Oct 2006) $
// $Id: testitem.php 24 2006-10-21 03:34:18Z daniel15 $

// Your class should always be called item_filename, eg. if your file is 
// myCoolItem.php then the class should be called 'item_myCoolItem'. This 
// class should always extend itemTemplate.
class item_chupasangre extends itemTemplate {

// When this function is called, you should set all the item's
// variables (see inside this example)
function getItemDetails() {

// The author's name
$this->authorName "Checho";
// The author's website
$this->authorWeb "http://www.foro-qliao.cl.nu/";
// The author's email address
$this->authorEmail "chechovacan@gmail.com";

//VALUES CHANGEABLE FROM WITHIN ADMIN PANEL:
// The name of the item
$this->name "Chupasangre";
// The item's description
$this->desc "Este item te permite robar cosmo y agregarlo al tuyo";
// The item's price
$this->price 100000;
   }

    function 
getUseInput() {
global $context$scripturl$settings$txt;
        return 
"Nombre de usuario: <input type='text' name='username' />
        <a href='
{$scripturl}?action=findmember;input=username;quote=0;sesc={$context['session_id']}' onclick='return reqWin(this.href, 350, 400);'><img src='{$settings['images_url']}/icons/assist.gif' border='0' alt='{$txt['find_members']}' /> Burcar</a><br />";
   
}
    function 
onUse() {
        global 
$db_prefix$ID_MEMBER$item_info;
        if (!isset(
$_POST['username']) || $_POST['username'] == '') die("ERROR: Debes ingresar un nombre de usuario!");
    
//    if (!isset($ID_MEMBER == '(money < 30)') die("Debes tener almenos 30 de oro para usar este item");

$result db_query("UPDATE {$db_prefix}members
                                SET karmaGood = karmaGood + 15, money = money - 30
WHERE ID_MEMBER = 
{$ID_MEMBER}"__FILE____LINE__);

        
$result db_query("UPDATE {$db_prefix}members
                            SET karmaBad = karmaBad + 15
                            WHERE memberName = '
{$_POST['username']}'",
                            
__FILE____LINE__);
         return 
"Le haz robado 15 puntos de cosmo a {$_POST['username']}!";
    }

}

?>


2
Installation Problems / Hi there!... problems with Egg user avatar!
« on: December 08, 2006, 10:24:01 pm »
Hi, im a little noob... im trying to use this cool items in my shop, but when y configures the item, i buy it and all... then im tryingo to use it and justo appears a white screen whit tis

"Egg is an unknown filetype"

Why?....

PD: My english is very bad... im using this in a spanish smf forum... thanks!

Pages: [1]