• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Please help me with this code.

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Reaction score
0
Hi, could someone please write this to me for 7.6 server?

Przechwytywanie.PNG

here my characters.php

PHP:
<?php
$char = $_REQUEST['char'];
$format = '%d/%m/%Y %H:%M:%S';
$monster_folder = "$data_folder\\monsters\\";
$folderplayer = "$data_folder\\players\\";
$file= "$folderplayer$char.xml";
$f = @fopen($file, "r");
if(!$char)
    {     
    }
else if(!$f)
    {
    echo "<center><b style='color:#6c0000'>Posta� nieistnieje.</b></center><br>";
    }
else
    {
    $contents = fread($f, filesize($file));
    $tags = explode("<", $contents);
    $name = "";
    $exp = 0;
    $level = 0;
    $magic_level = 7;
    $mana_max = 0;
    $voc = 0;
    $lastlogin = 0;
    $temple = 0;
    $redskull = 0;
    $redskulltime = 0;
     $skills = array(0, 1, 2, 3, 4, 5, 6);
    foreach($tags as $tag)
        {
        if(substr($tag, 0, 6) == "player")
            {
            if($temppos = stristr($tag, "name=\""))
                {
                $temp = explode("\"", $temppos);
                $name = $temp[1];
                }
            
            $guild_file = $data_folder . "/guilds.xml";
            $g = fopen($guild_file, "r");
            $guild_contents = fread($g, filesize($guild_file));
            $guild_tags = explode("<", $guild_contents);
            $found = 0;
            foreach($guild_tags as $guild_tag)
                {
                if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
                    {
                    if ($temppos = stristr($guild_tag, "name=\""))
                        {
                        $temp = explode("\"", $temppos);
                        $guild_name = $temp[1];
                        }
                    }
                if (substr($guild_tag, 0, 6) == "member")
                    {
                    if ($temppos = stristr($guild_tag, "name=\"$char"))
                        {
                        $temp = explode("\"", $temppos);
                        $member_name = $temp[1];
                        $found = 1;
                        }
                    }
                }
            if ($found == 0)
                {
                $guild_name = 'Brak';
                }
            $guild_file = $data_folder . "/guilds.xml";
            $g = fopen($guild_file, "r");
            $guild_contents = fread($g, filesize($guild_file));
            $guild_tags = explode("<", $guild_contents);
            $found = 0;
            foreach($guild_tags as $guild_tag)
                {
                if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
                    {
                    if ($temppos = stristr($guild_tag, "name=\""))
                        {
                        $temp = explode("\"", $temppos);
                        $guild_name = "<a style='color:#6A402E;text-decoration:none'href='index.php?subtopic=guild&guild=$temp[1]'>$temp[1]</a>";
                        }
                    }
                if (substr($guild_tag, 0, 6) == "member")
                    {
                    if ($temppos = stristr($guild_tag, "name=\"$char"))
                        {
                        $temp = explode("\"", $temppos);
                        $member_name = $temp[1];
                        $found = 1;
                        }
                    }
                }
            if ($found == 0)
                {
                $guild_name = 'Brak';
                }


            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $level = $temp[1];
                }

            if($temppos = stristr($tag, "exp=\""))
                {
                $temp = explode("\"", $temppos);
                $exp = $temp[1];
                }

            if($temppos = stristr($tag, "account=\""))
                {
                $temp = explode("\"", $temppos);
                $acc = $temp[1];
                }

            if($temppos = stristr($tag, "access=\""))
                {
                $temp = explode("\"", $temppos);
                $access = $temp[1];
                }
            if($temppos = stristr($tag, "sex=\""))
                {
                $temp = explode("\"", $temppos);
                $sexx = $temp[1];
                } 
            if($temppos = stristr($tag, "promoted=\""))
                {
                $temp = explode("\"", $temppos);
                $pacc = $temp[1];
                } 
            if($temppos = stristr($tag, "maglevel=\""))
                {
                $temp = explode("\"", $temppos);
                $magic_level = $temp[1];
                }
            if($temppos = stristr($tag, "banned=\""))
                {
                $temp = explode("\"", $temppos);
                $ban = $temp[1];
                }
            if($temppos = stristr($tag, "voc=\""))
                {
                $temp = explode("\"", $temppos);
                $voc = $temp[1];
                }
            if($temppos = stristr($tag, "mana max=\""))
                {
                $temp = explode("\"", $temppos);
                $mana_max = $temp[1];
                }     
            if($temppos = stristr($tag, "promoted=\""))
                {
                $temp = explode("\"", $temppos);
                $promoted = $temp[1];
                }
            if($temppos = stristr($tag, "lastlogin=\""))
                {
                $temp = explode("\"", $temppos);
                $lastlogin = $temp[1];
                }
            }
        if(substr($tag, 0, 6) == "skull ")
            {
            if($temppos = stristr($tag, "redskull=\""))
                {
                $temp = explode("\"", $temppos);
                $redskull = $temp[1];
                }

            if($temppos = stristr($tag, "redskulltime=\""))
                {
                $temp = explode("\"", $temppos);
                $redskulltime = $temp[1];
                }
            }


        if(substr($tag, 0, 6) == "skill ")
            {
            if($temppos = stristr($tag, "skillid=\""))
                {
                $temp = explode("\"", $temppos);
                $tempid = $temp[1];
                }
            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $templvl = $temp[1];
                }
            if($tempid && $templvl)
                {
                $skills[$tempid] = $templvl;
                }
            }

            if(substr($tag, 0, 6) == "mana ")
            {
            if($temppos = stristr($tag, "max=\""))
                {
                $temp = explode("\"", $temppos);
                $manaMAX = $temp[1];
                }
            if($temppos = stristr($tag, "now=\""))
                {
                $temp = explode("\"", $temppos);
                $manaNOW = $temp[1];
                }
            }

        if(substr($tag, 0, 6) == "death ")
            {
            if($temppos = stristr($tag, "name=\""))
                {
                $temp = explode("\"", $temppos);
                $tempname = $temp[1];
                }
            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $templvl = $temp[1];
                }
            if($temppos = stristr($tag, "time=\""))
                {
                $temp = explode("\"", $temppos);
                $temptime = $temp[1];
                }
        $deadtime = strftime($format, $temptime);
        if($tempname && $templvl && $deadtime)
            {
            if(file_exists("$monster_folder$tempname.xml"))
                {
                $deathtext[] = "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'> $deadtime </td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'> Zabity na levelu $templvl przez a $tempname </td></tr>";
                }
            else if(file_exists("$folderplayer$tempname.xml"))
                {
                $deathtext[] = "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'> $deadtime </td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'> Zabity na levelu $templvl przez <b><a style='color:black;text-decoration:none' href=\"index.php?subtopic=character&char=$tempname\">$tempname</a></b> </td></tr>";
                }
            else
                {
                $deathtext[] = "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'> $deadtime </td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'> Zabity na levelu $templvl przez $tempname </td></tr>";
                }
            }
        }
    }



if ($access > 1)
    {
    echo "<b style='color:#6c0000'>Nie mo�esz zobaczy� statystyk tej postaci.</b><br />";
    }
else
    {
    $login = strftime($format, $lastlogin);
    echo "<TABLE style='border-width:1px;border-color:#0f0f0f; border-style: solid; border-collapse:collapse; WIDTH:100%;'>";
    echo "<TR BGCOLOR=#A27531><TD COLSPAN=2 style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left; color: black; padding: 3px;'><b>Informacje o postaci</b></td></tr>";

        $rstime = strftime($format, $redskulltime);
    if ($redskulltime == '0')
        {
        $rstime = "Brak";
        }

    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Nick:</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'><font color='green'><b>$name</b></font> </td></tr>";


    if($promoted == 0)
            {


    $sex = array("Dziewczyna","Ch�opak","Dziewczyna","Ch�opak","Dziewczyna","Ch�opak","Dziewczyna","Ch�opak");
    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>P�e�: </b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$sex[$sexx]</td></tr>";


        $vocations = array("No Vocation", "Sorcerer", "Druid", "Paladin", "Knight", "Master Sorcerer", "Elder Druid", "Royal Paladin", "Elite Knight","9", "10", "11", "<b>Nobless Sorcerer</B>", "<b>Nobless Druid</B>", "<b>Nobless Paladin</B>", "<b>Nobless Knight</B>");
        }
    else
        {
        $vocations = array("No Vocation", "Master Sorcerer", "Elder Druid", "Royal Paladin", "Elite Knight", "Nobless Sorcerer", "Nobless Druid", "Nobless Paladin", "Nobless Knight");
        }
    
    

    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Profesja:</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$vocations[$voc]</td></tr>";

    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Level:</b> </td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$level</td></tr>";
    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Punkty Do�wiadczenia::</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$exp pkt. do�wiadczenia</tr>";
    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Cz�onek Gildii:</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$guild_name</td></tr>";
    

    

    if ($lastlogin == '0')
        {
        $login = "Nigdy";
        }
    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Ostatnie Logowanie:</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$login</td></tr>";
    echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Frag:</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$rstime <img src='images/$redskull.gif'/></td></tr>";

        echo "</table><br>";





        echo "<TABLE style='border-width:1px;border-color:#0f0f0f; border-style: solid; border-collapse:collapse; WIDTH:100%;'>";
    echo "<TR BGCOLOR=#A27531><TD COLSPAN=2 style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left; color: black; padding: 3px;'><b>Informacje o koncie</b></td></tr>";
    
        echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Status Konta:</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: green;'><b>$mana_max</b></td></tr>";
        echo "</table><br>";

        echo "<TABLE style='border-width:1px;border-color:#0f0f0f; border-style: solid; border-collapse:collapse; WIDTH:100%;'>";
    echo "<TR BGCOLOR=#A27531><TD COLSPAN=2 style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left; color: black; padding: 3px;'><b>Skille gracza</b></td></tr>";
    
 
        echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'><b>Magic Level:</b></td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$magic_level</td></tr>";
    
    $skillnames = array("Fist Fighting","Club Fighting","Sword Fighting","Axe Fighting","Distance Fighting","Shielding","Fishing");

    foreach($skills as $k => $skill)
        {
        if(!$skill) continue;
        echo "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>$skillnames[$k]:</td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #6A402E;'>$skill</td></tr>";


    

 
        }
    if($deathtext)
        {

    echo "</table><br>";



echo "<TABLE style='border-width:1px;border-color:#0f0f0f; border-style: solid; border-collapse:collapse; WIDTH:100%;'>";
    echo "<TR BGCOLOR=#A27531><TD COLSPAN=2 style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left; color: black; padding: 3px;'><b>�mierci gracza</b></td></tr>";

        foreach($deathtext as $temp)
            {
            echo "$temp";
            }
        }
    echo "</table>";


echo "<br><TABLE style='border-width:1px;border-color:#0f0f0f; border-style: solid; border-collapse:collapse; WIDTH:30%;'>";
    echo "<TR BGCOLOR=#A27531><TD COLSPAN=3 style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left; color: black; padding: 3px;'><b>EQ</b></td></tr>";

    $xml = simplexml_load_file($file);
    foreach ($xml->inventory->slot as $ds)
    {
        $slot = intval($ds['slotid']);
        $img_id = "<img border='0' src='img/".$ds->item['id'].".gif'>";
        $img_src = "img/".$ds->item['id'].".gif";
        $img = "brak<br>obrazka.. ".$ds->item['id'];
         if(file_exists($img_src))
            $item_img[$slot] = $img_id;
         else
            $item_img[$slot] = $img;
    
   }
 $x = "1";
    while ($x <= 10){
    $slot = intval($x);
//conf
//$img = "Brak Obrazka..";
$img = "<img border='0' src='img/".$slot.".gif'>";
//$img_s = "img/slot_".$slot.".png";
//$img = "<img border='0' src='".$img_s."'>";
// end conf
       if($item_img[$slot] == ""){
          $item_img[$slot] = $img;
       }
      $x++;
    }

echo "<center>
<TR BGCOLOR='#D4AA65' >
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[2]."
</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[1]."
</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[3]."
</td>
</tr>
<TR BGCOLOR='#D4AA65' >
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[6]."
</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[4]."
</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[5]."
</td>
</tr>
<TR BGCOLOR='#D4AA65' >
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[9]."
</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[7]."
</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[10]."
</td>
</tr>
<TR BGCOLOR='#D4AA65' >
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>

</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>
".$item_img[8]."
</td>
<TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:20%;'>

</td>
</tr>
</center>
</table>";

echo "<br><TABLE style='border-width:1px;border-color:#0f0f0f; border-style: solid; border-collapse:collapse; WIDTH:100%;'>";
    echo "<TR BGCOLOR=#A27531><TD COLSPAN=2 style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left; color: black; padding: 3px;'><b>Questy</b></td></tr>";

  include("keys.php");
  $xml = simplexml_load_file($file);

  foreach ($keys as $qs)
  {
      $mess = "";
      $key = array_keys($keys, $qs);

      foreach ($xml->storage->data as $storage)
          if($key[0] == $storage['key'])
              $mess = "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:80%;'> $qs </td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #006600;'>Wykonany</td></tr>";

      if($mess == "")  $mess = "<TR BGCOLOR='#D4AA65'><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;font-weight: bold;color: #6A402E;width:80%;'> $qs </td><TD style='border-width:1px;border-color:#0f0f0f; border-style: solid; text-align: left;font-size: 11px; padding: 3px;color: #CC0000;'>Nie wykonany</td></tr>";
  echo($mess);
  }
  echo "</table>";

        
    }
}
?>
 
Top