Witam, mam taki problem co do tego acc makera AccSiteTeam-Dark-V.02.
Nie potrafi? zrobi? ?eby przy zakladaniu konta robi?o si? konto no vocation czyli na rookgard,
Folder acc.php
Folder addchar.php
Folder configacc.php
Prosze o pomoc !!!! bede bardzo wdzieczny
Nie potrafi? zrobi? ?eby przy zakladaniu konta robi?o si? konto no vocation czyli na rookgard,
Folder acc.php
Kod:
<td valign="top">
<table class="tb2" align="center">
<tr><td class="menun"><p>Nowe<font color="#FF3A36"> Konto</font></p></td></tr>
<tr><td class="news">
<form method="post" action="index.php?accsite=newacc">
<table cellspacing="0" width="100%">
<tr><td width="20%"><font color='#ffffff' face='verdana' size='1'>Numer Konta:</font></td>
<td><?
$account = rand(100000, 999999);
print '<font color="#ffffff" face="verdana" size="1">' . $account . '</font> <input type="hidden" name="account" value="' . $account . '">' . "\n";
?></td>
</tr>
<tr>
<td width="20%"><font color='#ffffff' face='verdana' size='1'>Nick:</font></td>
<td><input type="text" name="nick" maxlength="20" /> <span class="copy"><font color='#ffffff' face='verdana' size='1'>3-20 characters</font></span></td>
</tr> <tr>
<td width="20%"><font color='#ffffff' face='verdana' size='1'>Has?o: </font></td>
<td><input type="password" name="pass" maxlength="10"> <span><font color='#ffffff' face='verdana' size='1'>3-10 characters</font></span></td>
<tr>
<tr>
<td width="20%"><font color='#ffffff' face='verdana' size='1'>P?e?:</font></td>
<td>
<input type="radio" name="sex" value="1" checked> <font color='#ffffff' face='verdana' size='1'>Ch?opak</font>
<input type="radio" name="sex" value="0"> <font color='#ffffff' face='verdana' size='1'>Dziewczyna</font>
</td>
</tr>
<tr>
<td width="20%"><font color='#ffffff' face='verdana' size='1'>Profesja:</font></td>
<td>
<input type="radio" name="vocation" value="1" checked> <font color='#ffffff' face='verdana' size='1'>Sorcerer</font>
<input type="radio" name="vocation" value="2"> <font color='#ffffff' face='verdana' size='1'>Druid</font>
<input type="radio" name="vocation" value="3"> <font color='#ffffff' face='verdana' size='1'>Paladin</font>
<input type="radio" name="vocation" value="4"> <font color='#ffffff' face='verdana' size='1'>Knight</font>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Utw?rz">
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
Kod:
<td valign="top">
<table class="tb2" align="center">
<tr><td class="menun"><p>Nowa Posta? <font color="#FF3A36"> <?=$nick?></font></p></td></tr>
<tr><td class="news"><?php
error_reporting(E_ALL);
include 'checkunique.php';
require 'config.php';
$delay = "0";
$url = "index.php?accsite=default";
include 'redir.php';
$_SESSION['page'] = 'index.php?accsite=addchar';
function skills($vocation)
{
require 'configacc.php';
$str = "";
for ($id = 0; $id <= 6; $id++)
$str .= ('<skill skillid="' . $id . '" level="' . $skill[$vocation][$id] . '" tries="0"/>' . "\n");
return $str;
}
function equip($vocation)
{
require'configacc.php';
$str = "";
for ($id = 1; $id <= 10; $id++)
{
if ($equip[$vocation][$id-1] != 0)
{
$str .= ('<slot slotid="' . $id . '"><item id="' . $equip[$vocation][$id-1] . '"');
if ($id == 3) // backpack
$str .= ('><inside>' . $bp[$vocation] . '</inside></item>');
else
$str .= ('/>');
$str .= ('</slot>' . "\n");
}
}
return $str;
}
function newacc()
{
require('config.php'); // This is the config with paths
$nick = $_POST['nick'];
$charname = $nick;
$sex = $_POST['sex'];
$vocation = $_POST['vocation'];
$account = $_SESSION['user'];
($sex == 0 || $sex == 1) or die ('Invalid sex!');
($vocation >= 1 && $vocation <= 4) or die ('Invalid vocation!');
if($sizeacc == "7"){
($account >= 1000000 && $account <= 9999999) or die ('Niepoprawny account number!'); // Six numbers
}
else if($sizeacc == "6"){
($account >= 100000 && $account <= 999999) or die ('Niepoprawny account number!'); // Five numbers
}
else{
($account >= 100000 && $account <= 999999) or die ('Niepoprawny account number!'); // If not found then Five numbers.
}
// ($account >= 100000 && $account <= 999999) or die ('Niepoprawny account number!'); // This is the old shit
preg_match("/^[a-zA-Z][a-zA-Z ]*$/", $nick) or die ('Nick zawiera niedozwolone znaki!');
!preg_match("/^gm/i", $nick) or die ('Nie jeste GM!');
!preg_match("/^god/i", $nick) or die ('Nie jeste GOD!');
$diraccount = $folderacc;
$dirplayer = $folderplayer;
$account_file = "$diraccount/$account.xml";
$player_file = "$dirplayer/$nick.xml";
$myfile = ''.$folderacc.''.$account.'.xml';
//account file
$fh = fopen($myfile, 'r');
$data = fread($fh, filesize($myfile));
$data = trim($data);
fclose($fh);
$tmpsrch = strpos($data, '</characters>');
$data = trim($data);
$leftbit = substr($data, 0, $tmpsrch);
$rightbit = substr($data, $tmpsrch);
$charfile = ''.$folderplayer.'' . $nick . '.xml';
if (file_exists($charfile)){
$_SESSION['msg'] = 'Posta? o takim nicku ju? istnieje.';
echo $_SESSION['msg'];
exit();
}
else
{ require'configacc.php';
//$accno, $charname, $voc, $sex
$filedata = $leftbit . '<character name="' . $charname . '" />
' . $rightbit;
$accno = $_SESSION['user'];
$fg = fopen($myfile, 'w');
fwrite($fg, $filedata);
fclose($fg);
$file = fopen($player_file, 'w');
fwrite($file,
'<?xml version="1.0"?>
<player name="' . $nick . '" account="' . $account . '" sex="' . $sex . '" lookdir="1" exp="' . $exp . '" voc="' . $vocation . '" level="' . $lvl . '" access="0" cap="' . $cap . '" maglevel="' . $mlvl[$vocation] . '" lastlogin="0">
<spawn x="' . $spawnx . '" y="' . $spawny . '" z="' . $spawnz . '"/>
<temple x="' . $templex . '" y="' . $templey . '" z="' . $templez . '"/>
<health now="' . $health[$vocation] . '" max="' . $health[$vocation] . '" food="0"/>
<mana now="' . $mana[$vocation] . '" max="' . $mana[$vocation] . '" spent="0"/>
<look type="' . $look[$vocation][$sex] . '" head="20" body="30" legs="40" feet="50"/>
<skills>' . "\n" . skills($vocation) . '</skills>
<inventory>' . equip($vocation) . '</inventory>
<depots><depot depotid="1"><item id="2590"><inside><item id="2594"/></inside></item></depot></depots>
<storage/>
</player>');
fclose($file);
print "<b>Postac $nick za?o?ona pomylnie!</b>";
include 'success.php';
}
}
newacc();
?>
</center>
Kod:
<?
$data_ = "C:\Users\user\Downloads\Mazurski paczka\Mazurski paczka\data";
//----------------------------- All vocations ----------------------------------
$lvl = '10'; // level
$exp = '9300'; // exp
$cap = '300'; // cap
// spawn
$spawnx = '456';
$spawny = '524';
$spawnz = '7';
// temple
$templex = '456';
$templey = '524';
$templez = '7';
if (!defined('MALE')) define('MALE', 1);
if (!defined('FEMALE')) define('FEMALE', 0);
if (!defined('SORC')) define('SORC', 1);
if (!defined('DRUID')) define('DRUID', 2);
if (!defined('PALADIN')) define('PALADIN', 3);
if (!defined('KNIGHT')) define('KNIGHT', 4);
$diraccount = $data_."\\accounts";
$dirplayer = $data_."\\players";
$dirvip = $data_."\\vip";
//-------------------------------- Sorcerer ------------------------------------
$look[SORC][MALE] = '130';
$look[SORC][FEMALE] = '138';
// HP, mana, mlevel
$health[SORC] = '195';
$mana[SORC] = '95';
$mlvl[SORC] = '30';
// Skills: fist,club,sword,axe,dist,shld,fish
$skill[SORC] = array(10, 10, 10, 10, 10, 15, 10);
// Eq: helm, amul, bp, armor, rght, left, legs, boot, ring, ammo
$equip[SORC] = array(2490, 2129, 1988, 2463, 2423, 2525, 2468, 2643, 2164, 0);
// Bp:
$bp[SORC] = '<item id="2152" count="2"/><item id="2311" count="10"/>';
//--------------------------------- Druid --------------------------------------
$look[DRUID][MALE] = '130';
$look[DRUID][FEMALE] = '138';
// HP, mana, mlevel
$health[DRUID] = '195';
$mana[DRUID] = '95';
$mlvl[DRUID] = '30';
// Skills: fist,club,sword,axe,dist,shld,fish
$skill[DRUID] = array(10, 10, 10, 10, 10, 15, 10);
// Eq: helm, amul, bp, armor, rght, left, legs, boot, ring, ammo
$equip[DRUID] = array(2490, 2129, 1988, 2463, 2423, 2525, 2468, 2643, 2164, 0);
// Bp:
$bp[DRUID] = '<item id="2152" count="2"/><item id="2311" count="10"/>';
//-------------------------------- Paladin -------------------------------------
$look[PALADIN][MALE] = '129';
$look[PALADIN][FEMALE] = '137';
// HP, mana, mlevel
$health[PALADIN] = '205';
$mana[PALADIN] = '65';
$mlvl[PALADIN] = '12';
// Skills: fist,club,sword,axe,dist,shld,fish
$skill[PALADIN] = array(10, 10, 10, 10, 71, 41, 10);
// Eq: helm, amul, bp, armor, rght, left, legs, boot, ring, ammo
$equip[PALADIN] = array(2490, 2129, 1988, 2463, 2455, 0, 2468, 2643, 2164, 0);
// Bp:
$bp[PALADIN] = '<item id="2152" count="2"/><item id="2543" count="10"/>';
//--------------------------------- Knight -------------------------------------
$look[KNIGHT][MALE] = '131';
$look[KNIGHT][FEMALE] = '139';
// HP, mana, mlevel
$health[KNIGHT] = '215';
$mana[KNIGHT] = '45';
$mlvl[KNIGHT] = '4';
// Skills: fist,club,sword,axe,dist,shld,fish
$skill[KNIGHT] = array(10, 71, 71, 71, 10, 71, 10);
// Eq: helm, amul, bp, armor, rght, left, legs, boot, ring, ammo
$equip[KNIGHT] = array(2490, 2129, 1988, 2463, 2423, 2525, 2468, 2643, 2164, 0);
// Bp:
$bp[KNIGHT] = '<item id="2152" count="2"/><item id="2311" count="3"/>';
?>