Advertisement
Sognus

hidden error enjoy

May 6th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.71 KB | None | 0 0
  1.    $default_item_count = array("weapon"=>4, "food"=>12, "chest"=>2, "shield"=>2, "boots"=>2, "leggins"=>2, "helm"=>2);
  2.     $generated_time = self::getLastShopGenerateTime($link,$playerID);
  3.    
  4.     // Současný čas menší než čas generování + 28800 sekund negovaně
  5.     if(time() < $generated_time + 28800) goto jumped;
  6.    
  7.     // Get actual count of items, compare it with defaults and generate missing
  8.     foreach($default_item_count as $c=>$d)
  9.     {
  10.       echo($c."=>".$d."<br>");
  11.       $cnt_g = self::getItemCount($link, $playerID, $c);
  12.      
  13.       for($i = $cnt_g; $i < $d; $i++)
  14.       {
  15.         // Item is weapon
  16.         if($c == "weapon")
  17.         {
  18.           $item_gch = self::generateWeapon($playerLevel);
  19.         }
  20.        
  21.         // Item is food
  22.         if($c == "food")
  23.         {
  24.           $item_gch = self::generateFood($playerLevel);
  25.         }
  26.        
  27.         if($c == "chest" || $c == "shield" || $c == "boots" || $c = "leggins" || $c == "helm")
  28.         {
  29.           $item_gch = self::generateArmor($playerLevel, $c);
  30.           echo("<br>");
  31.         }
  32.        
  33.         foreach($item_gch as $o=>$p)
  34.         {
  35.           $$o = $p;
  36.         }
  37.  
  38.         $sql = "INSERT INTO `game_users_shop` (`itemPrice`, `playerID`, `itemName`, `itemCreated`, `itemType`, `modifier`, `modifierType`, `modifierTarget`) VALUES ('$itemPrice','$playerID', '$itemName', '".time()."', '$itemType', '$modifier', '$modifierType', '$modifierTarget')";
  39.         mysqli_query($link, $sql);      
  40.        
  41.       }
  42.    
  43.     }
  44.     $sql = "UPDATE game_users SET lastShopGenerated='".time()."' WHERE id='".$playerID."'";
  45.     //mysqli_query($link, $sql);
  46.     echo("not jumped/");
  47.    
  48.     jumped:
  49.     echo("after jumped");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement