• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Problema] NO PUEDO CREAR UN PERSONAJE CON VOCACIÓN

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    Chakz

    Chakz
    Nuevo Miembro
    Nuevo Miembro
    //## CREATE CHARACTER on account ###
    if ($action == "createcharacter") {
    $main_content .= '
    <script type="text/javascript">
    var nameHttp;
    function checkName()
    {
    if(document.getElementById("newcharname").value=="")
    {
    document.getElementById("name_check").innerHTML = \'<b><font color="red">Please enter new character name.</font></b>\';
    return;
    }
    nameHttp=GetXmlHttpObject();
    if (nameHttp==null)
    {
    return;
    }
    var newcharname = document.getElementById("newcharname").value;
    var url="?subtopic=ajax_check_name&name=" + newcharname + "&uid="+Math.random();
    nameHttp.onreadystatechange=NameStateChanged;
    nameHttp.open("GET",url,true);
    nameHttp.send(null);
    }

    function NameStateChanged()
    {
    if (nameHttp.readyState==4)
    {
    document.getElementById("name_check").innerHTML=nameHttp.responseText;
    }
    }
    </script>
    ';
    $newchar_name = ucwords(strtolower(trim($_POST['newcharname'])));
    $newchar_sex = $_POST['newcharsex'];
    $newchar_vocation = $_POST['newcharvocation'];
    $newchar_town = $_POST['newchartown'];
    if ($_POST['savecharacter'] != 1) {
    $main_content .= 'Please choose a name';
    if (count($config['site']['newchar_vocations']) > 1)
    $main_content .= ', vocation';
    $main_content .= ' and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >' . htmlspecialchars($config['server']['serverName']) . ' Rules</a>, or your character might get deleted or name locked.';
    if ($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])
    $main_content .= '<b><font color="red"> You have maximum number of characters per account on your account. Delete one before you make new.</font></b>';
    $main_content .= '<br/><br/>
    <form action="?subtopic=accountmanagement&action=createcharacter" method="post" >
    <input type="hidden" name=savecharacter value="1" >
    <div class="TableContainer" >
    <table class="Table3" cellpadding="0" cellspacing="0" >
    <div class="CaptionContainer" >
    <div class="CaptionInnerContainer" >
    <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);" />
    </span>
    <span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);" />
    </span>
    <span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);" >

    </span><span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);" />
    </span><div class="Text" >Create Character</div>
    <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-vertical.gif);" />
    </span>
    <span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/global/content/table-headline-border.gif);" >
    </span>
    <span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);" />
    </span>
    <span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/global/content/box-frame-edge.gif);" />
    </span>
    </div>
    </div>
    <tr>
    <td>
    <div class="InnerTableContainer" >
    <table style="width:100%;" >
    <tr>
    <td>
    <div class="TableShadowContainerRightTop" >
    <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rt.gif);" >
    </div>
    </div>
    <div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/global/content/table-shadow-rm.gif);" >
    <div class="TableContentContainer" >
    <table class="TableContent" width="100%" >
    <tr class="LabelH" >
    <td style="width:50%;" >
    <span id="charactername_label"' . (isset($e['acc']) ? ' class="red"' : '') . '>Name</td>
    <td><span >Sex</td>
    </tr><tr class="Odd" >
    <td>
    <!--
    <input id="newcharname" name="newcharname" onkeyup="checkName();" value="' . htmlspecialchars($newchar_name) . '" size="30" maxlength="29" >
    <tr>
    <td class="LabelV150" >
    <span id="accountname_label"' . (isset($e['acc']) ? ' class="red"' : '') . ' >Account Name:</span>
    </td>
    <td>
    <div id="accountname_indicator" class="InputIndicator" style="background-image:url(' . $layout_name . '/images/global/general/' . ($_POST['step'] != 'docreate' || isset($e['acc']) ? 'n' : '') . 'ok.gif);" ></div>
    </td>
    </tr>
    <tr>
    <td></td>
    <td><span id="accountname_errormessage" class="FormFieldError">' . (isset($e['acc']) ? $e['acc'] : '') . '</span></td>
    </tr>
    -->
    <input id="newcharname" name="newcharname" class="CipAjaxInput" style="width:206px;float:left;" value="' . (isset($_POST['newcharname']) ? htmlspecialchars(substr($_POST['newcharname'], 0, 50)) : '') . '" size="30" maxlength="50" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'./ajax_character.php\',PostData: \'a_CharacterName=\'+encodeURIComponent(getElementById(\'newcharname\').value),Method: \'POST\'});" />
    <div id="charactername_indicator" class="InputIndicator" style="background-image:url(' . $layout_name . '/images/global/general/' . ($_POST['step'] != 'docreate' || isset($e['acc']) ? 'n' : '') . 'ok.gif);" ></div>
    <br>
    <span id="charactername_errormessage" class="FormFieldError">' . (isset($e['acc']) ? $e['acc'] : '') . '</span>
    <BR>
    <font size="1" face="verdana,arial,helvetica">
    <!--<div id="name_check">Please enter your character name.</div>-->
    </font>
    </td>
    <td>';
    $main_content .= '<input type="radio" name="newcharsex" value="1" ';
    if ($newchar_sex == 1)
    $main_content .= 'checked="checked" ';
    $main_content .= '>male<br/>';
    $main_content .= '<input type="radio" name="newcharsex" value="0" ';
    if ($newchar_sex == "0")
    $main_content .= 'checked="checked" ';
    $main_content .= '>female<br/></td></tr></table></div></div></table></div>';
    if (count($config['site']['newchar_towns']) > 1 || count($config['site']['newchar_vocations']) > 1)
    $main_content .= '<div class="InnerTableContainer" > <table style="width:100%;" ><tr>';
    if (count($config['site']['newchar_vocations']) > 1) {
    $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
    foreach ($config['site']['newchar_vocations'] as $char_vocation_key => $sample_char) {
    $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="' . $char_vocation_key . '" ';
    if ($newchar_vocation == $char_vocation_key)
    $main_content .= 'checked="checked" ';
    $main_content .= '>' . htmlspecialchars($vocation_name[$char_vocation_key]) . '</td></tr>';
    }
    $main_content .= '</table></table></td>';
    }

    if (count($config['site']['newchar_towns']) > 1) {
    $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
    foreach ($config['site']['newchar_towns'] as $town_id => $name_town) {

    $main_content .= '<tr><td><input type="radio" name="newchartown" value="' . $town_id . '" ';
    if ($newchar_town == $town_id)
    $main_content .= 'checked="checked" ';
    $main_content .= '>' . htmlspecialchars($towns_list[$town_id]) . '</td></tr>';
    }
    $main_content .= '</table></table></td>';
    }

    if (count($config['site']['newchar_towns']) > 1 || count($config['site']['newchar_vocations']) > 1)
    $main_content .= '</tr></table></div>';
    $main_content .= '</table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="' . $layout_name . '/images/global/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/global/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $layout_name . '/images/global/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
    } else {
    if (empty(strlen($newchar_name) >= 5))
    $newchar_errors[] = 'Please enter a name for your character with 5 letters or more.';
    if (empty($newchar_sex) && $newchar_sex != "0")
    $newchar_errors[] = 'Please select the sex for your character!';
    if (count($config['site']['newchar_vocations']) > 1) {
    if (empty($newchar_vocation))
    $newchar_errors[] = 'Please select a vocation for your character.';
    } else
    $newchar_vocation = $config['site']['newchar_vocations'][0];
    if (count($config['site']['newchar_towns']) > 1) {
    if (empty($newchar_town))
    $newchar_errors[] = 'Please select a town for your character.';
    } else
    $newchar_town = $config['site']['newchar_towns'][0];
    if (empty($newchar_errors)) {
    if (!check_name_new_char($newchar_name))
    $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.<br> Remember not to use more than 3 letters repeated together.';
    if(preg_match('/[^a-zA-Z ]/', $newchar_name))
    $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.<br> Remember not to use more than 3 letters repeated together.';
    if ($newchar_sex != 1 && $newchar_sex != "0")
    $newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
    if (count($config['site']['newchar_vocations']) > 1) {
    $newchar_vocation_check = FALSE;
    foreach ($config['site']['newchar_vocations'] as $char_vocation_key => $sample_char)
    if ($newchar_vocation == $char_vocation_key)
    $newchar_vocation_check = TRUE;
    if (!$newchar_vocation_check)
    $newchar_errors[] = 'Unknown vocation. Please fill in form again.';
    } else
    $newchar_vocation = 0;
    }
    if (empty($newchar_errors)) {
    $check_name_in_database = new Player();
    $check_name_in_database->find($newchar_name);
    if ($check_name_in_database->isLoaded())
    $newchar_errors[] .= 'This name is already used. Please choose another name!';
    $number_of_players_on_account = $account_logged->getPlayersList()->count();
    if ($number_of_players_on_account >= $config['site']['max_players_per_account'])
    $newchar_errors[] .= 'You have too many characters on your account <b>(' . $number_of_players_on_account . '/' . $config['site']['max_players_per_account'] . ')</b>!';
    }
    if (empty($newchar_errors)) {
    $char_to_copy_name = $config['site']['newchar_vocations'][$newchar_vocation];
    $char_to_copy = new Player();
    $char_to_copy->find($char_to_copy_name);
    if (!$char_to_copy->isLoaded())
    $newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy <b>' . htmlspecialchars($char_to_copy_name) . '</b> doesn\'t exist.';
    }
    if (empty($newchar_errors)) {

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    Tienes el account manager en tu base de datos?

    Chakz

    Chakz
    Nuevo Miembro
    Nuevo Miembro
    Hola Dfsuno, gracias por comentar, el accountmanagement.php lo tengo en la carpeta del IniServerZ, donde alojo la página web

    Chakz

    Chakz
    Nuevo Miembro
    Nuevo Miembro
    [Problema] NO PUEDO CREAR UN PERSONAJE CON VOCACIÓN 20200511



    Very Happy Resuelto Gracias Very Happy

    cimmeria

    cimmeria
    Miembro
    Miembro
    hola puede ser que tu problema este en que en la carpeta config de la pagina web mira en mi config encontre esto
    Código:
    # Create Character Options
    $config['site']['newchar_vocations'] = array(0 => 'Rook Sample');
    esto quiere decir que yo como uso rook lo dejo asín pero si tu quieres que aparezca al crear las voc tienes que añadirlo hay otra cosa mas donde pongas el knight sample logeado aparece el que crees al menos antes era asín

    http://sayayinz.ddns.net

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Tema Resuelto



    [Problema] NO PUEDO CREAR UN PERSONAJE CON VOCACIÓN YNU5B25
    https://www.tibiaface.com

    Contenido patrocinado


    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).