Hvad er der i vejen med nedenstående kode? Fil- og mapperettighederne er i orden, sååå..
Hjælp mig
Snøft
<
<
<
$randrace = mt_rand(1, 4);
$randhero = mt_rand(1, 4);
$randspeak = mt_rand(1, 2);
$racearray = array('hmn','orc','ne','ud');
$hmnheroarray = array('Mountain King,hmk','Blood Mage,hbm','Archmage,ha','Paladin,hp');
$orcheroarray = array('Shadow Hunter,osh','Tauren Chieftain,otc','Far Seer,ofs','Blademaster,obm');
$neheroarray = array('Demon Hunter,ndh','Priestess of the Moon,npotm','Keeper of the Grove,nkotg','Warden,nw');
$udheroarray = array('Undead Knight,uuk','Dread Lord,udl','Lich,ul','Crypt Lord,ucl');
function makeBox() {
switch( $racearray[$randrace] ) {
case "hmn":
$race = "hmn";
$heroname = explode(",",$hmnheroarray[$randhero]);
$heroname = $heroname[1];
$filename = $heroname[2];
break;
case "orc":
$race = "orc";
$heroname = explode(",",$orcheroarray[$randhero]);
$heroname = $heroname[1];
$filename = $heroname[2];
break;
case "ne":
$race = "ne";
$heroname = explode(",",$neheroarray[$randhero]);
$heroname = $heroname[1];
$filename = $heroname[2];
break;
case "ud":
$race = "ud";
$heroname = explode(",",$udheroarray[$randhero]);
$heroname = $heroname[1];
$filename = $heroname[2];
break;
default:
echo "Error happened!?";
}
$filename = "/speak/" . $filename . ".txt";
$speak = file($filename);
$speak = $speak[$randspeak];
return(array($speak,$heroname,$race));
}
>
>
>
MVH. qff