-
Total de itens
39 -
Registro em
-
Última visita
Posts postados por brunonyyu
-
-
8 horas atrás, Akzs disse:
Olá, boa tarde, tudo bem?
Se não me falha a memoria, essa api ta desativada(isso se não me falha a memoria).
No caso, teria que usar a api da google, pois eles tem uma que faz a mesma coisa desse link.Obrigado irmao, vou olhar uma outra api para usar e testar
-
Olá, ao adicionar um video na pagina videos.php pelo painel do adm ele me volta o seguinte erro:
Linha com erro
$info = new SimpleXMLElement(file_get_contents("http://gdata.youtube.com/feeds/api/videos/$link"));
CitarWarning: file_get_contents(http://gdata.youtube.com/feeds/api/videos/_uYFR1_EyZM) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in C:\xampp\htdocs\03 - Genesis Nok\pages\videos.php on line 264
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in C:\xampp\htdocs\03 - Genesis Nok\pages\videos.php:264 Stack trace: #0 C:\xampp\htdocs\03 - Genesis Nok\pages\videos.php(264): SimpleXMLElement->__construct('') #1 C:\xampp\htdocs\03 - Genesis Nok\system\load.page.php(7): include('C:\xampp\htdocs...') #2 C:\xampp\htdocs\03 - Genesis Nok\index.php(37): include_once('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\03 - Genesis Nok\pages\videos.php on line 264Codigo da pagina
<?php # Variaveis globais. $action = $_GET["action"]; $act = $_GET["act"]; $db = $SQL; $accessLevel = ($logged && $account_logged->getPageAccess() > 0) ? TRUE : FALSE; # Checa se as tabelas existem. $res = $db->query("SHOW TABLES"); if($res){ foreach($res as $tabela){ if($tabela[0] == "videos"){ $videos = TRUE; } if($tabela[0] == "videos_categorias"){ $videos_categorias = TRUE; } if($tabela[0] == "videos_comentarios"){ $videos_comentarios = TRUE; } } if(!$videos){ try{ $db->exec(" CREATE TABLE `videos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `titulo` varchar(255) NOT NULL, `descricao` text NOT NULL, `categoria` int(11) NOT NULL, `link` varchar(11) NOT NULL, `ativo` int(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 "); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } } if(!$videos_categorias){ try{ $db->exec(" CREATE TABLE `videos_categorias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 "); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } } if(!$videos_comentarios){ try{ $db->exec(" CREATE TABLE `videos_comentarios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mensagem` text NOT NULL, `character` varchar(255) NOT NULL, `ip` varchar(15) NOT NULL, `topico` int(11) NOT NULL, `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `ativo` int(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 "); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } } }else{ $main_content = "Erro ao adicionar tabelas ao banco de dados!"; } # Se as tabelas existirem. if($videos && $videos_categorias && $videos_comentarios){ # Se nao existir nenhuma acao. if(empty($action) && !isset($action)){ $catFilter = (isset($_GET["cat"]) && !empty($_GET["cat"]) && is_numeric($_GET["cat"])) ? " AND `categoria` = ".$_GET["cat"]."" : ""; $resul = $db->query("SELECT `id`,`titulo`,`link` FROM `videos` WHERE `ativo` = 1".$catFilter.";"); $main_content = "<div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<center><a href=\"?subtopic=videos\"><img src=\"images/youtube.png\"></a></center>"; $main_content .= ($accessLevel) ? "<center><a href=\"?subtopic=videos&action=adminpanel\">Painel de Administração</a></center>" : ""; if($resul->rowCount() <= 0){ $mc = "<br /><center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"560px\" bgcolor=\"#F1E0C6\"><center>Nenhum vídeo cadastrado!<br /></center></td></tr>"; $div2 = "</div>"; } $categorias = $db->query("SELECT `id`, `nome` FROM `videos_categorias` ORDER BY nome ASC;"); if($categorias->rowCount() <= 0){ $mcs = "Nenhuma categoria cadastrada!"; } $tudos = ""; $t = ""; $i = 0; foreach($categorias as $categoria){ $barra = ($i != 0) ? "|" : ""; $space = ($i = count($categorias)-1) ? "" : " "; $adm = ($accessLevel) ? "<a href=\"?subtopic=videos&action=adminpanel&act=editcat&id=".$categoria["id"]."\"><img src=\"images/edit.png\" height=\"15\" weight=\"15\" /></a><a href=\"?subtopic=videos&action=adminpanel&act=delcat&id=".$categoria["id"]."\"><img src=\"images/del.png\" height=\"15\" weight=\"15\" /></a>" : ""; $tudos .= "$barra $adm<a href=\"?subtopic=videos&cat=".$categoria["id"]."\">".html_entity_decode($categoria["nome"])."</a>$space"; $t .= "$barra ".html_entity_decode($categoria["nome"])."$space"; $i++; } $tx = (strlen($t) > 0) ? "<a href=\"?subtopic=videos\">Todas</a> |" : ""; $tam = (strlen($t)*8 < 560) ? "560" : strlen($t)*8; $add = ($accessLevel) ? "<a href=\"?subtopic=videos&action=adminpanel&act=addcat\"><img src=\"images/add.png\" weight=\"15\" height=\"15\" /></a>" : ""; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"".$tam ."px\" colspan=\"3\" bgcolor=\"#555555\"><font color=\"white\" size=\"3\"><b><center>Categorias</center></b></font></td></tr>"; $main_content .= "<tr><td width=\"".$tam ."px\" bgcolor=\"#F1E0C6\"><b><center>$mcs$tx$tudos$add</center></b></td></tr>"; # Loop para os resultados que vem da database com os videos. foreach($resul as $res){ $id = (int)$res["id"]; $titulo = html_entity_decode($res["titulo"]); if($accessLevel){ $editar = "<a href=\"?subtopic=videos&action=adminpanel&act=edit&id=$id\">Editar Vídeo</a> ⇔"; $deletar = '<a href="?subtopic=videos&action=adminpanel&act=del&id='.$id.'"> Deletar Vídeo</a>'; } $embed = '<iframe width="560" height="349" src="http://www.youtube.com/embed/'.$res["link"].'" frameborder="0" allowfullscreen></iframe>'; $main_content .= "<br /><center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"550px\" bgcolor=\"#D4C0A1\"><center><b><a href=\"?subtopic=videos&id=$id\">$titulo</a></b></center></td></tr>"; $main_content .= "<br /><tr><td width=\"550px\" bgcolor=\"#F1E0C6\"><center>$embed $editar $deletar<br /></center></td></tr>"; $div = "</div>"; } $main_content .= "$mc</div>$div</table>".$div2."$div</center>"; if(isset($_GET["id"])){ $id = (int)$_GET['id']; $res = $db->query("SELECT `titulo`,`link`, `descricao` FROM `videos` WHERE `ativo` = 1 AND `id` = $id LIMIT 1;")->fetch(); if(!$res){ $main_content = "Vídeo inexistente!<br /><a href=\"?subtopic=videos\">⇐ Voltar</a>"; }else{ $resul = $db->query("SELECT `id`, `mensagem`, `character`, `data`, `ativo` FROM `videos_comentarios` WHERE `topico` = $id"); $resuls = $db->query("SELECT `id` FROM `videos_comentarios` WHERE `topico` = $id AND `ativo` = 1")->fetchAll(); $numM = $db->query("SELECT COUNT(`id`) FROM `videos_comentarios` WHERE `topico` = $id AND `ativo` = 1")->fetch(); $numM = ($numM[0] > 0) ? $numM[0]." " : ""; $s = ($numM > 1 || $numM == 0) ? "s" : ""; $main_content = "<div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#505050\"><font color=\"white\" size=\"2\"><center><b>".$res["titulo"]."</b></center></font></td></tr>"; $main_content .= "<tr><td width=\"500px\" bgcolor=\"#F1E0C6\"><center><iframe width=\"560\" height=\"349\" src=\"http://www.youtube.com/embed/".$res['link']."\" frameborder=\"0\" allowfullscreen></center></iframe></td></tr>"; if($res["descricao"]){ $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#505050\"><font color=\"white\" size=\"2\"><center><b>Descrição</b></font></td></tr>"; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#F1E0C6\"><center>".html_entity_decode($res["descricao"])."</center></td></tr>"; } $main_content .= "<tr><td width=\"500px\" bgcolor=\"#505050\"><center><span style=\"color:white; font-weight:bold;\">".$numM."Comentário$s</span></center></td></tr>"; foreach($resul as $resz){ preg_match_all("/(\d{4})-(\d{2})-(\d{2})\ (\d{2}):(\d{2}):(\d{2})/", $resz["data"], $matches); $ifAccess = ($accessLevel && $resz["ativo"]) ? " <a href=\"?subtopic=videos&action=adminpanel&act=delcom&id=".$resz["id"]."\"><img src=\"images/del.png\" height=\"15\" weight=\"15\" /></a>" : ""; $msg = preg_replace("/(.{100})/i", "$1<br />", html_entity_decode($resz["mensagem"])); if($resz["ativo"]){ $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#D4C0A5\"><center><b>[".$matches[3][0]."/".$matches[2][0]."] [<a href=\"?subtopic=characters&name=".urlencode($resz["character"])."\">".$resz["character"]."</a>] [".$matches[4][0].":".$matches[5][0]."]</b></center></td></tr>"; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#F1E0C6\"><font color=\"black\" size=\"2\"></span><center>".$msg."$ifAccess</center></font></td></tr>"; }elseif(!$resz["ativo"] && $accessLevel){ $existe = TRUE; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#D4C0A5\"><center><b>[".$matches[3][0]."/".$matches[2][0]."] [<a href=\"?subtopic=characters&name=".urlencode($resz["character"])."\">".$resz["character"]."</a>] [".$matches[4][0].":".$matches[5][0]."]</b></center></td></tr>"; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#F1E0C6\"><font color=\"black\" size=\"2\"></span><center><strike>".$msg."</strike> <a href=\"?subtopic=videos&action=adminpanel&act=ativarcom&id=".$resz["id"]."\"><img src=\"images/ativar.png\" height=\"15\" weight=\"15\" /></a></center></font></td></tr>"; } } if(!count($resuls)){ if($accessLevel && $existe){ }else{ $main_content .= "<tr><td width=\"500px\" bgcolor=\"#D4C0A5\"><center>Nenhum comentário foi feito!</center></td></tr>"; } } $todosChars = ""; if($account_logged){ $accountPlayers = $account_logged->getPlayersList(); $accountPlayers->orderBy('name'); foreach($accountPlayers as $char){ $todosChars .= "<option value=\"".$char->getName()."\">".$char->getName()."</option>"; } $temChar = (!$accountPlayers) ? TRUE : FALSE; } $ifLogged = " <tr><td width=\"500px\" bgcolor=\"#505050\"><span style=\"color:white; font-weight:bold;\"> <form action=\"?subtopic=videos&id=$id\" method=\"post\"> <fieldset> <legend>Deixe um comentário</legend><br /> <select style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"character\"> $todosChars </select> Character *<br /> <input type=\"hidden\" name=\"topico\" value=\"$id\" /> <textarea style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" cols=\"70\" rows=\"13\" name=\"mensagem\"></textarea> <input type=\"submit\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"comment\" id=\"comment\" value=\"Comentar\" /> </fieldset> </form> </span></td></tr> "; $main_content .= ($logged && !$temChar) ? $ifLogged : "<tr><td width=\"500px\" bgcolor=\"#505050\"><center><span style=\"color:white; font-weight:bold;\">Você deve estar logado e ter um character para comentar!</span></center></td></tr>"; $main_content .= "</div></div></table></div></center>"; if(isset($_POST["comment"]) && !empty($_POST["comment"])){ $accountPlayers = $account_logged->getPlayersList(); foreach($accountPlayers as $char){ if($char->getName() == $_POST["character"]){ $character = TRUE; } } if(strlen($_POST["mensagem"]) < 1){ $main_content = "Você deve escrever uma mensagem para comentar!<br /><a href='?subtopic=videos&id=".$_POST["topico"]."'>⇐ Voltar</a>"; }else{ if(!$character){ $main_content = "Você deve escolher um character para comentar!<br /><a href='?subtopic=videos&id=".$_POST["topico"]."'>⇐ Voltar</a>"; }else{ try{ $reszs = $db->exec("INSERT INTO `videos_comentarios` (`mensagem`, `character`, `ip`, `topico`) VALUES (".$db->quote(htmlentities(strip_tags($_POST["mensagem"]))).", ".$db->quote(htmlentities($_POST["character"])).", ".$db->quote($_SERVER["REMOTE_ADDR"]).",".(int)$_POST["topico"].")"); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } if($reszs){ $main_content = "Comentário adicionado com sucesso!<br /><a href='?subtopic=videos&id=".$_POST["topico"]."'>⇐ Voltar</a>"; } } } } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && $accessLevel){ $main_content = "<br /><div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"500px\" colspan=\"3\" bgcolor=\"#555555\"><font color=\"white\" size=\"3\"><b>Painel de Controle</b></font></td></tr><tr><td width=\"250px\" bgcolor=\"#F1E0C6\"><b>Opções</b></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos&action=adminpanel&act=addcat\">Adicionar Categoria</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos&action=adminpanel&act=add\">Adicionar Vídeo</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos\">Editar Vídeos</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos\">Deletar Vídeos</a></td></tr>"; $main_content .= "</div></div></table></div></center>"; }elseif(isset($action) && !empty($action) && $action == "adminpanel" && !$accessLevel){ $main_content = "Você não pode acessar esta área!"; } if(isset($action) && !empty($action) && $action == "adminpanel" && $accessLevel && $act == "add"){ $main_content = "<fieldset>"; $main_content .= "<legend>Adicionar Vídeo</legend>"; $main_content .= "<form id=\"add\" name=\"add\" method=\"post\" action=\"?subtopic=videos&action=adminpanel&act=add\">"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "<label for=\"link\">Link do Vídeo</label>"; $main_content .= "<br /><input name=\"link\" type='text' id=\"link\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" />"; $main_content .= "</p>"; $main_content .= "<p>"; $main_content .= "<input type=\"submit\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"button\" id=\"button\" value=\"Adicionar\" />"; $main_content .= "</p>"; $main_content .= "</form></fieldset>"; if(isset($_POST["button"]) && !empty($_POST["button"]) && $accessLevel){ $link = $_POST["link"]; $res = $db->query("SELECT `id`,`nome` FROM `videos_categorias`;"); $tudo = ""; foreach($res as $cat_info){ $cat_tudo .= "<option name='".$cat_info["id"]."' value='".$cat_info["id"]."'>".html_entity_decode($cat_info["nome"])."</option>"; } if(strlen($link) != 11){ preg_match_all("/([[:alnum:]|\_|\-]{11}?)/", $link, $matches); if(count($matches[0]) > 1){ $link = "Alexx Pirado lol"; }else{ $link = $matches[0][0]; } } if(strlen($link) != 11){ $erro = "O link do vídeo está errado ou incompleto.<br />Por favor, coloque a parte do link como o exemplo abaixo:<br />http://www.youtube.com/watch?v=<b><i>5abamRO41fE</i></b><br /><a href='?subtopic=videos&action=adminpanel&act=add'>⇐ Voltar</a>"; } if(empty($erro) && !isset($erro)){ $info = new SimpleXMLElement(file_get_contents("http://gdata.youtube.com/feeds/api/videos/$link")); $titulo = $info->title; $main_content = "<br /><div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<form action='?subtopic=videos&action=adminpanel&act=add' method='post'><input type='hidden' name='link' value='$link'>"; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"800px\" colspan=\"3\" bgcolor=\"#555555\"><font color=\"white\" size=\"3\"><b>Informações do Vídeo</b></font></td></tr><tr><td width=\"250px\" bgcolor=\"#F1E0C6\"><b>Informação</b></td><td width=\"250px\" bgcolor=\"#F1E0C6\"><b>Valor</b></td></tr>"; $main_content .= "<tr><td width=\"300px\" bgcolor=\"#D4C0A1\"><b>Link</b><span style='color:red;'>*</span></td><td width=\"300px\" bgcolor=\"#D4C0A1\"><a href='http://www.youtube.com/watch?v=$link'>http://www.youtube.com/watch?v=$link</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><b>Título</b><span style='color:red;'>*</span></td><td width=\"250px\" bgcolor=\"#D4C0A1\"><input type='text' name='titulo' value='$titulo' size='".strlen($titulo)."'></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><b>Descrição</b></td><td width=\"250px\" bgcolor=\"#D4C0A1\"><textarea id=\"descricao\" name=\"descricao\" cols=\"40\" rows=\"10\" onfocus=\"if(this.innerHTML == 'Coloque uma descrição no vídeo!') this.innerHTML = '';\" onblur=\"if(this.innerHTML == '') this.innerHTML = 'Coloque uma descrição no vídeo!';\">Coloque uma descrição no vídeo!</textarea></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><b>Categoria</b><span style='color:red;'>*</span></td><td width=\"250px\" bgcolor=\"#D4C0A1\"><select name='categoria'><option value=\"0\">Nenhuma</option>$cat_tudo</select></td></tr>"; $main_content .= "</div></div></table>Os campos com <span style='color:red;margin:left;'>*</span> são obrigatórios!<br /><input type='submit' style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name='avancar' value='Avançar'></center></div>"; }else{ $main_content = $erro; } } if(isset($_POST["avancar"]) && !empty($_POST["avancar"]) && $accessLevel){ $link = $_POST["link"]; $titulo = $_POST["titulo"]; $categoria = htmlentities($_POST["categoria"]); $descricao = ($_POST["descricao"] != "Coloque uma descrição no vídeo!" && $_POST["descricao"] != "Coloque uma descrição no vídeo!") ? nl2br($_POST["descricao"]) : NULL; if(!empty($link) && isset($link) & $link != 11){ if(!empty($titulo) && isset($titulo)){ try { $res = $db->query("INSERT INTO `videos` (`titulo`, `descricao`, `categoria`, `link`) VALUES (".$db->quote(htmlentities($titulo)).", ".$db->quote(htmlentities($descricao)).", $categoria, ".$db->quote($link).")"); } catch (PDOException $e){ $main_content = "Erro ao adicionar o vídeo!<br />".$e->getMessage()."<br /><a href='?subtopic=videos&action=adminpanel&act=add'>⇐ Voltar</a>"; } if($res){ $main_content = "Vídeo adicionado com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } }else{ $main_content = "O título não pode ficar em branco!<br /><a href='?subtopic=videos&action=adminpanel&act=add'>⇐ Voltar</a>"; } }else{ $main_content = "Você deve fornecer um link para adicionar um vídeo!<br /><a href='?subtopic=videos&action=adminpanel&act=add'>⇐ Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "del" && $accessLevel){ $id = (int)$_GET["id"]; $main_content = "Você realmente deseja excluir o vídeo #$id?<br /> <form action=\"?subtopic=videos&action=adminpanel&act=del\" method=\"post\"> <input type=\"hidden\" name=\"id\" value=\"$id\"> <input type=\"submit\" name=\"botao\" value=\"Concluir\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\"> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"])){ $id = (int)$_POST["id"]; if(!empty($id) && isset($id) && is_numeric($id)){ $id = (int)$id; try { $res = $db->exec("DELETE FROM `videos` WHERE `id` = $id"); } catch (PDOException $e){ $main_content = "Houve um erro ao deletar o vídeo número $id.<br />".$e->getMessage()."<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } if($res){ $main_content = "Vídeo #$id deletado com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } }else{ $main_content = "Vídeo não encontrado!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "edit" && $accessLevel){ $res = $db->query("SELECT `id`,`titulo`,`link`,`descricao` FROM `videos` WHERE `ativo` = 1 AND `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $resul = $db->query("SELECT `id`,`nome` FROM `videos_categorias`;"); $resz = $db->query("SELECT `categoria` as `id` FROM `videos` WHERE `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $cat_tudo = ""; foreach($resul as $cat_info){ if($cat_info["id"] == $resz["id"]){ $c = " selected=\"selected\""; } $cat_tudo .= "<option name='".$cat_info["id"]."' $c value='".$cat_info["id"]."'>".html_entity_decode($cat_info["nome"])."</option>"; } $main_content = "<fieldset>"; $main_content .= "<legend>Editar Vídeo</legend>"; $main_content .= " <center> <span style=\"font-size:1.8em; font-color:black;\"><strong>".html_entity_decode($res['titulo'])."</span></strong><hr> <iframe width=\"560\" height=\"349\" src=\"http://www.youtube.com/embed/".$res["link"]."\" frameborder=\"0\" allowfullscreen></iframe><hr /> <br /><br /> </center> "; $main_content .= "<form id=\"add\" name=\"add\" method=\"POST\" action=\"\">"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "<label for=\"titulo\">Título do Vídeo</label>"; $main_content .= "<br /><input name=\"titulo\" type=\"text\" id=\"titulo\" size=\"".strlen($res["link"])*3 ."\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" value=\"".$res['titulo']."\"/>"; $main_content .= "</p>"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "<label for=\"link\">Link do Vídeo</label>"; $main_content .= "<br /><input name=\"link\" type='text' id=\"link\" size=\"25\" maxlength=\"11\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" value=\"".$res['link']."\"/>"; $main_content .= "<br /><br /><label for=\"descricao\">Descrição do Vídeo</label>"; $main_content .= "<br /><textarea id=\"descricao\" name=\"descricao\" cols=\"40\" rows=\"10\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\">".html_entity_decode($res["descricao"])."</textarea>"; $main_content .= "</p>"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "Categoria<br /><select name='categoria'><option value=\"0\">Nenhuma</option>$cat_tudo</select>"; $main_content .= "</p>"; $main_content .= "<p>"; $main_content .= "<input type=\"hidden\" name=\"id\" value=\"".$res["id"]."\"><input type=\"submit\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"button\" id=\"button\" value=\"Editar\" />"; $main_content .= "</p>"; $main_content .= "</form></div></fieldset>"; if(isset($_POST['button']) && !empty($_POST["button"])){ if(($_POST["link"] != $res["link"]) || ($_POST["titulo"] != $res["titulo"]) || ($_POST["descricao"] != $res["descricao"]) || ($_POST["categoria"] != $resz["id"])){ try { $res = $db->exec("UPDATE `videos` SET `link` = '".$_POST["link"]."', `titulo` = ".$db->quote(htmlentities($_POST["titulo"])).", `descricao` = ".$db->quote(htmlentities($_POST["descricao"])).", `categoria` = ".(int)$_POST["categoria"]." WHERE `id` = ".$_POST["id"].";"); } catch (PDOException $e){ $main_content = "Houve um erro ao tentar editar o vídeo #".$_POST["id"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Vídeo #".$_POST["id"]." editado com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } }else{ $main_content = "Vídeo #".$_POST["id"]." editado com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "addcat" && $accessLevel){ $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=addcat\" method=\"post\"> <fieldset> <legend>Adicionar Categoria</legend><br /> <label for=\"catNome\" style=\"margin-left:3px;\">Nome da Categoria</label><br /> <input type=\"text\" name=\"catNome\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /><br /> <input type=\"submit\" name=\"botao\" value=\"Adicionar\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ if(isset($_POST["catNome"]) && !empty($_POST["catNome"]) && strlen($_POST["catNome"]) > 0){ try { $res = $db->exec("INSERT INTO `videos_categorias` (`nome`) VALUES (".$db->quote(htmlentities($_POST["catNome"])).");"); } catch (PDOException $e){ $main_content = "Houve um erro ao adicionar a categoria!<br />".$e->getMessage()."<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } if($res) $main_content = "Categoria adicionada com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; }else{ $main_content = "O campo <b>Nome da Categoria</b> é obrigatório!<br /><a href='?subtopic=videos&action=adminpanel&act=addcat'>⇐ Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "delcat" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Você deve definir uma categoria para deletar!"; }else{ $res = $db->query("SELECT `id`, `nome` FROM `videos_categorias` WHERE `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=delcat&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Deletar Categoria</legend><br /> <span style=\"margin-left:3px;\">Você realmente deseja deletar a categoria <b>".$res["nome"]."</b>?</span><br /> <input type=\"hidden\" name=\"catId\" value=\"".$res["id"]."\" /> <input type=\"hidden\" name=\"catNome\" value=\"".$res["nome"]."\" /> <input type=\"submit\" name=\"botao\" value=\"Deletar Categoria\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> <input type=\"submit\" name=\"botao2\" value=\"Deletar categoria e vídeos desta categoria\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("DELETE FROM `videos_categorias` WHERE `id` = ".$_POST["catId"].";"); $res = $db->exec("UPDATE `videos` SET `categoria` = 0 WHERE `categoria` = ".$_POST["catId"].";"); } catch (PDOException $e) { $main_content = "Houve um erro ao deletar a categoria ".$_POST["catNome"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Categoria deletada com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } } if(isset($_POST["botao2"]) && !empty($_POST["botao2"]) && $accessLevel){ try { $res = $db->exec("DELETE FROM `videos_categorias` WHERE `id` = ".$_POST["catId"].";"); $resul = $db->exec("DELETE FROM `videos` WHERE `categoria` = ".$_POST["catId"].";"); } catch (PDOException $e) { $main_content = "Houve um erro ao deletar a categoria ".$_POST["catNome"]."!<br />".$e->getMessage(); } if($res && $resul){ $main_content = "Categoria deletada com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "editcat" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Você deve definir uma categoria para deletar!"; }else{ $res = $db->query("SELECT `id`, `nome` FROM `videos_categorias` WHERE `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=editcat&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Editar Categoria</legend><br /> <p style=\"font-size: 1.8em;\"> <label for=\"catNome\" style=\"margin-left:3px;\">Nome da Categoria</label><br /></p> <input type=\"hidden\" name=\"nome\" value=\"".$res["nome"]."\" /> <input type=\"hidden\" name=\"id\" value=\"".$res["id"]."\" /> <input type=\"text\" name=\"catNome\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" value=\"".$res["nome"]."\" /><br /> <br /><input type=\"submit\" name=\"botao\" value=\"Editar Categoria\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("UPDATE `videos_categorias` SET `nome` = ".$db->quote(htmlentities($_POST["catNome"]))." WHERE `id` = ".$_POST["id"].";"); } catch (PDOException $e) { $main_content = "Houve um erro ao editar a categoria ".$_POST["nome"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Categoria editada com sucesso!<br /><a href='?subtopic=videos'>⇐ Voltar</a>"; } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "delcom" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Você deve escolher um comentário para deletar!"; }else{ $res = $db->query("SELECT `id`, `mensagem`, `topico` FROM `videos_comentarios` WHERE `id` = ".(int)$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=delcom&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Deletar Comentário</legend><br /> <span style=\"margin-left:3px;\">Você realmente deseja deletar o comentário <b>".html_entity_decode($res["mensagem"])."</b>?</span><br /> <input type=\"hidden\" name=\"comId\" value=\"".$res["id"]."\" /> <input type=\"hidden\" name=\"comTopico\" value=\"".$res["topico"]."\" /> <input type=\"hidden\" name=\"comCom\" value=\"".html_entity_decode($res["mensagem"])."\" /> <input type=\"submit\" name=\"botao\" value=\"Deletar Comentário\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("UPDATE `videos_comentarios` SET `ativo` = 0 WHERE `id` = ".(int)$_POST["comId"]." AND `ativo` = 1;"); } catch (PDOException $e) { $main_content = "Houve um erro ao deletar o comentário ".$_POST["comCom"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Comentário deletado com sucesso!<br /><a href='?subtopic=videos&id=".(int)$_POST["comTopico"]."'>⇐ Voltar</a>"; } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "ativarcom" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Você deve escolher um comentário para restaurar!"; }else{ $res = $db->query("SELECT `id`, `mensagem`, `topico` FROM `videos_comentarios` WHERE `id` = ".(int)$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=ativarcom&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Restaurar Comentário</legend><br /> <span style=\"margin-left:3px;\">Você realmente deseja restaurar o comentário <b>".html_entity_decode($res["mensagem"])."</b>?</span><br /> <input type=\"hidden\" name=\"comId\" value=\"".$res["id"]."\" /> <input type=\"hidden\" name=\"comTopico\" value=\"".$res["topico"]."\" /> <input type=\"hidden\" name=\"comCom\" value=\"".html_entity_decode($res["mensagem"])."\" /> <input type=\"submit\" name=\"botao\" value=\"Restaurar Comentário\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("UPDATE `videos_comentarios` SET `ativo` = 1 WHERE `id` = ".(int)$_POST["comId"]." AND `ativo` = 0;"); } catch (PDOException $e) { $main_content = "Houve um erro ao restaurar o comentário ".$_POST["comCom"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Comentário restaurado com sucesso!<br /><a href='?subtopic=videos&id=".(int)$_POST["comTopico"]."'>⇐ Voltar</a>"; } } } } } ?>
-
Olá, estou tendo a seguinte situação:
quando eu fecho a tela de chat do npc, ele ainda fica esperando que eu fale algo, porem isso me traz um problema pois caso eu realmente queira algo ele nao me responde, eu tenho que sair de perto do npc e isso ocorre com todos os npcsgostaria de ao apertar no X o chat fosse fechado, e o npc ficasse disponivel para uma nova conversa, e quando ele finalizar a conversa nao abrisse novamente a tela de conversa, pois fica o "Bye" dele tanto no chat privado quando no chat aberto.
-
7 minutos atrás, Yan18 disse:
Como ele funciona e o que esse npc faz?
São os Npcs da Pitis Of Inferno do trone de pumin
-
Boa Noite, pessoal estou precisando das script dos npc A dead Bureucrat, alguem teria para disponibilizar? tibia 8.6, tfs 0.4.
-
Olá estou com um pequino erro no distro quando jogo vial de sague em cima do Gravestone da Poi.
Erros - Action Interface
data/action/scripts/Liquids/containers.lua:onUse
Description:
<luaDoDecayItem> Item not found
Action GraveStone
Citarfunction onAddItem(moveitem, tileitem, pos, cid)
newpos = {x = 32791, y = 32332, z = 10}
cidtile1 = {x=pos.x, y=pos.y+1, z=pos.z, stackpos=253}
cidtile2 = {x=pos.x+1, y=pos.y+1, z=pos.z, stackpos=253}
cid1 = getThingfromPos(cidtile1)
cid2 = getThingfromPos(cidtile2)if tileitem.uid == 50019 then
if moveitem.itemid == 2016 and moveitem.type == 2 and cid1.uid > 0 and cid2.uid ~= cid1.uid then
doRemoveItem(moveitem.uid, 1)
doSendMagicEffect(pos,13)
doTeleportThing(cid1.uid,newpos)
doSendMagicEffect(newpos,10)
elseif tileitem.uid == 50019 then
if moveitem.itemid == 2016 and moveitem.type == 2 and cid1.uid ~= cid2.uid and cid2.uid > 0 then
doRemoveItem(moveitem.uid, 1)
doSendMagicEffect(pos,13)
doTeleportThing(cid2.uid,newpos)
doSendMagicEffect(newpos,10)
--doCreatureSay(cid, "......", TALKTYPE_MONSTER)
else
doSendMagicEffect(pos,2)
doRemoveItem(moveitem.uid, 1)end
end
end
endAction Containers
Citarlocal DISTILLERY = {5513, 5514, 5469, 5470}
local ITEM_RUM_FLASK = 5553
local ITEM_POOL = 2016
local TYPE_EMPTY = 0local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28
local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1772] = TYPE_BEER,
[1773] = TYPE_WINE, [1369] = TYPE_WATER, [1368] = TYPE_WATER}local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}
local drunk = createConditionObject(CONDITION_DRUNK)setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)
local poison = createConditionObject(CONDITION_POISON)setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50)
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120)
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5)setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000)
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true)
local exhaust = createConditionObject(CONDITION_EXHAUST)setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(itemEx.uid == cid) then
if(item.type == TYPE_EMPTY) then
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_MANA_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doPlayerAddMana(cid, math.random(80, 160))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(item.type == TYPE_LIFE_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doCreatureAddHealth(cid, math.random(40, 75))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(isInArray(alcoholDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Aaah...", TALKTYPE_ORANGE_1)
elseif(isInArray(poisonDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Urgh!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Gulp.", TALKTYPE_ORANGE_1)
end
doChangeTypeItem(item.uid, TYPE_EMPTY)
return true
end
if(not isCreature(itemEx.uid)) then
if(item.type == TYPE_EMPTY) then
if(item.itemid == ITEM_RUM_FLASK and isInArray(DISTILLERY, itemEx.itemid)) then
if(itemEx.actionid == 100) then
doItemEraseAttribute(itemEx.uid, "description")
doItemEraseAttribute(itemEx.uid, "aid")
doChangeTypeItem(item.uid, TYPE_RUM)
else
doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
end
return true
end
if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
doChangeTypeItem(item.uid, itemEx.type)
doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
return true
end
if(casks[itemEx.itemid] ~= nil) then
doChangeTypeItem(item.uid, casks[itemEx.itemid])
return true
end
local fluidEx = getFluidSourceType(itemEx.itemid)
if(fluidEx ~= false) then
doChangeTypeItem(item.uid, fluidEx)
return true
end
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_OIL and oilLamps[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, oilLamps[itemEx.itemid])
doChangeTypeItem(item.uid, TYPE_NONE)
return true
end
if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
return false
end
end
doDecayItem(doCreateItem(ITEM_POOL, item.type, toPosition))
doChangeTypeItem(item.uid, TYPE_EMPTY)
return trueend
-
Problema resolvido.
-
Ola pessoal, estou com uma scritp que era para rodar da seguinte maneira, quando personagem pisa em um sqm com uniqueid, troca sqm de lava por uma ponte, quando sai do sqm ele troca a ponte por lava, porem a script nao esta rodando conforme o esperado, quando vc pisa ele cria a ponte, mas quando sai do sqm ele nao remove o sqm.
Citar<movevent type="StepIn" uniqueid="50016" event="script" value="PitsOfInferno/poi_ponte.lua" />
<movevent type="StepOut" uniqueid="50016" event="script" value="PitsOfInferno/poi_ponte.lua" />
-
Olá Bom dia, pessoal estou com um probleminha no servidor, ao iniciar a quest Pits of Inferno, jogando o sangue em cima do gravestone, ele teletransporta meu personagem corretamente, mas gera um erro na distro: Error- Action Interface
Data/actions/scripts/Liquids/containers.lua:onUse
Description:
<luaDoDecayItem> Item not found
Movements.xml
<movement type="AddItem" tileitem="1" uniqueid="50010" event="script" value="PitsOfInferno/gravestone.lua" />
Script Gravestone
Citarfunction onAddItem(moveitem, tileitem, pos)
newpos = {x = 32791, y = 32332, z = 10}
cidtile1 = {x=pos.x, y=pos.y+1, z=pos.z, stackpos=253}
cidtile2 = {x=pos.x+1, y=pos.y+1, z=pos.z, stackpos=253}
cid1 = getThingfromPos(cidtile1)
cid2 = getThingfromPos(cidtile2)if tileitem.uid == 50010 then
if moveitem.itemid == 2016 and moveitem.type == 2 and cid1.uid > 0 and cid2.uid ~= cid1.uid then
doRemoveItem(moveitem.uid, 1)
doSendMagicEffect(pos,13)
doTeleportThing(cid1.uid,newpos)
doSendMagicEffect(newpos,10)
elseif tileitem.uid == 50010 then
if moveitem.itemid == 2016 and moveitem.type == 2 and cid1.uid ~= cid2.uid and cid2.uid > 0 then
doRemoveItem(moveitem.uid, 1)
doSendMagicEffect(pos,13)
doTeleportThing(cid2.uid,newpos)
doSendMagicEffect(newpos,10)
else
doSendMagicEffect(pos,2)
doRemoveItem(moveitem.uid, 1)end
end
end
endContainers
Citarlocal DISTILLERY = {5513, 5514, 5469, 5470}
local ITEM_RUM_FLASK = 5553
local ITEM_POOL = 2016
local TYPE_EMPTY = 0local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28
local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1772] = TYPE_BEER,
[1773] = TYPE_WINE, [1369] = TYPE_WATER, [1368] = TYPE_WATER}local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}
local drunk = createConditionObject(CONDITION_DRUNK)setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)
local poison = createConditionObject(CONDITION_POISON)setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50)
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120)
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5)setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000)
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true)
local exhaust = createConditionObject(CONDITION_EXHAUST)setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(itemEx.uid == cid) then
if(item.type == TYPE_EMPTY) then
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_MANA_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doPlayerAddMana(cid, math.random(80, 160))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(item.type == TYPE_LIFE_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doCreatureAddHealth(cid, math.random(40, 75))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(isInArray(alcoholDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Aaah...", TALKTYPE_ORANGE_1)
elseif(isInArray(poisonDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Urgh!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Gulp.", TALKTYPE_ORANGE_1)
end
doChangeTypeItem(item.uid, TYPE_EMPTY)
return true
end
if(not isCreature(itemEx.uid)) then
if(item.type == TYPE_EMPTY) then
if(item.itemid == ITEM_RUM_FLASK and isInArray(DISTILLERY, itemEx.itemid)) then
if(itemEx.actionid == 100) then
doItemEraseAttribute(itemEx.uid, "description")
doItemEraseAttribute(itemEx.uid, "aid")
doChangeTypeItem(item.uid, TYPE_RUM)
else
doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
end
return true
end
if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
doChangeTypeItem(item.uid, itemEx.type)
doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
return true
end
if(casks[itemEx.itemid] ~= nil) then
doChangeTypeItem(item.uid, casks[itemEx.itemid])
return true
end
local fluidEx = getFluidSourceType(itemEx.itemid)
if(fluidEx ~= false) then
doChangeTypeItem(item.uid, fluidEx)
return true
end
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_OIL and oilLamps[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, oilLamps[itemEx.itemid])
doChangeTypeItem(item.uid, TYPE_NONE)
return true
end
if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
return false
end
end
doDecayItem(doCreateItem(ITEM_POOL, item.type, toPosition))
doChangeTypeItem(item.uid, TYPE_EMPTY)
return trueend
-
Podem Fechar o topico, Obrigado
-
Olá pessoal, estou fazendo uma adaptação dos npcs do meu servidor,
estava acrescentando um por um conforme precisava, porem notei que alguns npc adicionados no mapa nao apareciam no game, resolvi trocar a pasta completa de npc junto com as lib pois vi que eram tambem diferentes, como o meu servidor os npc eram basicos, vi que o do outro era o que eu precisava resolvi trocar pasta inteira, porem venho enfrentando erro na distro.
Citar-- Handles onCreatureAppear events. If you with to handle this yourself, please use the CALLBACK_CREATURE_APPEAR callback.
function NpcHandler:onCreatureAppear(creature)
local cid = creature.uid
if cid == getNpcCid() then
local npc = Npc()
if next(self.shopItems) then
local speechBubble = npc:getSpeechBubble()
if speechBubble == 3 then
npc:setSpeechBubble(4)
else
npc:setSpeechBubble(2)
end
else
if self:getMessage(MESSAGE_GREET) then
npc:setSpeechBubble(1)
end
end
endlocal callback = self:getCallback(CALLBACK_CREATURE_APPEAR)
if callback == nil or callback(cid) then
if self:processModuleCallback(CALLBACK_CREATURE_APPEAR, cid) then
--
end
end
endisto é o que ele fala da linha 373, eu teria que puxar mais algum arquivo, ou editar alguma coisa?
-
Em 31/08/2019 em 00:34, davidwcr99 disse:
muda essa linha...
return $sth->fetch()[0];
tenta deixar ela assim:
return $sth->fetch();
Valeu, amigo funcionou
-
Ola galera, estou tentando abrir meu gesior porem estou com o seguinte problema.
Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\pages\latestnews.php on line 9
como posso resolver isso?
vurus total scan: https://www.virustotal.com/gui/file/9eee824c551b2d7056b49e3d8389990a76053c744dfe08907502803e8af647c6/detection
-
3 minutos atrás, Yan Liima disse:
É só limpar essa tabela que quando você iniciar a distro novamente ele irá inserir todos os dados das houses novamente. Se o erro persistir tente editar o house.xml na pasta world
obrigado vou testar
9 minutos atrás, brunonyyu disse:obrigado vou testar
@Yan Liima Novamente Obrigado cara, deu certo.
-
Boa noite, ou bom dia kk,
Pessoal, eu tive que fazer alteração de mapa no meu OT, e apos isso apresentou algumas falhas no distro de e identifiquei que era nas houses das cidades vips que eu tirei, teria como eu fazer uma atualização no meu banco de dados automaticamente sem que eu precise fazer isso na mao um por um?
-
52 minutos atrás, Yan Liima disse:
Fiz no meu mesmo, não existe na net. Executei no mysql.
Baixei de novo o servidor, nao deu nao, pode ser a forma com que estou adicionando a query, como sou noob nisso pode ser.
-
3 minutos atrás, Yan Liima disse:
@brunonyyu ele registra com o ID da conta, não do jogador. Fiz aqui o procedimento para ter certeza que não haveria problema. E aqui funcionou corretamente. Não sei oque está havendo com o teu servidor ai. Seria bom você revisar e se for preciso fazer tudo de novo
vc fez com qual ot?, este mesmo que te mandei?, farei sim. vc usou o sqlitestudio para adicionar a query? talvez seja isso que estou fazendo errado tb.
-
8 horas atrás, Yan Liima disse:
Certo! Creio que seria com db.executeQuery mesmo. Bom, já era pra estar tudo funcionando corretamente. Quando você inseriu a Query, a tabela "account_storage" foi criada? Verifique se realmente existe ela no seu banco de dados.
foi sim da pra ver nas fotos quando eu mandei falando que deu certo, abrindo a tabela e comparando com a account, vi que nao tem a player_id, dentro da tabela, nao sei como funciona bem isso mas, se ele nao tem a player id pra fazer a comparacao na logica ele pode dizer que nao existe o player nesta acc... sei la, posso estar falando merda, kkkk so programo clp to de intrometido aqui kkkkk
8 minutos atrás, brunonyyu disse:foi sim da pra ver nas fotos quando eu mandei falando que deu certo, abrindo a tabela e comparando com a account, vi que nao tem a player_id, dentro da tabela, nao sei como funciona bem isso mas, se ele nao tem a player id pra fazer a comparacao na logica ele pode dizer que nao existe o player nesta acc... sei la, posso estar falando merda, kkkk so programo clp to de intrometido aqui kkkkk
nao poderiamos usar a tabela do account_viplist?
-
8 minutos atrás, Yan Liima disse:
Me manda os arquivos fazendo favor. Você utiliza qual distro?
cara nome do distro n sei, mas peguei daqui vc quer o LIB e a TalkAction?
-
7 minutos atrás, Yan Liima disse:
Entendi o problema. Volta lá na função que você adicionou e troque:
db.executeQuery
Por:
db.query
Depois me de retorno pra poder fechar o tópico.
Cara, nao sabia que uma coisinha teoricamente simples poderia dar tanto trabalho. mas desta vez foi isso.
[14/08/2019 17:13:44] [Error - TalkAction Interface]
[14/08/2019 17:13:44] data/talkactions/scripts/starterkit.lua:onSay
[14/08/2019 17:13:44] Description:
[14/08/2019 17:13:44] data/lib/050-function.lua:707: attempt to call field 'Query' (a nil value)
[14/08/2019 17:13:44] stack traceback:
[14/08/2019 17:13:44] data/lib/050-function.lua:707: in function 'setAccountStorageValue'
[14/08/2019 17:13:44] data/talkactions/scripts/starterkit.lua:16: in function <data/talkactions/scripts/starterkit.lua:8> -
17 minutos atrás, Yan Liima disse:
@brunonyyu preste atenção nesse print que você enviou. A função é de getPlayerStorage, não de getAccountStorage...
Arrumei, funcionou em partes, ele ativa, eu ganho os itens e a premium, porem, ainda sim da erro no distro, e ainda consigo ativar em outro personagem na mesma acc.
[14/08/2019 17:00:21] [Error - TalkAction Interface]
[14/08/2019 17:00:21] data/talkactions/scripts/starterkit.lua:onSay
[14/08/2019 17:00:21] Description:
[14/08/2019 17:00:21] data/lib/050-function.lua:707: attempt to call field 'executeQuery' (a nil value)
[14/08/2019 17:00:21] stack traceback:
[14/08/2019 17:00:21] data/lib/050-function.lua:707: in function 'setAccountStorageValue'
[14/08/2019 17:00:21] data/talkactions/scripts/starterkit.lua:16: in function <data/talkactions/scripts/starterkit.lua:8> -
-
21 minutos atrás, Yan Liima disse:
@brunonyyu cometi um pequeno erro, ja ajeitei. Tenta copiar de novo e testar.
Ou só troque:
elseif setAccountStorageValue(getPlayerAccountId(cid), config.storage) < 0 then
por
elseif getAccountStorageValue(getPlayerAccountId(cid), config.storage) < 0 then
continua talvez nao tenha dado tao certo a query
[14/08/2019 16:33:07] [Error - TalkAction Interface]
[14/08/2019 16:33:07] data/talkactions/scripts/starterkit.lua:onSay
[14/08/2019 16:33:07] Description:
[14/08/2019 16:33:07] data/talkactions/scripts/starterkit.lua:11: attempt to call global 'getAccountStorageValue' (a nil value)
[14/08/2019 16:33:07] stack traceback:
[14/08/2019 16:33:07] data/talkactions/scripts/starterkit.lua:11: in function <data/talkactions/scripts/starterkit.lua:8> -
15 horas atrás, Drakopoulos disse:
Tenta assim
PRAGMA journal_mode = MEMORY; PRAGMA synchronous = OFF; PRAGMA foreign_keys = OFF; PRAGMA ignore_check_constraints = OFF; PRAGMA auto_vacuum = NONE; PRAGMA secure_delete = OFF; BEGIN TRANSACTION; CREATE TABLE `account_storage` ( `account_id` INTEGER NOT NULL default '0', `key` INTEGER NOT NULL default '0', `value` TEXT NOT NULL default '0' ); CREATE UNIQUE INDEX `account_storage_account_id_2` ON `account_storage` (`account_id`); CREATE INDEX `account_storage_account_id` ON `account_storage` (`account_id`); COMMIT; PRAGMA ignore_check_constraints = ON; PRAGMA foreign_keys = ON; PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL;
deu certo para criar, vou testar agora o talkaction
da este erro agora na talkaction @Yan Liima
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
Problemas com Outfit na page de Characters.php
em Websites
Postado
estou com este problemas na pagina, nao aparece os outfit. data base sam alteração, simplesmente parou de funcionar.