Also...es scheint, als hätt ich mir heute morgen meine charstat was geschrottet..woran es liegt weiss ich end..jedenfalls kam irgendwann..nach endlosen fehlern, das hier
http://www.barath-dur.ch/efl
die charstat sieht momentan so aus
[php]function charstats(){
global $session,$playermount;
$u =& $session[user];
if ($session[loggedin]){
$u['hitpoints']=round($u['hitpoints'],0);
$u['experience']=round($u['experience'],0);
$u['maxhitpoints']=round($u['maxhitpoints'],0);
$spirits=array("-6"=>"Wiedererweckt","-2"=>"Sehr schlecht","-1"=>"Schlecht","0"=>"Normal","1"=>"Gut","2"=>"Sehr gut");
if ($u[alive]){ }else{ $spirits[$u[spirits]] = "TOT"; }
reset($session[bufflist]);
$atk=$u[attack];
$def=$u[defence];
while (list($key,$val)=each($session[bufflist])){
$buffs.=appoencode("`#$val[name] `7($val[rounds] Runden übrig)`n",true);
if (isset($val[atkmod])) $atk *= $val[atkmod];
if (isset($val[defmod])) $def *= $val[defmod];
}
$atk = round($atk, 2);
$def = round($def, 2);
$atk = ($atk == $u[attack] ? "`^" : ($atk > $u[attack] ? "`@" : "`$")) . "`b$atk`b`0";
$def = ($def == $u[defence] ? "`^" : ($def > $u[defence] ? "`@" : "`$")) . "`b$def`b`0";
if (count($session[bufflist])==0){
$buffs.=appoencode("`^Keine`0",true);
}
$charstat=appoencode(templatereplace("statstart")
.templatereplace("stathead",array("title"=>"Vital Info"))
.templatereplace("statrow",array("title"=>"Name","value"=>appoencode($u[name],false)))
,true);
if ($session['user']['alive']){
$charstat.=appoencode(
templatereplace("statrow",array("title"=>"Lebenspunkte","value"=>"$u[hitpoints]`0/$u[maxhitpoints]".grafbar($u[maxhitpoints],$u[hitpoints])))
.templatereplace("statrow",array("title"=>"Runden","value"=>$u['turns']))
,true);
}else{
$charstat.=appoencode(
templatereplace("statrow",array("title"=>"Seelenpunkte","value"=>"$u[soulpoints]".grafbar((5*$u[level]+50),$u[soulpoints])))
.templatereplace("statrow",array("title"=>"Foltern","value"=>$u['gravefights']))
.templatereplace("statrow",array("title"=>"Gefallen","value"=>$u['deathpower']))
,true);
}
$charstat.=appoencode(
templatereplace("statrow",array("title"=>"Stimmung","value"=>"`b".$spirits[(string)$u['spirits']]."`b"))
.templatereplace("statrow",array("title"=>"Charmepunkte","value"=>$u['charm']))
.templatereplace("statrow",array("title"=>"Level","value"=>"`b".$u['level']."`b"))
.($session['user']['alive']?
templatereplace("statrow",array("title"=>"Angriff","value"=>$atk))
.templatereplace("statrow",array("title"=>"Verteidigung","value"=>$def))
:
templatereplace("statrow",array("title"=>"Psyche","value"=>10 + round(($u['level']-1)*1.5)))
.templatereplace("statrow",array("title"=>"Geist","value"=>10 + round(($u['level']-1)*1.5)))
)
.templatereplace("statrow",array("title"=>"Edelsteine","value"=>$u['gems']))
.templatereplace("stathead",array("title"=>"Weitere Infos"))
,true);
$charstat.=appoencode(
templatereplace("statrow",array("title"=>"Gold","value"=>$u['gold']))
.templatereplace("statrow",array("title"=>"Erfahrung","value"=>expbar()))
.templatereplace("statrow",array("title"=>"Waffe","value"=>$u['weapon']))
.templatereplace("statrow",array("title"=>"Rüstung","value"=>$u['armor']))
,true);
if (getsetting("dispnextday",0)){
$time = gametime();
$tomorrow = strtotime(date("Y-m-d H:i:s",$time)." + 1 day");
$tomorrow = strtotime(date("Y-m-d 00:00:00",$tomorrow));
$secstotomorrow = $tomorrow-$time;
$realsecstotomorrow = round($secstotomorrow / (int)getsetting("daysperday",4));
$charstat.=appoencode(templatereplace("statrow",array("title"=>"Nächster Tag","value"=>date("G\\h, i\\m, s\\s \\",strtotime("1980-01-01 00:00:00 + $realsecstotomorrow seconds")))),true);
}
if (!is_array($session[bufflist])) $session[bufflist]=array();
$charstat.=appoencode(templatereplace("statbuff",array("title"=>"Aktionen","value"=>$buffs)),true);
$charstat.=appoencode(templatereplace("statend"),true);
return $charstat;
}else{
//return "Your character info will appear here after you've logged in.";
//$sql = "SELECT name,alive,location,sex,level,laston,loggedin,lastip,uniqueid FROM accounts WHERE locked=0 AND loggedin=1 ORDER BY level DESC";
$sql = "SELECT accounts.laston,
accounts.name,
accounts.acctid,
accounts.level,
accounts.loggedin,
accounts.locked,
accounts.superuser
FROM accounts
WHERE accounts.superuser = 0 AND accounts.laston>'".date("Y-m-d H:i:s",time()-getsetting("LOGINTIMEOUT",900))."' AND accounts.loggedin = 1 AND accounts.locked=0 ORDER BY accounts.level DESC";
$result = db_query($sql) or die(sql_error($sql));
$count = db_num_rows($result);
$ret.=appoencode("`&`b$count Krieger Online:`b`n");
while ($row = db_fetch_assoc($result)){
$ret.=appoencode("`^$row[name]`n");
$onlinecount++;
}
if ($onlinecount==0) $ret.=appoencode("`i`0Es sind keine Krieger Online!`n`n`i");
$sql = "SELECT accounts.laston,
accounts.name,
accounts.acctid,
accounts.level,
accounts.loggedin,
accounts.locked,
accounts.superuser
FROM accounts
WHERE accounts.superuser = 1 AND accounts.laston>'".date("Y-m-d H:i:s",time()-getsetting("LOGINTIMEOUT",900))."' AND accounts.loggedin = 1 AND accounts.locked=0 ORDER BY accounts.level DESC";
$result1 = db_query($sql) or die(sql_error($sql));
$count1 = db_num_rows($result);
$ret.=appoencode("`&`b$count Krieger Online:`b`n");
while ($row = db_fetch_assoc($result1)){
$ret.=appoencode("`^$row[name]`n");
$onlinecount++;
}
if ($onlinecount1==0) $ret.=appoencode("`i`0Es sind keine Krieger Online!`n`n`i");
$sql = "SELECT accounts.laston,
accounts.name,
accounts.acctid,
accounts.level,
accounts.loggedin,
accounts.locked,
accounts.superuser
FROM accounts
WHERE accounts.superuser = 2 AND accounts.laston>'".date("Y-m-d H:i:s",time()-getsetting("LOGINTIMEOUT",900))."' AND accounts.loggedin = 1 AND accounts.locked=0 ORDER BY accounts.level DESC";
$result2 = db_query($sql) or die(sql_error($sql));
$count2 = db_num_rows($result);
$ret.=appoencode("`&`b$count2 Kommandanten der Stadtwache Online:`b`n");
while ($row = db_fetch_assoc($result)){
$ret.=appoencode("`^$row[name]`n");
$onlinecount3++;
}
if ($onlinecount2==0) $ret.=appoencode("`iEs sind keine Kommandanten der Stadtwache Online!`n`n`i");
$sql = "SELECT
accounts.laston,
accounts.name,
accounts.acctid,
accounts.level,
accounts.loggedin,
accounts.locked,
accounts.superuser
FROM accounts
WHERE accounts.superuser = 3 AND accounts.laston>'".date("Y-m-d H:i:s",time()-getsetting("LOGINTIMEOUT",900))."' AND accounts.loggedin = 1 AND accounts.locked=0 ORDER BY accounts.level DESC";
$result3 = db_query($sql) or die(sql_error($sql));
$count3 = db_num_rows($result3);
if($count3==0) $admins = ('Wesen der Schöpfung');
else $admins = ($count2<=1?"Wesen der Schöpfung":"Wesen der Schöpfung");
$ret.=appoencode("`n`0`b$count2 ".$admins." Online:`b`n");
while ($row = db_fetch_assoc($result)){
$ret.=appoencode("`^$row[name]`n");
$onlinecount3++;
}
if ($onlinecount3==0) $ret.=appoencode("`i`0Es sind keine Wesen der Schöpfung Online`i`n");
$ret.=(getsetting("maxonline",10)>0?grafbar(getsetting("maxonline",10),(getsetting("maxonline",10)-$onlinecount),180):"");
return $ret;
}
}
[/php]