Tudo que ykky postou
-
Shop modern acc
Olá, hoje venho pedir ajuda a vocês em um pequeno problema, eu tenho o shop para modern acc, e nele tem varias opções entre elas a "modificações na conta", e nela você pode vender desban, remover skull e etc.. gostaria que alguém que entenda modifica-se o script para que ele tivesse também a opção de troca de vocação, quando o player compra-se o site diria que ele precisava estar off-line e caso o player já estivesse off-line e consegui-se comprar ele modificasse os números da vocação la no mysql do player para um numero "x", quem puder me ajuda agradecerei muito, vlw. Script: <script type="text/javascript"> $(function() { $("#accordion").accordion({ autoHeight: false, navigation: true }); }); </script> <?PHP //Product Types //Categories : // //[ 1 - Account Modifications ] //1 - Premium //2 - Remove Skull (ANY) //3 - UnBan Account //4 - Change Name // //[ 2 - Items ] //5 - Items // //[ 3 - Container Fully of Items ] //6 - Bag of Items //7 - Backpack of Items // //[ 4 - Addons Items ] //8 - Addon Items // //HOWTO PUT IMAGES FOR TYPES 1-4 [ Account Modifications ] //Go to public/images/ folder and create a GIF image (Or put) //With the ID of the type [see at the top of the script] //Ex. Type (1) - Premium Account (public/images/1.gif) //Variables require("config.php"); include("config/functions.php"); require("config/config.php"); $this->load->helper("url"); $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); $SHOP = new shop; $ide = new IDE; $action = $this->uri->segment(4); $categories = array(1 => 'Account Modifications', 2 => 'Items', 3 => 'Containers with Items', 4 => 'Addon Items'); if ($_SESSION['logged'] == 1) { if ($SHOP->isInstalled()) { if ($action == '') { if($ide->isAdmin()) { echo "<div class='toolbar' align='center'>"; echo "<a href='".WEBSITE."/index.php/p/v/gifts/admin'>Shop Admin Panel</a>"; echo "</div>"; } alert("<b>REMEMBER:</b><br><br>All categories, <b>except for 'Containers with Items'</b>:<br><br>Receiver need to have space on his/her <b>BACKPACK</b> to receive item."); echo '<div id="accordion">'; $i = 0; foreach($categories as $key=>$value) { echo '<h3><a href="#">'.$categories[$key].'</a></h3> <div>'; if($SQL->query('SELECT * FROM shop_offer WHERE category = '.$key.'')->fetch()) { echo '<table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td width="20%" class="white" style="text-align: center; font-weight: bold;">Picture</td> <td width="40%" class="white" style="text-align: center; font-weight: bold;">Product</td> <td width="20%" class="white" style="text-align: center; font-weight: bold;">Points</td> <td width="20%" class="white" style="text-align: center; font-weight: bold;">Action</td> </tr>'; foreach($SQL->query('SELECT * FROM shop_offer WHERE category = '.$key.'') as $item) { if (is_int($i / 2)) $bgcolor = "#ececec"; else $bgcolor = "#ffffff"; $i++; echo '<tr class="highlight" bgcolor="'.$bgcolor.'" style="text-align: center;"> <td>'; if($item['category'] == '1') $image = 'public/images/'.$item['type'].'.gif'; else $image = 'public/images/items/'.$item['item'].'.gif'; if(!file_exists($image)) echo 'NO IMAGE'; else echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>'; echo '</td> <td><b>'.$item['name'].'</b><br>'.$item['description'].'</td> <td>'.$item['points'].'</td> <td><font color="#FF0000"><button type="submit" onClick="window.location.href=\''.WEBSITE.'/index.php/p/v/gifts/buy/'.$item['id'].'\';" class="ide_button"><font color="#071918">Buy Product</button></td> </tr>'; } echo '</table></div>'; } else { alert("This category doesn't have products."); echo '</div>'; } } echo '</div>'; echo '<br><center><font style="color: #58FAF4; font-weight: bold; font-size: 12px">You have: <font color="#58FAF4">'.$SHOP->points($_SESSION['name']).'</font> premium points.</font></center>'; } elseif ($action == 'buy') { $product = $this->uri->segment(5); $productact = $this->uri->segment(6); if (!$product) { alert("You didn't have selected a product."); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts">Go Back to Gift Shop</a></div>'; } else { if($SQL->query('SELECT * FROM shop_offer WHERE id = '.$product.'')->fetch()) { $info = $SQL->query('SELECT * FROM shop_offer WHERE id = '.$product.'')->fetch(); if($productact == '' || !$productact) { if ($SHOP->points($_SESSION['name']) < $info['points']) { alert("You don't have enough points to buy this product (<b>".$info['points']."</b>)"); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts">Go Back to Gift Shop</a></div>'; } else { echo '<div id="accordion">'; echo '<h3><a href="#">Product Selected</a></h3> <div>'; echo '<table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td width="25%" class="white" style="text-align: center; font-weight: bold;">Picture</td> <td width="50%" class="white" style="text-align: center; font-weight: bold;">Product</td> <td width="25%" class="white" style="text-align: center; font-weight: bold;">Points</td> </tr>'; echo '<tr class="highlight" style="text-align: center"> <td>'; if($info['category'] == '1') $image = 'public/images/'.$info['type'].'.gif'; else $image = 'public/images/items/'.$info['item'].'.gif'; if(!file_exists($image)) echo 'NO IMAGE'; else echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>'; echo '</td> <td><b>'.$info['name'].'</b><br>'.$info['description'].'</td> <td>'.$info['points'].'</td> </tr>'; echo '</table></div> <h3><a href="#">Player Selection</a></h3> <div> <center><table border="0" cellspacing="7" cellpadding="4" width="50%"> <tr> <td><form method="post" action="'.WEBSITE.'/index.php/p/v/gifts/buy/'.$info['id'].'/send">'; if($info['type'] == '4') echo 'Character to Change Name:'; else echo 'Give item to player:'; echo '</td> <td><select name="my_char">'; foreach($SHOP->CharacterList($_SESSION['name']) as $row) echo '<option>'.$row['name'].'</option>'; echo '</select></td> </tr> <tr> <td>'; if($info['type'] == '4') echo 'New Name:'; else echo 'Or another player:'; echo '</td> <td><input type="text" name="other_char" size="10"/></td> </tr> <tr> <td></td> <td><button type="submit" name="submit" value="true" class="ide_button">Buy Product</td> </tr></table></center></div></div>'; echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/">Go Back to Gift Shop</a></div>'; } } elseif ($productact == 'send') { if(!$_POST['submit']) header("Location: ".WEBSITE."/index.php/p/v/gifts"); else { $info = $SQL->query('SELECT * FROM shop_offer WHERE id = '.$product.'')->fetch(); if ($SHOP->points($_SESSION['name']) < $info['points']) { alert("You don't have enough points to buy this product (<b>".$info['points']."</b>)"); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts">Go Back to Gift Shop</a></div>'; } else { if($info['type'] != '4') { if($_POST['other_char']) { if($SQL->query('SELECT * FROM players WHERE name = "'.$_POST['other_char'].'"')->fetch()) { $destination = $_POST['other_char']; $send = true; } else { alert('<b>'.$_POST['other_char'].'</b> doesn\'t exists.'); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/buy/'.$info['id'].'">Go Back to Gift Shop</a></div>'; $send = false; } } else { $destination = $_POST['my_char']; $send = true; } } else { $destination = $_POST['my_char']; $send = true; } if($send == true) { $errors = ''; $processed = 0; if ($info['type'] == '1') { $processed = 1; $finish = true; $SHOP->AddPremium($destination,$info['count']); } elseif ($info['type'] == '2') { $skulltime = $SQL->query('SELECT skull,skulltime FROM players WHERE name = "'.$destination.'"')->fetch(); if ($SHOP->isOnline($destination) == 1) { $errors .= 'Sorry, but <b>'.$destination.'</b> is On-Line right now.<br>'; $finish = false; } elseif ($skulltime['skull'] == '0' && $skulltime['skulltime'] == '0') { $errors .= 'Sorry, but <b>'.$destination.'</b> doesn\'t have any skull.<br>'; $finish = false; } else { $processed = 1; $finish = true; $SQL->query('UPDATE players SET skull = 0, skulltime = 0 WHERE name = "'.$destination.'"'); } } elseif ($info['type'] == '3') { if ($SHOP->isOnline($destination) == 1) { $errors .= 'Sorry, but <b>'.$destination.'</b> is On-Line right now.<br>'; $finish = false; } else { if ($SHOP->isBanned($destination)->fetch()) { $processed = 1; $finish = true; $SHOP->UnBan($destination); } else { $errors .= 'Sorry, but <b>'.$destination.'</b>\'s Account isn\'t banned at the moment.<br>'; $finish = false; } } } elseif ($info['type'] == '4') { if ($SHOP->isOnline($destination) == 1) { $errors .= 'Sorry, but <b>'.$destination.'</b> is On-Line right now.<br>'; $finish = false; } else { if ($SQL->query('SELECT * FROM players WHERE name = "'.$_POST['other_char'].'"')->fetch()) { $finish = false; $errors .= 'Sorry, but <b>'.$_POST['other_char'].'</b> already exists.<br>'; } else { if(!$_POST['other_char']) { $finish = false; $errors .= 'Sorry, but you didn\'t put a new name for your character.<br>'; } else { if (!preg_match('/[^A-Za-z]/', $_POST['other_char'])) { $processed = 1; $finish = true; $SQL->query('UPDATE players SET name = "'.$_POST['other_char'].'" WHERE name = "'.$destination.'"'); } else { $finish = false; $errors .= 'Sorry, but <b>'.$_POST['other_char'].'</b> contains invalid characters (Use only: A-Z, a-z).<br>'; } } } } } else { $finish = true; } if ($finish == true) { echo '<div style="text-align: center; font-size: 15px; color: #4EBF37; font-weight: bold;">Transaction Succesfull</div><br>'; if($info['type'] == '4') echo '<center>You have changed the name of <b>'.$destination.'</b> to <b>'.$_POST['other_char'].'</b>.</center>'; elseif($info['type'] == '3') echo '<center>You have UnBanned <b>'.$destination.'</b>\'s Account.</center>'; else echo '<center>You have bought <b>'.$info['name'].'</b> and gave to <b>'.$destination.'</b>.</center>'; echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts">Go Back to Gift Shop</a></div>'; $SQL->query('UPDATE accounts SET premium_points = '.($SHOP->points($_SESSION['name']) - $info['points']).' WHERE name = "'.$_SESSION['name'].'"'); $SQL->query('INSERT INTO shop_history (`id`, `product`, `session`, `player`, `date`, `processed`) VALUES (NULL, \''.$info['id'].'\',\''.$_SESSION['name'].'\', \''.$destination.'\', \''.time().'\',\''.$processed.'\')');; } else { alert($errors); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/buy/'.$info['id'].'">Go Back to Gift Shop</a></div>'; } } } } } } else { header("Location: ".WEBSITE."/index.php/p/v/gifts"); } echo '<br><center><font style="color: #4F82CB; font-weight: bold; font-size: 12px">You have: <font color="#58FAF4">'.$SHOP->points($_SESSION['name']).'</font> premium points.</font></center>'; } } elseif ($action == 'history') { if ($SQL->query('SELECT * FROM shop_history WHERE session = "'.$_SESSION['name'].'" ORDER BY date DESC LIMIT 30')->fetch()) { echo '<div style="text-align: center; font-weight: bold;">Latest 30 Transactions</div> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td class="white" style="text-align: center; font-weight: bold;">Picture</td> <td class="white" style="text-align: center; font-weight: bold;">Product</td> <td class="white" style="text-align: center; font-weight: bold;">To</td> <td class="white" style="text-align: center; font-weight: bold;">Date</td> <td class="white" style="text-align: center; font-weight: bold;">Processed</td> </tr>'; foreach($SQL->query('SELECT `z`.`player` AS `destination`, `z`.`date` AS `date`, `z`.`processed` AS `processed`, `o`.`category` AS `category`,`o`.`type` AS `type`,`o`.`item` AS `item`,`o`.`name` AS `name` FROM `shop_history` z LEFT JOIN `shop_offer` o ON `z`.`product` = `o`.`id` WHERE `z`.`session` = \''.$_SESSION['name'].'\' ORDER BY `z`.`date` DESC LIMIT 30') as $hist) { echo '<tr class="highlight" style="text-align: center"><td>'; if($hist['category'] == '1') $image = 'public/images/'.$hist['type'].'.gif'; else $image = 'public/images/items/'.$hist['item'].'.gif'; if(!file_exists($image)) echo 'NO IMAGE'; else echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>'; echo '</td> <td>'.$hist['name'].'</td> <td>'.$hist['destination'].'</td> <td>'.date("d-m-Y - H:i a", $hist["date"]).'</td>'; if ($hist['processed'] == '1') echo '<td><img src="'.WEBSITE.'/public/images/true.gif"/></td>'; else echo '<td><img src="'.WEBSITE.'/public/images/false.gif"/></td>'; echo '</tr>'; } echo '</table>'; } else { alert('You didn\'t made any transactions'); } } elseif ($action == 'donate') { $show = $this->uri->segment(5); if ($show == 'history') { if ($SQL->query('SELECT * FROM shop_donation_history WHERE buyer = "'.$_SESSION['name'].'" ORDER BY date DESC LIMIT 30')->fetch()) { echo '<div style="text-align: center; font-weight: bold;">Latest 30 Donations</div> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td class="white" style="text-align: center; font-weight: bold;">Method</td> <td class="white" style="text-align: center; font-weight: bold;">ID/Mail</td> <td class="white" style="text-align: center; font-weight: bold;">To Account</td> <td class="white" style="text-align: center; font-weight: bold;">Points Added</td> <td class="white" style="text-align: center; font-weight: bold;">Date</td> </tr>'; foreach($SQL->query('SELECT * FROM shop_donation_history WHERE buyer = "'.$_SESSION['name'].'" ORDER BY date DESC LIMIT 30') as $hist) { echo '<tr class="highlight" style="text-align: center"> <td>'; echo ($hist['method'] == 'PayPal')?'<img src=https://www.paypal.com/en_US/i/logo/paypal_logo.gif" height="50px" width="100px">':($hist['method] == 'ContenidoPago')?'<img src="http://www.contenidopago.com/img/logo_ft.jpg" height="50px" width="100px">':''; echo '</td> <td>'.$hist['receiver'].'</td> <td>'.$hist['account'].'</td> <td>'.$hist['points'].'</td> <td>'.date("d-m-Y - H:i a", $hist["date"]).'</td> </tr>'; } echo '</table>'; } else { alert('You didn\'t donated'); } } elseif (!$show || $show == '') { alert("".$config['server_name']."'s Administration <b>is not responsible</b> for <b>cases of loss of products</b>.<br><br> ".$config['server_name']."'s Administration <b>is responsible</b> for <b>cases of loss of points which have been sent to users</b>."); echo '<div id="accordion">'; foreach ($config['donations']['methods'] as $method => $active) { if ($active == true) { echo '<h3><a href="#">'.$method.'</a></h3> <div>'; if ($method == 'ContenidoPago') { alert("This brand new system consists on <b>donations by SMS</b>.<br> After donating you will receive <b>".$config['donations']['contenidopago']['Points']." Points</b>.<br><br> <b>REMEMBER:</b><br> You need to have <b>enough credit</b> to send <u>SMS</u>.<br><br> You <b>MUST</b> fill the <b>Account Name</b> and the <b>Code Received</b> fields with <u>a valid account name</u> and <u>a valid code</u>."); if(!isset($_POST['mysubmit'])) { echo '<form method="post" action="" > <fieldset style="border:1px solid #990000; width:450px; margin:auto;"> <legend style="font-weight:bold;font-size:12px;">Automatic SMS Donation</legend> <ol style="list-style:none;"> <li style="padding-bottom:5px;"><label style="width:100px;float:left;text-align:left;">Account Name:</label><input type="text" style="border:1px solid #CCCCCC;" size="30" name="name" /></li> <li style="padding-bottom:5px;"><label style="width:100px;float:left;text-align:left;">Code received:</label><input type="text" style="border:1px solid #CCCCCC;" size="30" name="codigo" /></li> </ol> <center><input type="submit" name="mysubmit" style="padding:3px;margin-bottom:10px;color:#FFFFFF;background-color:#990000;border:1px solid #000000;" value="Enviar" /></center> </fieldset> </form>'; } else { $codigo=$_POST['codigo']; $name=$_POST['name']; $QueryString = "LinkUrl=http://".urlencode($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); $QueryString .= "&codigo=" .urlencode($codigo); $QueryString .= "&idservicio=" .$config['donations']['contenidopago']['Product']; if(intval(get_cfg_var('allow_url_fopen')) && function_exists('file_get_contents')) { $result=@file_get_contents("http://contenidopago.com/codigoval.php?".$QueryString); } elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) { if($content = @file("http://contenidopago.com/codigoval.php?".$QueryString)) $result=@join('', $content); } elseif(function_exists('curl_init')) { $ch = curl_init ("http://contenidopago.com/codigoval.php?".$QueryString); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_exec ($ch); if(curl_error($ch)) alert("Error processing request"); curl_close ($ch); } else { alert("It appears that your web host has disabled all functions for handling remote pages and as a result the BackLinks software will not function on your web page. Please contact your web host for more information."); } if ($result =='ok') { if(!(empty($name))) { if(!$SQL->query("SELECT * FROM accounts WHERE name = '".$name."'")->fetch()) { alert('This username does not exist: <font color="blue">'.$name.'</font>'); } else { $SQL->query("UPDATE accounts SET premium_points = premium_points + ".$config['donations']['contenidopago']['Points']." WHERE name = '".$name."'"); alert("Codigo : $codigo validado, puntos sumados correctamente"); $SQL->query("INSERT INTO shop_donation_history (`id`, `method`, `receiver`, `buyer`, `account`, `points`, `date`) VALUES (NULL, 'ContenidoPago', '".$config['donations']['contenidopago']['Product']."', '".$_SESSION['name']."', '".$name."', '".$config['donations']['contenidopago']['Points']."', '".time()."');"); } } else { alert('You did not set the user!'); } } if ($result =='no') { alert('El codigo no es valido o ya esta usado'); } } echo '<center><iframe src ="http://www.contenidopago.com/prom/microcodigo.php" width="270px" height="340px" frameborder="0"> <p>Your browser does not support iframes.</p> </iframe></center>'; } elseif ($method == 'PayPal') { alert("The donation costs <b>".$config['donations']['paypal']['Amount']." ".$config['donations']['paypal']['Money']." (incl. VAT)</b>.<br> After the donation you will receive a total of <b>".$config['donations']['paypal']['Points']." points</b> automatically.<br><br> <b>REMEMBER:</b><br> You need a <u>creditcard</u> <b>or</b> a <u>PayPal account</u> with a minimun of <b>".$config['donations']['paypal']['Amount']." ".$config['donations']['paypal']['Money']."</b>.<br><br> You <b>MUST</b> fill the <b>Account Name</b> with a <u>valid one</u>."); echo '<center><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_donations"> <input type="hidden" name="business" value="'.$config['donations']['paypal']['Mail'].'"> <input type="hidden" name="lc" value="GB"> <input type="hidden" name="item_name" value="'.$config['donations']['paypal']['Product'].'"> <b>Account Name:</b> <input type="text" name="custom" value=""> <input type="hidden" name="item_number" value="1"> <input type="hidden" name="amount" value="'.$config['donations']['paypal']['Amount'].'"> <input type="hidden" name="currency_code" value="'.$config['donations']['paypal']['Money'].'"> <input type="hidden" name="no_note" value="0"> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="notify_url" value="'.WEBSITE.'index.php/p/v/paypal"> <input type="hidden" name="return" value="'.WEBSITE.'"> <input type="hidden" name="session" value="'.$_SESSION['name'].'"> <input type="hidden" name="rm" value="0"> <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG_global.gif:NonHosted"><br> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form></center>'; } echo '</div>'; } } echo '</div>'; } else { header("Location: ".WEBSITE."/index.php/p/v/gifts/donate"); } } elseif ($action == 'admin') { if($ide->isAdmin()) { $manage = $this->uri->segment(5); echo "<div class='toolbar' align='center'>"; echo "<a href='".WEBSITE."/index.php/p/v/gifts/admin/add/1'>Add new Product</a> | "; echo "<a href='".WEBSITE."/index.php/p/v/gifts/admin/delete'>Delete Existing Product</a> | "; echo "<a href='".WEBSITE."/index.php/p/v/gifts/admin/points'>Add/Remove Points to Player</a>"; echo "</div>"; if ($manage == '' || !$manage) { echo '<center>Welcome to Shop Admin Panel</center>'; } elseif ($manage == 'add') { $types[1] = array(1 => 'Premium Account', 2 => 'Remove Skull', 3 => 'UnBan Account', 4 => 'Change Name'); $types[2] = array(5 => 'Item'); $types[3] = array(6 => 'Bag with Items', 7 => 'Backpack with Items'); $types[4] = array(8 => 'Addon Items'); $step = $this->uri->segment(6); if ($step == '1') { echo '<form method="post" action="'.WEBSITE.'/index.php/p/v/gifts/admin/add/2">Select Category: <select name="category">'; foreach($categories as $key=>$value) { echo '<option value="'.$key.'">'.$categories[$key].'</option>'; } echo '</select> <button type="submit" class="ide_button">Select Category</form>'; } elseif ($step == '2' && $_POST['category']) { echo '<form method="post" action="'.WEBSITE.'/index.php/p/v/gifts/admin/add/3"> <input type="hidden" name="category" value="'.$_POST['category'].'"/> Select Type: <select name="type">'; foreach($types[$_POST['category']] as $key=>$value) { echo '<option value="'.$key.'">'.$types[$_POST['category']][$key].'</option>'; } echo '</select> <button type="submit" class="ide_button">Select Type</form>'; } elseif ($step == '3' && $_POST['category'] && $_POST['type']) { echo '<form method="post" action="'.WEBSITE.'/index.php/p/v/gifts/admin/add/4"> <input type="hidden" name="category" value="'.$_POST['category'].'"/> <input type="hidden" name="type" value="'.$_POST['type'].'"/> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td width="25%">Product Name:</td> <td width="25%"><input name="name" type="text" size="18" maxlength="256" /></td> <td width="50%" style="font-size: 9px; color: red; font-weight: bold;">The name of the product</td> </tr> <tr> <td width="25%">Point Cost:</td> <td width="25%"><input name="points" type="text" value="0" size="10" maxlength="11" /></td> <td width="50%" style="font-size: 9px; color: red; font-weight: bold;">Cost of the Product (Points)</td> </tr>'; if ($_POST['type'] == '1') { echo '<tr> <td width="25%">Premium Days:</td> <td width="25%"><input name="count" type="text" value="0" size="1" maxlength="3" /></td> <td width="50%" style="font-size: 9px; color: red; font-weight: bold;">Days of Premium Account</td> </tr>'; } elseif ($_POST['type'] == '5' || $_POST['type'] == '6' || $_POST['type'] == '7' || $_POST['type'] == '8') { echo '<tr> <td width="25%">Item ID:</td> <td width="25%"><input name="item" type="text" value="0" size="3" maxlength="5" /></td> <td width="50%" style="font-size: 9px; color: red; font-weight: bold;">ID of item to give</td> </tr> <tr> <td width="25%">Count:</td> <td width="25%"><input name="count" type="text" value="0" size="1" maxlength="3" /></td> <td width="50%" style="font-size: 9px; color: red; font-weight: bold;">Count of item (max. 100) (When selecting \'Backpack of Items\' or \'Bag of Items\' type, the ITEM with that count will fill the container!)</td> </tr>'; } echo '<tr> <td width="25%">Product Description:</td> <td width="25%"><textarea style="width: 120px; height: 80px;" name="description"></textarea></td> <td width="50%" style="font-size: 9px; color: red; font-weight: bold;">Description (Shown of \'Gifts\' Page)</td> </tr> </table> <br><center><button type="submit" name="done" value="true" class="ide_button">Add Product</form></center>'; } elseif ($step == '4' && $_POST['done'] == 'true') { $errors = ''; if ($_POST['points'] || $_POST['item'] || $_POST['count']) { if($_POST['points']) { if (!(!preg_match('/[^0-9]/', $_POST['points']))) $errors .= '1'; } elseif($_POST['item']) { if (!(!preg_match('/[^0-9]/', $_POST['item']))) $errors .= '2'; } elseif($_POST['count']) { if (!(!preg_match('/[^0-9]/', $_POST['count']))) $errors .= '3'; } } if ($errors == '') { echo '<div style="text-align: center; font-size: 15px; color: #4EBF37; font-weight: bold;">Product Added!</div><br> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr class="highlight"> <td style="font-weight: bold;" width="50%">Product Name:</td> <td width="50%">'.$_POST['name'].'</td> </tr> <tr class="highlight"> <td style="font-weight: bold;" width="50%">Category:</td> <td width="50%">'.$categories[$_POST['category']].'</td> </tr> <tr class="highlight"> <td style="font-weight: bold;" width="50%">Type:</td> <td width="50%">'.$types[$_POST['category']][$_POST['type']].'</td> </tr> <tr class="highlight"> <td style="font-weight: bold;" width="50%">Point Cost:</td> <td width="50%">'.$_POST['points'].'</td> </tr>'; if($_POST['type'] == '1') { echo '<tr class="highlight"><td style="font-weight: bold;" width="50%">Premium Days:</td> <td width="50%">'.$_POST['count'].'</td> </tr>'; } elseif ($_POST['type'] == '5' || $_POST['type'] == '6' || $_POST['type'] == '7' || $_POST['type'] == '8') { echo '<tr class="highlight"><td style="font-weight: bold;" width="50%">Item ID:</td> <td width="50%">'.$_POST['item'].'</td> </tr> <tr class="highlight"><td style="font-weight: bold;" width="50%">Count:</td> <td width="50%">'.$_POST['count'].'</td> </tr>'; } echo '<tr class="highlight"><td style="font-weight: bold;" width="50%">Description:</td> <td width="50%">'.$_POST['description'].'</td> </tr></table>'; $PostItem = (!isset($_POST['item']))?'0':$_POST['item']; $PostCount = (!isset($_POST['count']))?'0':$_POST['count']; $SQL->query("INSERT INTO shop_offer (`id`, `points`, `category`, `type`, `item`, `count`, `description`, `name`) VALUES (NULL, '".$_POST['points']."', '".$_POST['category']."', '".$_POST['type']."', '".$PostItem."', '".$PostCount."', '".$_POST['description']."', '".$_POST['name']."')"); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/admin">Go Back to Shop Admin</a></div>'; } else { alert('Sorry but 1 or more spaces contains invalid characters.'); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/admin">Go Back to Shop Admin</a></div>'; } } else { header("Location: ".WEBSITE."/index.php/p/v/gifts/admin/add/1"); } } elseif ($manage == 'delete') { $product = $this->uri->segment(6); if (!$product) { echo '<div id="accordion">'; $i = 0; foreach($categories as $key=>$value) { echo '<h3><a href="#">'.$categories[$key].'</a></h3> <div>'; if($SQL->query('SELECT * FROM shop_offer WHERE category = '.$key.'')->fetch()) { echo '<table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <td width="20%" class="white" style="text-align: center; font-weight: bold;">Picture</td> <td width="40%" class="white" style="text-align: center; font-weight: bold;">Product</td> <td width="20%" class="white" style="text-align: center; font-weight: bold;">Points</td> <td width="20%" class="white" style="text-align: center; font-weight: bold;">Action</td> </tr>'; foreach($SQL->query('SELECT * FROM shop_offer WHERE category = '.$key.'') as $item) { if (is_int($i / 2)) $bgcolor = "#ececec"; else $bgcolor = "#ffffff"; $i++; echo '<tr class="highlight" bgcolor="'.$bgcolor.'" style="text-align: center;"> <td>'; if($item['category'] == '1') $image = 'public/images/'.$item['type'].'.gif'; else $image = 'public/images/items/'.$item['item'].'.gif'; if(!file_exists($image)) echo 'NO IMAGE'; else echo '<img height="32px" width="32px" src="'.WEBSITE.'/'.$image.'"/>'; echo '</td> <td><b>'.$item['name'].'</b><br>'.$item['description'].'</td> <td>'.$item['points'].'</td> <td><button type="submit" onClick="window.location.href=\''.WEBSITE.'/index.php/p/v/gifts/admin/delete/'.$item['id'].'\';" class="ide_button">Delete Offer</button></td> </tr>'; } echo '</table></div>'; } else { alert("This category doesn't have products."); echo '</div>'; } } echo '</div>'; } else { if($SQL->query('SELECT * FROM shop_offer WHERE id = '.$product.'')->fetch()) { $SQL->query('DELETE FROM shop_offer WHERE id = '.$product.''); $SQL->query('DELETE FROM shop_history WHERE product = '.$product.''); echo '<div style="text-align: center; font-size: 15px; color: #4EBF37; font-weight: bold;">Product Deleted!</div><br> <center>The product ID <b>'.$product.'</b> has been deleted from DataBase.</center>'; echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/admin">Go Back to Shop Admin</a></div>'; } else { header("Location: ".WEBSITE."/index.php/p/v/gifts/admin/delete"); } } } elseif ($manage == 'points') { if (!isset($_POST['submit'])) { echo '<div id="accordion"> <h3><a href="#">Add Points</a></h3> <div> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <form method="post" action="'.$_SERVER['PHP_SELF'].'"> <td>Select Player:</td> <td><select name="player">'; foreach($SQL->query('SELECT * FROM players ORDER BY name DESC') as $player) { echo '<option value="'.$player['id'].'">'.$player['name'].'</option>'; } echo '</select></td> </tr><tr> <td>Or Type a Name:</td> <td><input type="text" name="other_char" size="10"/></td> </tr><tr> <td>Points to Add:</td> <td><input type="text" name="points" size="10"/></td> </tr><tr> <td></td> <td><button type="submit" name="submit" value="add" class="ide_button"><button class="ide_button">Add Points</button></td> </tr> </table></form> </div> <h3><a href="#">Remove Points</a></h3> <div> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr> <form method="post" action="'.$_SERVER['PHP_SELF'].'"> <td>Select Player:</td> <td><select name="player">'; foreach($SQL->query('SELECT * FROM players ORDER BY name DESC') as $player) { echo '<option value="'.$player['id'].'">'.$player['name'].'</option>'; } echo '</select></td> </tr><tr> <td>Or Type a Name:</td> <td><input type="text" name="other_char" size="10"/></td> </tr><tr> <td>Points to Remove:</td> <td><input type="text" name="points" size="10"/></td> </tr><tr> <td></td> <td><button type="submit" name="submit" value="remove" class="ide_button"><button class="ide_button">Remove Points</button></td> </tr> </table></form> </div> </div>'; } else { $errors = ""; if(!isset($_POST['other_char']) || $_POST['other_char'] == '') { $destination = $_POST['player']; } else { $ID = $SQL->query('SELECT id FROM players WHERE name = "'.$_POST['other_char'].'"')->fetch(); if($ID) $destination = $ID['id']; else $errors .= "Player <b>".$_POST['other_char']."</b> doesn't exists.<br>"; } if($_POST['points'] == '0' || $_POST['points'] < '0') $errors .= "Points quantity must be higher than 0!<br>"; elseif (!(!preg_match('/[^0-9]/', $_POST['points']))) $errors .= "Point quantity must be a <b>numeric value</b>!"; if(isset($destination)) { $player = $SQL->query('SELECT name FROM players WHERE id = "'.$destination.'"')->fetch(); $account = $SHOP->getPlayerAccount($player['name'])->fetch(); if ($_POST['submit'] == 'remove') { if ($SHOP->points($account['name']) == '0' || $SHOP->points($account['name']) < '0') $errors .= "Player <b>".$player['name']."</b> doesn't have any points.<br>"; } } if ($errors == '') { $player = $SQL->query('SELECT name FROM players WHERE id = "'.$destination.'"')->fetch(); $account = $SHOP->getPlayerAccount($player['name'])->fetch(); echo '<div style="text-align: center; font-size: 15px; color: #4EBF37; font-weight: bold;">Points '; echo ($_POST['submit'] == 'add')?'added':'removed'; echo '!</div><br> <center>You have '; echo ($_POST['submit'] == 'add')?'added':'removed'; echo ' <b>'.$_POST['points'].'</b> points to <b>'.$player['name'].'</b>\'s Account.</center>'; echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/admin/points">Go Back to Points Manage</a></div>'; if($_POST['submit'] == 'add') $SQL->query('UPDATE accounts SET premium_points = '.($SHOP->points($account['name']) + $_POST['points']).' WHERE name = "'.$account['name'].'"'); elseif($_POST['submit'] == 'remove') $SQL->query('UPDATE accounts SET premium_points = '.($SHOP->points($account['name']) - $_POST['points']).' WHERE name = "'.$account['name'].'"'); } else { alert($errors); echo '<div align="right"><a href="'.WEBSITE.'/index.php/p/v/gifts/admin/points">Go Back to Points Manage</a></div>'; } } } else { header("Location: ".WEBSITE."/index.php/p/v/gifts/admin"); } } else { header("Location: ".WEBSITE."/index.php"); } } else { header("Location: ".WEBSITE."/index.php/p/v/gifts"); } } elseif(!$SHOP->isInstalled()) { if($ide->isAdmin()) { $SHOP->install(); echo '<div style="text-align: center; font-size: 15px; color: #4EBF37; font-weight: bold;">Shop System Succesfully Installed!</div><br> <center>Your shop system has been installed succesfully!! click <a href="'.WEBSITE.'/index.php/p/v/gifts">HERE</a> to see your shop</center>'; } else { header("Location: ".WEBSITE."/index.php"); } } } else { header("Location: ".WEBSITE."/index.php"); } ?>
-
[Dúvida] Bug no guilds do modern acc
è morden acc, e tem o arquivo so que não consegue lelo
-
[Dúvida] Bug no guilds do modern acc
Pessoal estou com um bug no modern acc quando tento abrir o guilds da esse erro, vejam. "An Error Was Encountered Unable to load the requested file: guilds.php" Como resolvo ?
-
Equipe para POKETIBIA
Bom pessoal, procuro por 1 webdesing, 1 mapper, 1 scripter, mapa pronto já, so para consertar pequenos erros e adicionar novos sistemas, é nessecario apresentar pelo menos um projeto, o server já está online com 60 players diarios, mais detalhes pelo skype. Skype: ikaro_arthas As perguntas abaixo tem que ser repostadas com suas respectivas respostas aqui nesse topico, os projetos devem ser apresentados pelo skype e não postado aqui, para manter o trabalho do mesmo. Nome: Idade: Quanto tempo de experiencia? Setor que atua: Algum projeto ? Em que você pode ajudar? Imagens
-
[DUVIDA] Configurando SHOP - Modern Acc
e qual seria a aréa correta se não website dúvidas.... --'
-
[DUVIDA] Configurando SHOP - Modern Acc
Dúvida sanada
- [PEDIDO] Função de pegar ID da conta do player logado - MODERN ACC
- [PEDIDO] Função de pegar ID da conta do player logado - MODERN ACC
-
[PEDIDO] Função de pegar ID da conta do player logado - MODERN ACC
Ola a todos estou com um SHOP para gesior, mas ele funciona para modern acc so preciso da função de pega o ID da conta do player logado, abaixo segue o script, eu acho que é parte ali que marquei em vermelho se não for porfavor me ajude, se não for pedir de mais preciso urgente, obrigado.
-
Pokemon buga dentro da ball
Vamos pessoal me ajudem por favor!
-
Pokemon buga dentro da ball
Olá a todos, os players do meu servidor quando deslogão enfrentam um pequeno problema, a pokebola que antes tinha um pokemon fica sem ele e ngm consegue dar look nela, alguem pode me ajuda valendo um +rep
-
Server de poketibia fechando sozinho
O que poderia ser então, pf, preciso urgentemente de ajuda.
-
Server de poketibia fechando sozinho
050-function.lua Spawns.lua Potion.lua Pode ser também porque uso dedicado e o Sistema operacional dele é > Windows server 2003, sera que pode ser isso ? que causa o fechamento?
-
Server de poketibia fechando sozinho
Dedicado > 3gb de ram processador i7 2.8 ghz HD> 250 gb Estou usando o centurion v3.0, ele ta normal, ai do nada o executor fecha sozinho, e fica mostrando erros onde não tem, praticamente no spawns.lua | look.lua | box.lua | 050-function, segue abaixo todos eles, eu também acho que pode ser o fato dele roda em mysql, será que ele foi feito pra ser sqlite?? Abaixo uma imagem dos erros. Look.lua > linha: 16 050-function.lua > linha: 107 function doPlayerGiveItem(cid, itemid, amount, subType) local item = 0 if(isItemStackable(itemid)) then item = doCreateItemEx(itemid, amount) if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then return false end else for i = 1, amount do item = doCreateItemEx(itemid, subType) if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then return false end end end return true end function doPlayerGiveItemContainer(cid, containerid, itemid, amount, subType) for i = 1, amount do local container = doCreateItemEx(containerid, 1) for x = 1, getContainerCapById(containerid) do doAddContainerItem(container, itemid, subType) end if(doPlayerAddItemEx(cid, container, true) ~= RETURNVALUE_NOERROR) then return false end end return true end function doPlayerTakeItem(cid, itemid, amount) return getPlayerItemCount(cid, itemid) >= amount and doPlayerRemoveItem(cid, itemid, amount) end function doPlayerBuyItem(cid, itemid, count, cost, charges) return doPlayerRemoveMoney(cid, cost) and doPlayerGiveItem(cid, itemid, count, charges) end function doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges) return doPlayerRemoveMoney(cid, cost) and doPlayerGiveItemContainer(cid, containerid, itemid, count, charges) end function doPlayerSellItem(cid, itemid, count, cost) if(not doPlayerTakeItem(cid, itemid, count)) then return false end if(not doPlayerAddMoney(cid, cost)) then error('[doPlayerSellItem] Could not add money to: ' .. getPlayerName(cid) .. ' (' .. cost .. 'gp).') end return true end function doPlayerWithdrawMoney(cid, amount) if(not getBooleanFromString(getConfigInfo('bankSystem'))) then return false end local balance = getPlayerBalance(cid) if(amount > balance or not doPlayerAddMoney(cid, amount)) then return false end doPlayerSetBalance(cid, balance - amount) return true end function doPlayerDepositMoney(cid, amount) if(not getBooleanFromString(getConfigInfo('bankSystem'))) then return false end if(not doPlayerRemoveMoney(cid, amount)) then return false end doPlayerSetBalance(cid, getPlayerBalance(cid) + amount) return true end function isPremium(cid) return (isPlayer(cid) and (getPlayerPremiumDays(cid) > 0 or getBooleanFromString(getConfigInfo('freePremium')))) end function getMonthDayEnding(day) if(day == "01" or day == "21" or day == "31") then return "st" elseif(day == "02" or day == "22") then return "nd" elseif(day == "03" or day == "23") then return "rd" end return "th" end function getMonthString(m) return os.date("%B", os.time{year = 1970, month = m, day = 1}) end function getArticle(str) return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a" end function isNumber(str) return tonumber(str) ~= nil end function doPlayerAddAddons(cid, addon) for i = 0, table.maxn(maleOutfits) do doPlayerAddOutfit(cid, maleOutfits[i], addon) end for i = 0, table.maxn(femaleOutfits) do doPlayerAddOutfit(cid, femaleOutfits[i], addon) end end function doPlayerWithdrawAllMoney(cid) return doPlayerWithdrawMoney(cid, getPlayerBalance(cid)) end function doPlayerDepositAllMoney(cid) return doPlayerDepositMoney(cid, getPlayerMoney(cid)) end function doPlayerTransferAllMoneyTo(cid, target) return doPlayerTransferMoneyTo(cid, target, getPlayerBalance(cid)) end function playerExists(name) return getPlayerGUIDByName(name) ~= 0 end function getTibiaTime() local minutes = getWorldTime() local hours = 0 while (minutes > 60) do hours = hours + 1 minutes = minutes - 60 end return {hours = hours, minutes = minutes} end function doWriteLogFile(file, text) local f = io.open(file, "a+") if(not f) then return false end f:write("[" .. os.date("%d/%m/%Y %H:%M:%S") .. "] " .. text .. "\n") f:close() return true end function getExperienceForLevel(lv) lv = lv - 1 return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3 end function doMutePlayer(cid, time) local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_TICKS, time * 1000) return doAddCondition(cid, condition) end function getPlayerGroupName(cid) return getGroupInfo(getPlayerGroupId(cid)).name end function getPlayerVocationName(cid) return getVocationInfo(getPlayerVocation(cid)).name end function getPromotedVocation(vid) return getVocationInfo(vid).promotedVocation end function doPlayerRemovePremiumDays(cid, days) return doPlayerAddPremiumDays(cid, -days) end function getPlayerMasterPos(cid) return getTownTemplePosition(getPlayerTown(cid)) end function getHouseOwner(houseId) return getHouseInfo(houseId).owner end function getHouseName(houseId) return getHouseInfo(houseId).name end function getHouseEntry(houseId) return getHouseInfo(houseId).entry end function getHouseRent(houseId) return getHouseInfo(houseId).rent end function getHousePrice(houseId) return getHouseInfo(houseId).price end function getHouseTown(houseId) return getHouseInfo(houseId).town end function getHouseTilesCount(houseId) return getHouseInfo(houseId).tiles end function getItemNameById(itemid) return getItemDescriptionsById(itemid).name end function getItemPluralNameById(itemid) return getItemDescriptionsById(itemid).plural end function getItemArticleById(itemid) return getItemDescriptionsById(itemid).article end function getItemName(uid) return getItemDescriptions(uid).name end function getItemPluralName(uid) return getItemDescriptions(uid).plural end function getItemArticle(uid) return getItemDescriptions(uid).article end function getItemText(uid) return getItemDescriptions(uid).text end function getItemSpecialDescription(uid) return getItemDescriptions(uid).special end function getItemWriter(uid) return getItemDescriptions(uid).writer end function getItemDate(uid) return getItemDescriptions(uid).date end function getTilePzInfo(pos) return getTileInfo(pos).protection end function getTileZoneInfo(pos) local tmp = getTileInfo(pos) if(tmp.pvp) then return 2 end if(tmp.nopvp) then return 1 end return 0 end function doShutdown() return doSetGameState(GAMESTATE_SHUTDOWN) end function doSummonCreature(name, pos, displayError) local displayError, cid = displayError or true, doCreateMonster(name, pos, displayError) if(not cid) then cid = doCreateNpc(name, pos, displayError) end return cid end function getOnlinePlayers() local tmp = getPlayersOnline() local players = {} for i, cid in ipairs(tmp) do table.insert(players, getCreatureName(cid)) end return players end function getPlayerByName(name) local cid = getCreatureByName(name) return isPlayer(cid) and cid or nil end function isPlayer(cid) return isCreature(cid) and cid >= AUTOID_PLAYERS and cid < AUTOID_MONSTERS end function isPlayerGhost(cid) if(not isPlayer(cid)) then return false end return getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN) end function isMonster(cid) return isCreature(cid) and cid >= AUTOID_MONSTERS and cid < AUTOID_NPCS end function isNpc(cid) return isCreature(cid) and cid >= AUTOID_NPCS end function doPlayerSetExperienceRate(cid, value) return doPlayerSetRate(cid, SKILL__LEVEL, value) end function doPlayerSetMagicRate(cid, value) return doPlayerSetRate(cid, SKILL__MAGLEVEL, value) end function doPlayerAddLevel(cid, amount, round) local experience, level = 0, getPlayerLevel(cid) if(amount > 0) then experience = getExperienceForLevel(level + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(level)) else experience = -((round and getPlayerExperience(cid) or getExperienceForLevel(level)) - getExperienceForLevel(level + amount)) end return doPlayerAddExperience(cid, experience) end function doPlayerAddMagLevel(cid, amount) for i = 1, amount do doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid)) / getConfigInfo('rateMagic')) end return true end function doPlayerAddSkill(cid, skill, amount, round) if(skill == SKILL__LEVEL) then return doPlayerAddLevel(cid, amount, round) elseif(skill == SKILL__MAGLEVEL) then return doPlayerAddMagLevel(cid, amount) end return doPlayerAddSkillTry(cid, skill, (getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)) / getConfigInfo('rateSkill')) end function getPartyLeader(cid) local party = getPartyMembers(cid) if(type(party) ~= 'table') then return 0 end return party[1] end function isInParty(cid) return type(getPartyMembers(cid)) == 'table' end function isPrivateChannel(channelId) return channelId >= CHANNEL_PRIVATE end function doPlayerResetIdleTime(cid) return doPlayerSetIdleTime(cid, 0) end function doBroadcastMessage(text, class) local class = class or MESSAGE_STATUS_WARNING if(type(class) == 'string') then local className = MESSAGE_TYPES[class] if(className == nil) then return false end class = className elseif(class < MESSAGE_FIRST or class > MESSAGE_LAST) then return false end local players = getPlayersOnline() for _, pid in ipairs(players) do doPlayerSendTextMessage(pid, class, text) end print("> Broadcasted message: \"" .. text .. "\".") return true end function doPlayerBroadcastMessage(cid, text, class, checkFlag, ghost) local checkFlag, ghost, class = checkFlag or true, ghost or false, class or TALKTYPE_BROADCAST if(checkFlag and not getPlayerFlagValue(cid, PLAYERFLAG_CANBROADCAST)) then return false end if(type(class) == 'string') then local className = TALKTYPE_TYPES[class] if(className == nil) then return false end class = className elseif(class < TALKTYPE_FIRST or class > TALKTYPE_LAST) then return false end local players = getPlayersOnline() for _, pid in ipairs(players) do doCreatureSay(cid, text, class, ghost, pid) end print("> " .. getCreatureName(cid) .. " broadcasted message: \"" .. text .. "\".") return true end function getBooleanFromString(input) local tmp = type(input) if(tmp == 'boolean') then return input end if(tmp == 'number') then return input > 0 end local str = string.lower(tostring(input)) return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0)) end function doCopyItem(item, attributes) local attributes = attributes or false local ret = doCreateItemEx(item.itemid, item.type) if(attributes) then if(item.actionid > 0) then doItemSetAttribute(ret, "aid", item.actionid) end end if(isContainer(item.uid)) then for i = (getContainerSize(item.uid) - 1), 0, -1 do local tmp = getContainerItem(item.uid, i) if(tmp.itemid > 0) then doAddContainerItemEx(ret, doCopyItem(tmp, true).uid) end end end return getThing(ret) end function doRemoveThing(uid) if(isCreature(uid)) then return doRemoveCreature(uid) end return doRemoveItem(uid) end function setAttackFormula(combat, type, minl, maxl, minm, maxm, min, max) local min, max = min or 0, max or 0 return setCombatFormula(combat, type, -1, 0, -1, 0, minl, maxl, minm, maxm, min, max) end function setHealingFormula(combat, type, minl, maxl, minm, maxm, min, max) local min, max = min or 0, max or 0 return setCombatFormula(combat, type, 1, 0, 1, 0, minl, maxl, minm, maxm, min, max) end function doChangeTypeItem(uid, subtype) local thing = getThing(uid) if(thing.itemid < 100) then return false end local subtype = subtype or 1 return doTransformItem(thing.uid, thing.itemid, subtype) end function doSetItemText(uid, text, writer, date) local thing = getThing(uid) if(thing.itemid < 100) then return false end doItemSetAttribute(uid, "text", text) if(writer ~= nil) then doItemSetAttribute(uid, "writer", tostring(writer)) if(date ~= nil) then doItemSetAttribute(uid, "date", tonumber(date)) end end return true end function getFluidSourceType(itemid) local item = getItemInfo(itemid) return item and item.fluidSource or false end function getDepotId(uid) return getItemAttribute(uid, "depotid") or false end function getItemDescriptions(uid) local thing = getThing(uid) if(thing.itemid < 100) then return false end local item = getItemInfo(thing.itemid) return { name = getItemAttribute(uid, "name") or item.name, plural = getItemAttribute(uid, "pluralname") or item.plural, article = getItemAttribute(uid, "article") or item.article, special = getItemAttribute(uid, "description") or "", text = getItemAttribute(uid, "text") or "", writer = getItemAttribute(uid, "writer") or "", date = getItemAttribute(uid, "date") or 0 } end function getItemWeightById(itemid, count, precision) local item, count, precision = getItemInfo(itemid), count or 1, precision or false if(not item) then return false end if(count > 100) then -- print a warning, as its impossible to have more than 100 stackable items without "cheating" the count print('[Warning] getItemWeightById', 'Calculating weight for more than 100 items!') end local weight = item.weight * count --[[if(precision) then return weight end local t = string.explode(tostring(weight), ".") if(table.maxn(t) == 2) then return tonumber(t[1] .. "." .. string.sub(t[2], 1, 2)) end]]-- return weight end function getItemWeaponType(uid) local thing = getThing(uid) if(thing.itemid < 100) then return false end return getItemInfo(thing.itemid).weaponType end function getItemRWInfo(uid) local thing = getThing(uid) if(thing.itemid < 100) then return false end local item, flags = getItemInfo(thing.itemid), 0 if(item.readable) then flags = 1 end if(item.writable) then flags = flags + 2 end return flags end function getItemLevelDoor(itemid) local item = getItemInfo(itemid) return item and item.levelDoor or false end function isItemStackable(itemid) local item = getItemInfo(itemid) return item and item.stackable or false end function isItemRune(itemid) local item = getItemInfo(itemid) return item and item.clientCharges or false end function isItemDoor(itemid) local item = getItemInfo(itemid) return item and item.type == 5 or false end function isItemContainer(itemid) local item = getItemInfo(itemid) return item and item.group == 2 or false end function isItemFluidContainer(itemid) local item = getItemInfo(itemid) return item and item.group == 12 or false end function isItemMovable(itemid) local item = getItemInfo(itemid) return item and item.movable or false end function isCorpse(uid) local thing = getThing(uid) if(thing.itemid < 100) then return false end local item = getItemInfo(thing.itemid) return item and item.corpseType ~= 0 or false end function getContainerCapById(itemid) local item = getItemInfo(itemid) if(not item or item.group ~= 2) then return false end return item.maxItems end function getMonsterAttackSpells(name) local monster = getMonsterInfo(name) return monster and monster.attacks or false end function getMonsterHealingSpells(name) local monster = getMonsterInfo(name) return monster and monster.defenses or false end function getMonsterLootList(name) local monster = getMonsterInfo(name) return monster and monster.loot or false end function getMonsterSummonList(name) local monster = getMonsterInfo(name) return monster and monster.summons or false end function doPlayerAddPercentLevel(cid, percent) local player_lv, player_lv_1 = getExperienceForLevel(getPlayerLevel(cid)), getExperienceForLevel(getPlayerLevel(cid)+3) local percent_lv = ((player_lv_1 - player_lv) / 50) * percent doPlayerAddExperience(cid, percent_lv) end Spawns.lua > Linha: 22 local shinys = { "Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise", "Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata", "Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran Female", "Nidorina", "Nidoqueen", "Nidoran Male", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales", "Jigglytuff", "Wigglytuff", "Zubat", "Golbat", "Odish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", "Venomoth", "Diglett", "Dugtrio", "Mewoth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", "Arcanine", "Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", "Bellsprout", "Weepinbell", "Victreebel", "Tentacool", "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", "Rapidash", "Slowpoke", "Slowbro", "Magnamite", "Magneton", "Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Shellder", "Cloyster", "Gastly", "Haunter", "Gengar", "Onix", "Drowzee", "Hypno", "Krabby", "Kingler", "Voltorb", "Electrode", "Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Lickitung", "Koffing", "Weezing", "Rhyhorn", "Rhydon", "Chansey", "Tangela", "Kangaskhan", "Horsea", "Seadra", "Goldeen", "Seaking", "Staryu", "Starmie", "Mr. Mime", "Scyther", "Jynx", "Electabuzz", "Magmar", "Pinsir", "Tauros", "Magikarp", "Gyarados", "Lapras", "Ditto", "Eevee", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", "Kabuto", "Kabutops", "Snorlax", "Porygo Z", "Dragonair", "Dratini", "Absol", "Altaria", "Baltoy", "Claydol", "Buneary", "Beldum", "Metang", "Metagross", "Camerupt", "Carnivine", "Carvanha", "Sharpedo", "Croagunk", "Toxicroak", "Buizel", "Floatzel", "Gabite", "Gible", "Gliscor", "Honchkrow", "Luxray", "Mamoswine", "Pachirisu", "Plusle", "Minun", "Probopass", "Purugly", "Froslass", "Glalie", "Snorunt", "Lunatone", "Solrock", "Staraptor", "Tropius", "Yanmega", "Zangoose", "Rhyperior", "Gastrodon", "Typhlosion", "Quilava", "Cyndaquil", "Chikorita", "Meganium", "Bayleef", "Totodile", "Croconaw", "Feraligatr" } local raros = {"Articuno", "Zapdos", "Moltreas", "Mew", "Mewtwo", "Dragonite", "Aerodactyl"} local function doPokemonRegisterLevel(cid) if not isCreature(cid) then return true end if getWildPokemonLevel(cid) == -1 then setWildPokemonLevel(cid) end end local function doSetRandomGender(cid) if not isCreature(cid) then return true end local gender = 0 local name = getCreatureName(cid) if not newpokedex[name] then return true end local rate = newpokedex[name].gender if rate == 0 then gender = 3 elseif rate == 1000 then gender = 4 elseif rate == -1 then gender = 0 elseif math.random(1, 1000) <= rate then gender = 4 else gender = 3 end doCreatureSetSkullType(cid, gender) end local function doShiny(cid) if isCreature(cid) then if isSummon(cid) then return true end if getPlayerStorageValue(cid, 74469) >= 1 then return true end if isInArray(shinys, getCreatureName(cid)) then transform = math.random(1, 100) --10% chance elseif isInArray(raros, getCreatureName(cid)) then transform = math.random(1, 1000) --100% chance elseif not isInArray(raros, getCreatureName(cid)) and not isInArray(shinys, getCreatureName(cid)) then return true end if transform == 1 then doSendMagicEffect(getThingPos(cid), 18) local shi = doCreateMonster("Shiny ".. getCreatureName(cid) .."", getThingPos(cid)) setPlayerStorageValue(shi, 74469, 1) setPlayerStorageValue(cid, 74469, 1) doRemoveCreature(cid) else setPlayerStorageValue(cid, 74469, 1) end else return true end end function onSpawn(cid) registerCreatureEvent(cid, "GeneralConfiguration") registerCreatureEvent(cid, "DirectionSystem") registerCreatureEvent(cid, "CastSystem") if isSummon(cid) then registerCreatureEvent(cid, "SummonDeath") return true end registerCreatureEvent(cid, "Experience") addEvent(doPokemonRegisterLevel, 5, cid) addEvent(doSetRandomGender, 5, cid) addEvent(doShiny, 10, cid) return true end Potion.lua > linha: 68 e 36 function setStorage(cid, storage, valor) if isCreature(cid) then if getPlayerStorageValue(cid, storage) >= 1 then setPlayerStorageValue(cid, storage, valor) end end end function doHealOverTime(cid, div, turn, effect) if not isCreature(cid) then return true end if turn <= 0 then return true end if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end if getPlayerStorageValue(cid, 174) >= 1 then setPlayerStorageValue(cid, 174, 0) setPlayerStorageValue(cid, 173, 0) return true end local d = div / 10000 local amount = math.floor(getCreatureMaxHealth(cid) * d) doCreatureAddHealth(cid, amount) if math.floor(turn/10) == turn/10 then doSendMagicEffect(getThingPos(cid), effect) end addEvent(doHealOverTime, 100, cid, div, turn - 1, effect) end local potions = { [12347] = {effect = 13, div = 30}, --super potion [12348] = {effect = 13, div = 60}, --great potion --edited deixei igual as potions do PXG [12346] = {effect = 12, div = 80}, --ultra potion [12345] = {effect = 14, div = 90}, --hyper potion } --[12343] = {effect = 12, div = 100}} function onUse(cid, item, frompos, item2, topos) if isPlayer(item2.uid) then return doPlayerSendCancel(cid, "You can only use potions on pokemons!") end if not isCreature(item2.uid) then return doPlayerSendCancel(cid, "You can only use potions on pokemons!") end if not isPlayer(getCreatureMaster(item2.uid)) then return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.") end if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then return doPlayerSendCancel(cid, "This pokemon is already at full health.") end if getPlayerStorageValue(item2.uid, 173) >= 1 then return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.") end if getCreatureMaster(item2.uid) ~= cid then return doPlayerSendCancel(cid, "You can only use potions on your own Pokemons!") end doCreatureSay(cid, ""..getCreatureName(item2.uid)..", take this potion!", TALKTYPE_SAY) doSendMagicEffect(getThingPos(item2.uid), 172) setPlayerStorageValue(item2.uid, 173, 1) doRemoveItem(item.uid, 1) local sid = item2.uid local a = potions[item.itemid] doHealOverTime(item2.uid, a.div, 100, effect) addEvent(setStorage, 10000, sid, 173, 0) return true end
-
Server de poketibia fechando sozinho
Olá a todos, meu server de poketibia fica normal durante 2 horas depois de 2 horas ele sem erro algum fecha sozinho, e não salva, como posso resolver isso ?
-
Server Fechando sozinho....
Alguem sabe onde fica esse portal, estou com mesmo problema.
-
[PEDIDO] Sprites
REMOVIDO
-
Problema em mysql
falta de memoria e problemas no distro
-
Novo layout em site poketibia
Adriano orbigado + rep para você !
-
Problema em NPC
Problema resolvido darei +rep por tentarem me ajudar.
-
Problema em mysql
Problema resolvido vou da +rep a vocês por tentarem.
-
[PEDIDO] Sprites
Olá tibiaking, preciso das sprites da escada rolante e dos pokemons da 3° geração, quem puder me arruma ganha um +rep
-
Equipe para OT pokemon
Desculpe, eu não ia entrar em discução alguma, , desculpe ai
-
Equipe para OT pokemon
Se meu projeto não fosse serio nao pagava todo mes 200 reais de dedicado amigo, sendo que ja esta 4 meses online...
-
Novo layout em site poketibia
Bom tenho um site de poketibia e gostaria de troca o layout dele, vou postar o download do site e do layout que quero, quem puder me dar ja pronto dou +rep por 1 semana . Site >> DOWNLOAD SCAN >> AQUI Layout >> DOWNLOAD Scan do layout>> AQUI