Karakter kreátor

Indította [VIP]Nzioâ„¢, 2012-06-20, 10:36:08

2012-06-20, 10:36:08 Utolsó szerkesztés: 2012-06-23, 13:22:31 Szerző: Nzio™
Hello mindenkinek!
Elhoztam nektek Lenosiaról NotEnoughForYou karakter kreátorát.

Kép róla:

Tessék:
<?phpif(isset($_SESSION['user_id'])) {    // DB selectmysql_select_db("player");?>

<h2>Charakter erstellen</h2>
<p>Hier k&ouml;nnen sie einen Charakter erstellen</p>
<form action="index.php?s=create_char" method="post">
<table>
<tr>
<th class="topLine">Rasse:</th>
<td class="tdunkel"><select name="rasse">
<option value="krieger">Krieger</option>
<option value="sura">Sura</option>
<option value="shamane">Schamane</option>
<option value="ninja">Ninja</option></select></td>
</tr>
<tr>
<th class="topLine">Geschlecht:</th>
<td class="tdunkel"><input type="radio" value="M&auml;nlich" name="m">M&auml;nlich</input> <input type="radio" value="Weiblich" name="w" >Weiblich</input></td>
</tr>
<?php// Falls noch kein Char existiert kann man das Reich auswählen$cheksreiche = mysql_query("SELECT account_id, empire FROM player WHERE account_id LIKE '".$_SESSION['user_id']."'");$empire = mysql_fetch_object(mysql_query("SELECT * FROM account.account WHERE id LIKE '".$_SESSION['user_id']."'"));$empireinto = $empire->empire;$Checkempire = mysql_num_rows(mysql_query("SELECT account_id FROM player WHERE account_id LIKE '".$_SESSION['user_id']."'"));if($Checkempire < 1) {    echo'<tr>    <th class="topLine">Reich:</th>    <td class="tdunkel"><select name="empire">    <option value="reich1">Rotes Reich</option>    <option value="reich2">Gelbes Reich</option>    <option value="reich3">Blaues Reich</option>    </select>    </td>    </tr>';    }    ?>

<tr>
<th class="topLine">Charaktername:</th>
<td class="tdunekl"><input type="text" name="charname" maxlength="12" ></input></td>
</table>
<input type="submit" name="erstellen" value="Charakter erstellen"></input>
</form>

<?phpif(isset($_POST['erstellen'])) {        // Vairabeln befüllen    $Rasse = $_POST['rasse'];    $Maenlich = $_POST['m'];    $Weiblich = $_POST['w'];    $name = $_SESSION['user_id'];    $Charname = mysql_real_escape_string($_POST['charname']);            $empireset = $_POST['empire'];        if($empireset == "reich1") {        $empireright = 1;        $x = 468779;        $y = 962107;        $map_index = 1;    }    if($empireset == "reich2") {        $empireright = 2;        $x = 55700;        $y = 157900;        $map_index = 21;    }    if($empireset == "reich3") {        $empireright = 3;        $x = 969066;        $y = 278290;        $map_index = 41;    }        // Klassenspezifische Attribute festlegen        if (($Rasse == "krieger") and ((!empty($Maenlich)))) {        $job = 0;        $hp = 760;        $mp = 260;        $st = 6;        $ht = 4;        $dx = 3;        $iq = 3;    }    if(($Rasse == "krieger") and ((!empty($Weiblich)))){                $job = 4;        $hp = 760;        $mp = 260;        $st = 6;        $ht = 4;        $dx = 3;        $iq = 3;    }    if(($Rasse == "sura") and ((!empty($Weiblich)))){                $job = 6;        $hp = 770;        $mp = 300;        $st = 5;        $ht = 3;        $dx = 3;        $iq = 5;    }    if(($Rasse == "sura") and ((!empty($Maenlich)))){                $job = 2;        $hp = 770;        $mp = 300;        $st = 5;        $ht = 3;        $dx = 3;        $iq = 5;    }        if(($Rasse == "ninja") and ((!empty($Maenlich)))){                $job = 5;        $hp = 770;        $mp = 260;        $st = 4;        $ht = 3;        $dx = 6;        $iq = 3;    }        if(($Rasse == "ninja") and ((!empty($Weiblich)))){                $job = 1;        $hp = 770;        $mp = 260;        $st = 4;        $ht = 3;        $dx = 6;        $iq = 3;    }        if(($Rasse == "shamane") and ((!empty($Maenlich)))){                $job = 7;        $hp = 860;        $mp = 320;        $st = 3;        $ht = 4;        $dx = 3;        $iq = 6;    }        if(($Rasse == "shamane") and ((!empty($Weiblich)))){                $job = 3;        $hp = 860;        $mp = 320;        $st = 3;        $ht = 4;        $dx = 3;        $iq = 6;    }        if(!isset($_POST['empire'])) {        if($empire->empire == 1) {        $x = 468779;        $y = 962107;        $map_index = 1;        }        if($empire->empire == 2) {        $x = 55700;        $y = 157900;        $map_index = 21;        }        if($empire->empire == 3) {        $x = 969066;        $y = 278290;        $map_index = 41;        }    }    // Überrpüfen ob der Account schon 4 Charaktere hat         $Check = mysql_num_rows(mysql_query("SELECT account_id FROM player WHERE account_id LIKE '".$_SESSION['user_id']."'"));                                            if((!empty($Weiblich)) xor (!empty($Maenlich)) and (!empty($Charname)) and (!empty($Rasse))) {        if(!preg_match ("/[a-z][a-z0-9]/",$Charname)) {                echo'<p>Es d&uuml;rfen nur Buchstaben von A-Z / a-z und Zahlen von 0-9 verwendet werden</p>';            }    else {        if($Check <=3){            $namecheck = mysql_num_rows(mysql_query("SELECT name FROM player WHERE name LIKE '$Charname'"));            if($namecheck == false){                                                        // Query zum Erstellen des Charakters    $QueryCreateAcc = mysql_query("INSERT INTO player (account_id, name, job, voice, dir, x, y, z, map_index, exit_x, exit_y, exit_map_index, hp, mp, stamina, random_hp, random_sp, playtime, level, level_step, st, ht, dx, iq, exp, gold, stat_point, skill_point, quickslot, ip, part_main, part_base, part_hair, skill_group, skill_level, alignment, last_play, change_name, mobile, sub_skill_point, stat_reset_count, horse_hp, horse_stamina, horse_level, horse_hp_droptime, horse_riding, horse_skill_point, orgname) VALUES ('$name', '$Charname', '$job', '0', '0', '$x', '$y', '0', '$map_index','0','0', '0','$hp', '$mp', '800', '0', '0', '0', '1', '0', '$st', '$ht', '$dx', '$iq', '0', '0', '0', '0', '(BLOB)', '0.0.0.0', '0', '0', '0', '0', '(BLOB)', '0', '0', '0', ' ', '0', '0', '0', '0', '0', '0', '0', '0', 'NONAME')");                $id = mysql_fetch_object(mysql_query("SELECT id, name FROM player WHERE name Like '$Charname'"));    $id2 = $id->id;    $userid = $_SESSION['user_id'];    $selects = mysql_fetch_object(mysql_query("SELECT * FROM player_index WHERE id LIKE '".$_SESSION['user_id']."'"));    if(!isset($_POST['empire'])) {                // Char Position im Clienten ( Bei der Auswahl )    if($selects) {        if((($selects->pid1 == 0)) and (!isset($_POST['empire']))) {            $player_indexup = mysql_query("UPDATE player_index SET pid1='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }                            if((($selects->pid1 != 0)) and (($selects->pid2 == 0))){        $player_indexup = mysql_query("UPDATE player_index SET pid2='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }        if((($selects->pid1 != 0)) and (($selects->pid2 != 0)) and (($selects->pid3 == 0))) {            $player_indexup = mysql_query("UPDATE player_index SET pid3='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }        if((($selects->pid1 != 0)) and (($selects->pid2 !=0)) and (($selects->pid3 != 0)) and (($selects->pid4 == 0))) {            $player_indexup = mysql_query("UPDATE player_index SET pid4='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }    }    }                 if(isset($_POST['empire'])) {                        $player_indexup = mysql_query("INSERT INTO player_index (id, pid1, empire) VALUES('$userid', '$id2', '$empireright')");            }         if(isset($empireset)) {        mysql_select_db("account");        $empireupdate = mysql_query("UPDATE account SET empire='$empireright' WHERE id LIKE '".$_SESSION['user_id']."'");    }            }                                else {                echo'<p> Einen Charakter mit diesem Namen gibt es schon</p>';            }        }        else {            echo'<p>Sie haben schon 4 Charaktere</p>';        }        if($QueryCreateAcc) {        echo' <p>Charakter erfolgreich angelegt</p>';    }    else {        echo'<p>Charakter konnte nicht angelegt werden</p>';    }                    }}else {        echo'<p>Alle Felder ausf&uuml;llen</p>';    }    }        }else {    echo' <h2>Zugriff verwehrt</h2>';    echo'<p>Sie m&uuml;ssen eingeloggt sein</p>';}?>


Sok sikert hozzá!

Magyarosítás by Salamon
<?phpif(isset($_SESSION['user_id'])) {    // DB selectmysql_select_db("player");?>

<h2>Karakter Létrehozása</h2>
<p>Itt Hozhat Létre Új Karakter</p>
<form action="index.php?s=create_char" method="post">
<table>
<tr>
<th class="topLine">Osztály:</th>
<td class="tdunkel"><select name="rasse">
<option value="krieger">Harcos</option>
<option value="sura">Sura</option>
<option value="shamane">Sámán</option>
<option value="ninja">Ninja</option></select></td>
</tr>
<tr>
<th class="topLine">Nem:</th>
<td class="tdunkel"><input type="radio" value="Mänlich" name="f">Mäférfi</input> <input type="radio" value="Weiblich" name="w" >nő</input></td>
</tr>
<?php// Falls noch kein Char existiert kann man das Reich auswählen$cheksreiche = mysql_query("SELECT account_id, empire FROM player WHERE account_id LIKE '".$_SESSION['user_id']."'");$empire = mysql_fetch_object(mysql_query("SELECT * FROM account.account WHERE id LIKE '".$_SESSION['user_id']."'"));$empireinto = $empire->empire;$Checkempire = mysql_num_rows(mysql_query("SELECT account_id FROM player WHERE account_id LIKE '".$_SESSION['user_id']."'"));if($Checkempire < 1) {    echo'<tr>    <th class="topLine">Birodalom:</th>    <td class="tdunkel"><select name="empire">    <option value="reich1">Piros</option>    <option value="reich2">Sárga</option>    <option value="reich3">Kék</option>    </select>    </td>    </tr>';    }    ?>

<tr>
<th class="topLine">Karakter neve:</th>
<td class="tdunekl"><input type="text" name="charname" maxlength="12" ></input></td>
</table>
<input type="submit" name="erstellen" value="Charakter erstellen"></input>
</form>

<?phpif(isset($_POST['erstellen'])) {        // Vairabeln befüllen    $Rasse = $_POST['rasse'];    $Maenlich = $_POST['m'];    $Weiblich = $_POST['w'];    $name = $_SESSION['user_id'];    $Charname = mysql_real_escape_string($_POST['charname']);            $empireset = $_POST['empire'];        if($empireset == "reich1") {        $empireright = 1;        $x = 468779;        $y = 962107;        $map_index = 1;    }    if($empireset == "reich2") {        $empireright = 2;        $x = 55700;        $y = 157900;        $map_index = 21;    }    if($empireset == "reich3") {        $empireright = 3;        $x = 969066;        $y = 278290;        $map_index = 41;    }        // Klassenspezifische Attribute festlegen        if (($Rasse == "krieger") and ((!empty($Maenlich)))) {        $job = 0;        $hp = 760;        $mp = 260;        $st = 6;        $ht = 4;        $dx = 3;        $iq = 3;    }    if(($Rasse == "krieger") and ((!empty($Weiblich)))){                $job = 4;        $hp = 760;        $mp = 260;        $st = 6;        $ht = 4;        $dx = 3;        $iq = 3;    }    if(($Rasse == "sura") and ((!empty($Weiblich)))){                $job = 6;        $hp = 770;        $mp = 300;        $st = 5;        $ht = 3;        $dx = 3;        $iq = 5;    }    if(($Rasse == "sura") and ((!empty($Maenlich)))){                $job = 2;        $hp = 770;        $mp = 300;        $st = 5;        $ht = 3;        $dx = 3;        $iq = 5;    }        if(($Rasse == "ninja") and ((!empty($Maenlich)))){                $job = 5;        $hp = 770;        $mp = 260;        $st = 4;        $ht = 3;        $dx = 6;        $iq = 3;    }        if(($Rasse == "ninja") and ((!empty($Weiblich)))){                $job = 1;        $hp = 770;        $mp = 260;        $st = 4;        $ht = 3;        $dx = 6;        $iq = 3;    }        if(($Rasse == "shamane") and ((!empty($Maenlich)))){                $job = 7;        $hp = 860;        $mp = 320;        $st = 3;        $ht = 4;        $dx = 3;        $iq = 6;    }        if(($Rasse == "shamane") and ((!empty($Weiblich)))){                $job = 3;        $hp = 860;        $mp = 320;        $st = 3;        $ht = 4;        $dx = 3;        $iq = 6;    }        if(!isset($_POST['empire'])) {        if($empire->empire == 1) {        $x = 468779;        $y = 962107;        $map_index = 1;        }        if($empire->empire == 2) {        $x = 55700;        $y = 157900;        $map_index = 21;        }        if($empire->empire == 3) {        $x = 969066;        $y = 278290;        $map_index = 41;        }    }    // Überrpüfen ob der Account schon 4 Charaktere hat         $Check = mysql_num_rows(mysql_query("SELECT account_id FROM player WHERE account_id LIKE '".$_SESSION['user_id']."'"));                                            if((!empty($Weiblich)) xor (!empty($Maenlich)) and (!empty($Charname)) and (!empty($Rasse))) {        if(!preg_match ("/[a-z][a-z0-9]/",$Charname)) {                echo'<p>Es dürfen csak betüket A-Z/a-z-ig és számokat 0-9-ig tartalmazhat </p>';            }    else {        if($Check <=3){            $namecheck = mysql_num_rows(mysql_query("SELECT name FROM player WHERE name LIKE '$Charname'"));            if($namecheck == false){                                                        // Query zum Erstellen des Charakters    $QueryCreateAcc = mysql_query("INSERT INTO player (account_id, name, job, voice, dir, x, y, z, map_index, exit_x, exit_y, exit_map_index, hp, mp, stamina, random_hp, random_sp, playtime, level, level_step, st, ht, dx, iq, exp, gold, stat_point, skill_point, quickslot, ip, part_main, part_base, part_hair, skill_group, skill_level, alignment, last_play, change_name, mobile, sub_skill_point, stat_reset_count, horse_hp, horse_stamina, horse_level, horse_hp_droptime, horse_riding, horse_skill_point, orgname) VALUES ('$name', '$Charname', '$job', '0', '0', '$x', '$y', '0', '$map_index','0','0', '0','$hp', '$mp', '800', '0', '0', '0', '1', '0', '$st', '$ht', '$dx', '$iq', '0', '0', '0', '0', '(BLOB)', '0.0.0.0', '0', '0', '0', '0', '(BLOB)', '0', '0', '0', ' ', '0', '0', '0', '0', '0', '0', '0', '0', 'NONAME')");                $id = mysql_fetch_object(mysql_query("SELECT id, name FROM player WHERE name Like '$Charname'"));    $id2 = $id->id;    $userid = $_SESSION['user_id'];    $selects = mysql_fetch_object(mysql_query("SELECT * FROM player_index WHERE id LIKE '".$_SESSION['user_id']."'"));    if(!isset($_POST['empire'])) {                // Char Position im Clienten ( Bei der Auswahl )    if($selects) {        if((($selects->pid1 == 0)) and (!isset($_POST['empire']))) {            $player_indexup = mysql_query("UPDATE player_index SET pid1='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }                            if((($selects->pid1 != 0)) and (($selects->pid2 == 0))){        $player_indexup = mysql_query("UPDATE player_index SET pid2='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }        if((($selects->pid1 != 0)) and (($selects->pid2 != 0)) and (($selects->pid3 == 0))) {            $player_indexup = mysql_query("UPDATE player_index SET pid3='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }        if((($selects->pid1 != 0)) and (($selects->pid2 !=0)) and (($selects->pid3 != 0)) and (($selects->pid4 == 0))) {            $player_indexup = mysql_query("UPDATE player_index SET pid4='$id2' WHERE id LIKE '".$_SESSION['user_id']."'");        }    }    }                 if(isset($_POST['empire'])) {                        $player_indexup = mysql_query("INSERT INTO player_index (id, pid1, empire) VALUES('$userid', '$id2', '$empireright')");            }         if(isset($empireset)) {        mysql_select_db("account");        $empireupdate = mysql_query("UPDATE account SET empire='$empireright' WHERE id LIKE '".$_SESSION['user_id']."'");    }            }                                else {                echo'<p> Még nincs ilyen nevü karakter</p>';            }        }        else {            echo'<p>Van Már 4 Karakter</p>';        }        if($QueryCreateAcc) {        echo' <p>Karakter sikeresen létrehozva</p>';    }    else {        echo'<p>Karakter nem hozható létre</p>';    }                    }}else {        echo'<p>Alle Felder ausfüllen</p>';    }    }        }else {    echo' <h2>Hozzáférés megtagadva</h2>';    echo'<p> müssen bekell jelentkezned</p>';}?>