Вход Регистрация
Файл: transfer_things.php
Строк: 152
<?php

include_once("settings.php");
include_once(
"game_header.php");
include_once(
"log.php");
include_once(
"player_thing.php");
include_once(
"player_transfer.php");

$log_me= new CLogPlayers($db,$vnum);
$player_thing = new CPlayerThings($db,$vnum);
$thing = new CThing($db);
$player_transfer = new CPlayerTransfer($db,$vnum);


if(isset(
$thing_id) && isset($thing_count)){
    
$smarty->assign('VNUM_OBJ',$thing_id);
    
$smarty->assign('VNUM_COUNT',$thing_count);

    
$thing_obj=$player_thing->getThingID($thing_id);
    
$thing->setVnum($thing_obj);
    
$thing_name $thing->getName();
    
$smarty->assign('THING_NAME',$thing_name);
}



if(isset(
$mode))
{
    switch (
$mode)
    {
        case 
'send':
        if(!isset(
$_POST['transfer_amount']) || !isset($_POST['to_player_name']) || !isset($_POST['transfer_comment']))
        {
            
$info_msg "ъБРПМОЙФЕ ЧУЕ РПМС. йОБЮЕ РЕТЕЧПД ХКДЕФ ОБ ДЕТЕЧОА ДЕДХЫЛЕ.";
            break;
        }
        
$to_player_name=$_POST['to_player_name'];
        
$to_player_id=$player->checkCreatureName($to_player_name);
        if(
$to_player_id==false){
            
$info_msg "фХФ ПФТБДСУШ ОЕ УМЩЫБМЙ П ЙЗТПЛЕ $to_player_name";
            break;
        }
        
$transfer_comment=$_POST['transfer_comment'];
        if(
strlen($transfer_comment)<5){
            
$info_msg "оБРЙЫЙФЕ ЛПННЕОФБТЙК РПДМЙООЕК";
            break;
        }
        
$transfer_amount $_POST['transfer_amount'];
        
$transfer_amount=floor($transfer_amount);
        if(
$transfer_amount<0){
            
$info_msg "дЕОШЗЙ ТБЪХЮЙМЙУШ УЮЙФБФШ.";
            break;
        }
        
//check player have this thing
        
$count=$player_thing->getCountThing($thing_id,1);
        if(
$count<$thing_count){
            
$info_msg "х ЧБУ ОЕФ ФБЛПЗП ЛПМЙЮЕУФЧБ ЧЕЭЕК";
            break;
        }
        
$durability=$player_thing->getDurability($thing_id);
        
$max_durability=$player_thing->getDurabilityMax($thing_id);
        
//start transfer

        //remove player things
        
$player_thing->removeThing($thing_id,$thing_count,1);

        
//add thing to temporaly tables
        
$player_transfer->transferThing($thing_obj,$vnum,$to_player_id,$thing_count,$transfer_amount,
        
$durability,$max_durability,$transfer_comment);

        
//add log
        
$msg="чЩ РЕТЕЧЕМЙ <b>$thing_name</b> Ч ЛПМЙЮЕУФЧЕ <b>$thing_count</b> ЫФХЛ ЙЗТПЛХ <b>$to_player_name</b> c ЛПННЕОФБТЙЕН: <i>$transfer_comment</i>";
        
$log_me->addTypeLogMsg(LOGS_TRANSFER_THINGS,$msg);
        
$log_to= new CLogPlayers($db,$to_player_id);
        
$msg="йЗТПЛ <b>$player_name</b> РЕТЕЧЕМ ЧБН <b>$thing_name</b> Ч ЛПМЙЮЕУФЧЕ <b>$thing_count</b> c ЛПННЕОФБТЙЕН: <i>$transfer_comment</i>";
        
$log_to->addTypeLogMsg(LOGS_TRANSFER_THINGS,$msg);

        
$info_msg="рЕТЕЧПД УПУФПСМУС ХУРЕЫОП";
        
session_unregister("thing_id");
        
session_unregister("thing_count");
        break;
    }
    
session_register("info_msg");
    
header("Location: transfer_things.php");
    exit();
}

if(isset(
$info_msg))
{
    
$smarty->assign('INFO_MSG',$info_msg);
    
session_unregister("info_msg");
}

//get previos logs
$prev_logs=$log_me->getLogTypeMsgs(LOGS_TRANSFER_THINGS);

foreach(
$prev_logs as $v)
{
    
$smarty->append("prev_msg",array(
    
'DATA' => $v['pdate'],
    
'MSG' => $v['text'],
    ));
}


$t_money_t=$smarty->fetch($templ_path.'/transfer_things.tpl');
$smarty->assign('MAIN',$t_money_t);
$smarty->display($templ_path.'/game.tpl');

?>
Онлайн: 0
Реклама