Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $default_item_count = array("weapon"=>4, "food"=>12, "chest"=>2, "shield"=>2, "boots"=>2, "leggins"=>2, "helm"=>2);
- $generated_time = self::getLastShopGenerateTime($link,$playerID);
- // Současný čas menší než čas generování + 28800 sekund negovaně
- if(time() < $generated_time + 28800) goto jumped;
- // Get actual count of items, compare it with defaults and generate missing
- foreach($default_item_count as $c=>$d)
- {
- echo($c."=>".$d."<br>");
- $cnt_g = self::getItemCount($link, $playerID, $c);
- for($i = $cnt_g; $i < $d; $i++)
- {
- // Item is weapon
- if($c == "weapon")
- {
- $item_gch = self::generateWeapon($playerLevel);
- }
- // Item is food
- if($c == "food")
- {
- $item_gch = self::generateFood($playerLevel);
- }
- if($c == "chest" || $c == "shield" || $c == "boots" || $c = "leggins" || $c == "helm")
- {
- $item_gch = self::generateArmor($playerLevel, $c);
- echo("<br>");
- }
- foreach($item_gch as $o=>$p)
- {
- $$o = $p;
- }
- $sql = "INSERT INTO `game_users_shop` (`itemPrice`, `playerID`, `itemName`, `itemCreated`, `itemType`, `modifier`, `modifierType`, `modifierTarget`) VALUES ('$itemPrice','$playerID', '$itemName', '".time()."', '$itemType', '$modifier', '$modifierType', '$modifierTarget')";
- mysqli_query($link, $sql);
- }
- }
- $sql = "UPDATE game_users SET lastShopGenerated='".time()."' WHERE id='".$playerID."'";
- //mysqli_query($link, $sql);
- echo("not jumped/");
- jumped:
- echo("after jumped");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement