What's new

PHP [Nicaw Acc]SMS Shop + Dodatki

Status
Not open for further replies.

SanninStory

https://www.twitch.tv/sdrn
Joined
Oct 13, 2012
Messages
1,778
Reaction score
119
Witam.

Chcia?bym wam przedstawi? skrypt Autorstwa: z otlandu.
Skrypt zawiera:

- SMS Shop,
- Character Shop,
- EQ Shower,
- Health, Mana Bar,
- Inny wygl?da Characters,
- Nowy Skin


Download:


Instalacja:
1. Ilo?? PP w Koncie:
a. Dodaj w account.php pod:
PHP:
 <?php
if(isset($account->attrs['premend']) && $account->attrs['premend'] > time()) {
    echo '<b>Premium status:</b> You have ';
    $days = ceil(($account->attrs['premend'] - time())/(3600*24));
    if($days <= 5) echo '<b style="color: red">';
        else echo '<b>';
    echo $days.'</b> day(s) left';
    
}
?>
to:
PHP:
</br>

<?php
//points system dodany do strony gracza, dodana funkcja "$this->attrs['points'] = (int) $acc['points'];" w class/account.php punkty odczytywane z accounts, nie z players
if ($account->attrs['points']) {
    echo '<b>Shop points status:</b> You have ';
    $points = ceil(($account->attrs['points']));
    if($points <= 5) echo '<b style="color: red">';
        else echo '<b>';
   echo $points.'</b> point(s)';
}
?>
b. W class/account.php dodajemy przed:
PHP:
$this->attrs['accno'] = (int) $acc['id'];
to:
PHP:
$this->attrs['points'] = (int) $acc['points'];

2. Pacc i darmowe PP:
a. w class/account.php dodajemy pod:
PHP:
        unset($d);
        $d['id'] = $accno;
        $d['password'] = Account::encodePassword($password);
to:
PHP:
        //pacc for new account configure        
        {global $cfg;
        $pacday = ($cfg['pac_day']);
                   $pa = ceil((time()) + (86400 * $pacday));
        $d['premend'] = $pa;
        }


        //premium points for new account configure        
        {global $cfg;
        $pr_points = ($cfg['pr_points']);
        $d['points'] = $pr_points;
        }
b. W configu dodajemy:
PHP:
#Pacc for new acc:
$cfg['pac_day'] = 46;
#Free premium points for new acc
$cfg['pr_points'] = 50;

3. EQ Shower, HP, MANA w podgl?dzie postaci:
a. W configu dodajemy:
PHP:
//specx edited
# Whether to SHOW EQ in character search eq, hp, mana, exp /made by specx
$cfg['show_items'] = true;
# Show soul points. Use it for ot > 7.4
$cfg['show_soul'] = false;
b. Dodajemy folder items z Paczki
c. Podmieniamy Characters.php
d. W class/player.php zmieniamy to:
PHP:
class Player {
    private $attrs, $skills, $storage, $deaths, $guild, $is_online, $sql;
na to:
PHP:
class Player {
    private $attrs, $skills, $storage, $deaths, $guild, $is_online, $sql, $items;
d2. Pod tym:
PHP:
        private function load_skills() {
        if(empty($this->attrs['id'])) throw new PlayerNotLoadedException();
        $this->sql->myQuery('SELECT * FROM `player_skills` WHERE `player_id` = '.$this->sql->quote($this->attrs['id']));
        while($a = $this->sql->fetch_array()) {
            $this->skills[$a['skillid']]['skill'] = (int)$a['value'];
            $this->skills[$a['skillid']]['tries'] = (int)$a['count'];
        }
        return true;
    }
dodajemy:
PHP:
/// SHOW EQ
    
        private function load_items() {
        if(empty($this->attrs['id'])) throw new PlayerNotLoadedException();
        $this->sql->myQuery ("SELECT * FROM `player_items` WHERE (`player_id` = '".$this->sql->quote($this->attrs['id'])."') ORDER BY FIELD(`pid`, 2, 1, 3, 6, 4, 5, 9, 7, 10, 8) ASC");
        //$this->sql->myQuery('SELECT * FROM `player_items` WHERE `pid` <=10 AND `player_id` = '.$this->sql->quote($this->attrs['id']).') ORDER BY FIELD(`pid`, 2, 1, 3, 6, 4, 5, 9, 7, 10, 8) ASC';
        //$this->sql->myQuery('SELECT * FROM `player_items` WHERE `pid` = 2 AND `player_id` = '.$this->sql->quote($this->attrs['id']));
        while($a = $this->sql->fetch_array())
        {
        //org $this->items[$a['pid']]['item'] = (int)$a['itemtype'];
        $this->items[$a['pid']]['item'] = (int)$a['itemtype'];
        }
        return true;
    }    
///
pod tym:
PHP:
$this->attrs['guildnick'] = (string) $player['guildnick'];
dodajemy:
PHP:
        ///SHOW EQ
        $this->attrs['cap'] = (int) $player['cap'];
        $this->attrs['soul'] = (int) $player['soul'];
        $this->attrs['health'] = (int) $player['health'];
        $this->attrs['healthmax'] = (int) $player['healthmax'];
        $this->attrs['mana'] = (int) $player['mana'];
        $this->attrs['manamax'] = (int) $player['manamax'];
        $this->attrs['experience'] = (int) $player['experience'];
pod tym:
PHP:
        }elseif($attr == 'skills') {
            if(empty($this->skills)) $this->load_skills();
            return $this->skills;
dajemy to:
PHP:
            ///SHOW EQ
        }elseif($attr == 'items') {
            if(empty($this->items)) $this->load_items();
            return $this->items;
            ///

4. Shop System:
a. W bazie danych wykonujemy zapytanie:
PHP:
ALTER TABLE `accounts` ADD `points` int(11) NOT NULL;
ALTER TABLE `accounts` ADD `points_history` int(11) NOT NULL;

ALTER TABLE `players` ADD `shop` int(11) NOT NULL;
ALTER TABLE `players` ADD `price` int(11) NOT NULL;

CREATE TABLE IF NOT EXISTS `shop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `info` text NOT NULL,
  `price` int(11) NOT NULL,
  `image` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
b. Do configu dodajemy:
PHP:
#Whether to Sell Player panel in account
$cfg['show_sell_player_panel'] = true;
# Level at which player can be sold in shop
$cfg['player_lvl_sell'] = 5;
c. Z paczki dodajemy pliki:
Code:
shop_history.php
shopadd.php

add_points.php
add_sms_points.php
add_sms_points_paygol.php
paygol.php

add_player.php
remove_player.php
shop_player2.php
buy_player.php

shop.php
buy.php
d. W admin.php dodajemy pod tym:
PHP:
<li onclick="self.window.location.href='tools/php_info.php'" style=" background-image: url(resource/information.png);">PHP Info</li>
to:
PHP:
</br>
<li onclick="self.window.location.href='shop_history.php'" style=" background-image: url(resource/book_open.png);">Shop History</li>
<li onclick="self.window.location.href='shopadd.php'" style=" background-image: url(resource/add.png);">Add item to shop</li>
e.W account.php dodajemy pod tym:
PHP:
<li onclick="ajax('ajax','modules/character_create.php','',true)" style="background-image: url(resource/user_add.png);">Create Character</li>
to:
PHP:
<li onclick="self.window.location.href='add_player.php'" style=" background-image: url(resource/add.png);">Add Character to shop</li>
<li onclick="self.window.location.href='remove_player.php'" style=" background-image: url(resource/cross.png);">Remove Character from shop</li>
f. Przed tym:
PHP:
?>
<div id="ajax"></div>
</div>
<div class="bot"></div>
</div>
<?php 
include ("footer.inc.php");
?>
dajemy to:
PHP:
///SHOW CHARACTER IN SHOP
$acc = $account->attrs['accno'];

    echo '<h3>Characters in Shop</h3>'."\n";
    
    $wynik44 = mysql_query("SELECT id, name, level, vocation, price FROM players WHERE shop = 1 AND account_id = $acc") 
    or die('query error'); 
    
    if(mysql_num_rows($wynik44) > 0) { 

        echo "<table class=color2 bordercolor=#FFFFFF width=100% cellpadding=4 cellspacing=0 border=1>"; 

        echo "<th class=color0>Name:</th>     <th class=color0>Level:</th>     <th class=color0>Vocation:</th>  <th class=color0>Points:</th></th>";

        echo "<tr>"; 
        
        while($r = mysql_fetch_assoc($wynik44)) 
        { 
            $id_player = $r['id'];
    
            echo ' <td><center><a href="characters.php?player_name='.($r['name']).'">'.$r['name'].'</a></center></td>';
        
            echo "<td><center> ".$r['level']."</center></td>"; 
            
            if ($r['vocation'] == 1)
                {
                echo "<td><center> Sorcerer</center></td>";
                }
                elseif ($r['vocation'] == 2)
                {
                echo "<td><center> Druid</center></td>";
                }
                elseif ($r['vocation'] == 3)
                {
                echo "<td><center> Paladin</center></td>";
                }
                elseif ($r['vocation'] == 4)
                {
                echo "<td><center> Knight</center></td>";
                }
                elseif ($r['vocation'] == 5)
                {
                echo "<td><center> Master Sorcerer</center></td>";
                }
                elseif ($r['vocation'] == 6)
                {
                echo "<td><center> Elder Druid</center></td>";
                }
                elseif ($r['vocation'] == 7)
                {
                echo "<td><center> Royal Paladin</center></td>";
                }
                elseif ($r['vocation'] == 8)
                {
                echo "<td><center> Elite Knight</center></td>";
                }

            
                echo "<td><center>".$r['price']."</center></td>";
             
                echo "</tr>"; 
        } 
        echo "</table>"; 
    
    }
    else
    {
    echo '<img src="resource/user_red.png"/>'; 
    echo " You don't have player in shop";
    }
//end character in shop
5. W navigation.xml dodajemy to:
PHP:
<category name="SHOP">
<item href="shop.php">Buy item</item>
<item href="shop_player2.php">Buy Player</item>
<item href="add_points.php">Add points</item>

</category>

GOTOWE.

Screeny:
2wgw.png

3vgv.png

4kvk.png

5.png

7srs.png

8dmd.png

9bcb.png

10cwc.png

11lwl.png

12.png


Download:


Pozdrawiam i je?li mo?na Rep+.
 

Payoss

Advanced User
Joined
May 15, 2012
Messages
214
Reaction score
10
Odp: [Nicaw Acc]SMS Shop + Dodatki

Bardzo fajnie rozbudowany shop, na pewno sie komus przyda :)
Pozdrawiam
 

TenTypSwir

NNSTORY.EU Developer
Joined
Jun 8, 2010
Messages
1,657
Reaction score
117
Odp: [Nicaw Acc]SMS Shop + Dodatki

Widzialem to bodajze na otlandzie ;p Daj link do oryginalnego tematu + "Wymuszanie reputacji" jest karane <haha>

Dobra paczkua :S
 

SanninStory

https://www.twitch.tv/sdrn
Joined
Oct 13, 2012
Messages
1,778
Reaction score
119
Odp: [Nicaw Acc]SMS Shop + Dodatki

@UP,
Wystarczy ?e poda?em Autora i link do jego profilu.
Nie wymuszam Rep, tylko napisa?em ?e je?li mo?na, to nie jest wymuszenie :)

@Topic,
Zawsze mo?na wzi?? tylko dan? cz??? skrypt?w a nie ca?? paczk?.

Pozdrawiam.
 
Status
Not open for further replies.
Top