Changeset 137 for db/include/position_reset.php
- Timestamp:
- Nov 17, 2007, 8:57:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
db/include/position_reset.php
r136 r137 16 16 global $user; 17 17 $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 ) 20 20 { 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"); 22 22 $this->char_name = false; 23 23 } 24 24 else 25 25 { 26 $this->char_name = $ load["name"];26 $this->char_name = $this->character["name"]; 27 27 } 28 28 } 29 29 30 public function GoHome()30 public function StartLocation() 31 31 { 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"); 33 33 $load_home = mysql_fetch_array($sql_home); 34 34 $home_char_map = $load_home["map"]; … … 44 44 `position_z` = '".$home_char_position_z."' 45 45 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(); 47 71 } 48 72 } … … 65 89 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) 66 90 { 67 echo "Postava : ".$this->char_name." přesunuta !<br>";91 print("Postava : ".$this->char_name." přesunuta !<br>"); 68 92 } 69 93 else 70 94 { 71 echo "Postavu : ".$this->char_name." se nepovedlo přesunout !<br>";95 print("Postavu : ".$this->char_name." se nepovedlo přesunout !<br>"); 72 96 } 73 97 }
Note:
See TracChangeset
for help on using the changeset viewer.