Ignore:
Timestamp:
Nov 17, 2007, 8:57:23 PM (17 years ago)
Author:
hosiplan
Message:

+ snad už konečně funkční verze XP_restarteru a Position_restarteru

File:
1 edited

Legend:

Unmodified
Added
Removed
  • db/include/position_reset.php

    r136 r137  
    1616      global $user;
    1717      $sql = mysql_query("SELECT * FROM `character` WHERE `guid` = '".$this->char_id."' AND `account`='".$user['acc']."' LIMIT 1");
    18       $load = mysql_fetch_array($sql);
    19       if( $load['online'] != 0 )
     18      $this->character = mysql_fetch_array($sql);
     19      if( $this->character['online'] != 0 )
    2020      {
    21         print("Nemůžete přesouvat postavu, která je online! Nejprve se odhlašte!<br>");
     21        print("Nemůžete přesouvat postavu, která je online! Nejprve se odhlašte!<br>\n");
    2222        $this->char_name = false;
    2323      }
    2424      else
    2525      {
    26         $this->char_name = $load["name"];
     26        $this->char_name = $this->character["name"];
    2727      }
    2828    }
    2929   
    30     public function GoHome()
     30    public function StartLocation()
    3131    {
    32       $sql_home = mysql_query("SELECT * FROM `character_homebind` WHERE `guid` = '".$this->char_id."' LIMIT 1");
     32      $sql_home = mysql_query("SELECT * FROM `playercreateinfo` WHERE `race` = '".$this->character['race']."' AND `class` = '".$this->character['class']."' LIMIT 1");
    3333      $load_home = mysql_fetch_array($sql_home);
    3434      $home_char_map         = $load_home["map"];
     
    4444        `position_z` = '".$home_char_position_z."'
    4545         WHERE `guid` ='".$this->char_id."' LIMIT 1");
    46          echo "Přesouvám postavu : ".$this->char_name.".<br>";
     46         print("Přesouvám postavu : ".$this->char_name." na startovní lokaci.<br>");
     47        }
     48    }
     49   
     50    public function GoHome()
     51    {
     52      $sql_home = mysql_query("SELECT * FROM `character_homebind` WHERE `guid` = '".$this->char_id."' LIMIT 1");
     53      $load_home = mysql_fetch_array($sql_home);
     54      $home_char_map         = $load_home["map"];
     55      $home_char_position_x  = $load_home["position_x"];
     56      $home_char_position_y  = $load_home["position_y"];
     57      $home_char_position_z  = $load_home["position_z"];
     58        if (isset($home_char_map) AND isset ($home_char_position_x) AND isset ($home_char_position_y) AND isset ($home_char_position_z))
     59        {
     60          $save = mysql_query("UPDATE `character` SET
     61          `map` = '".$home_char_map."' ,
     62          `position_x` ='".$home_char_position_x."' ,
     63          `position_y` = '".$home_char_position_y."' ,
     64          `position_z` = '".$home_char_position_z."'
     65           WHERE `guid` ='".$this->char_id."' LIMIT 1");
     66           print("Přesouvám postavu : ".$this->char_name." domů.<br>");
     67        }
     68        else
     69        {
     70          $this->StartLocation();
    4771        }
    4872    }
     
    6589      if ($home_char_map == $char_map AND $home_char_position_x == $char_position_x AND $home_char_position_y == $char_position_y AND $home_char_position_z == $char_position_z)
    6690      {
    67         echo "Postava : ".$this->char_name." přesunuta !<br>";
     91        print("Postava : ".$this->char_name." přesunuta !<br>");
    6892      }
    6993      else
    7094      {
    71         echo "Postavu : ".$this->char_name." se nepovedlo přesunout !<br>";
     95        print("Postavu : ".$this->char_name." se nepovedlo přesunout !<br>");
    7296      }
    7397    }
Note: See TracChangeset for help on using the changeset viewer.