Changeset 137 for db/include/xp_reset.php
- Timestamp:
- Nov 17, 2007, 8:57:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
db/include/xp_reset.php
r136 r137 5 5 var $char_id; 6 6 var $char_name; 7 var $poradi = 856; // XP je an pozici 857 ale začínáme od 0 7 8 8 9 function __construct($char_id) … … 34 35 $data_old = $load_res["data"]; 35 36 $pole = explode(" ",$data_old); 36 // XP - 857 37 $poradi = 857; 38 $poradi = $poradi - 1; 39 echo "Postava ".$this->char_name." má ".$pole[$poradi]." XP.<br>\n"; 37 if( !isset($pole[$this->poradi]) ) 38 { 39 print("Postava nemá definované XP! Je to závažná chyba v databázi!<br>\n"); 40 } 41 else{ 42 print("Postava ".$this->char_name." má ".$pole[$this->poradi]." XP.<br>\n"); 43 } 40 44 } 41 45 … … 46 50 $data_old = $load_res["data"]; 47 51 $pole = explode(" ",$data_old); 48 // XP - 857 49 $poradi = 857; 50 $poradi = $poradi - 1; 51 $pole[$poradi] = "0"; 52 $save = mysql_query("UPDATE `character` SET `data` = '".$pole."' WHERE `guid` ='".$this->char_id."' LIMIT 1"); 52 $pole[$this->poradi] = 0; 53 if( !isset($pole[$this->poradi]) ) 54 { 55 print("Postava nemá definované XP! Je to závažná chyba v databázi!<br>\n"); 56 } 57 else{ 58 mysql_query("UPDATE `character` SET `data` = '".implode(" ", $pole)."' WHERE `guid` ='".$this->char_id."' LIMIT 1"); 59 }; 53 60 } 54 61 … … 59 66 $data_old = $load_res["data"]; 60 67 $pole = explode(" ",$data_old); 61 // XP - 857 62 $poradi = 857; 63 $poradi = $poradi - 1; 64 if ( $pole[$poradi] == "0") 68 if( !isset($pole[$this->poradi]) ) 65 69 { 66 echo "Restart XP dokončen !<br>\n"; 70 print("Postava nemá definované XP! Je to závažná chyba v databázi!<br>\n"); 71 } 72 elseif ( $pole[$this->poradi] == 0 ) 73 { 74 print("Restart XP dokončen !<br>\n"); 67 75 } 68 76 else 69 77 { 70 echo "Restart XP se nezdařil !<br>\n";78 print("Restart XP se nezdařil !<br>\n"); 71 79 } 72 80 }
Note:
See TracChangeset
for help on using the changeset viewer.