Quête en cours\n"; include("commonfunctions.php"); $file = fopen($irpg_qfile,"r"); $type=0; while ($line=fgets($file,1024)) { $arg = explode(" ",trim($line)); if ($arg[0] == "T") { unset($arg[0]); $text = implode(" ",$arg); } elseif ($arg[0] == "Y") { $type = $arg[1]; } elseif ($arg[0] == "P") { $p1[0] = $arg[1]; $p1[1] = $arg[2]; $p2[0] = $arg[3]; $p2[1] = $arg[4]; } elseif ($arg[0] == "S") { if ($type == 1) $time = $arg[1]; elseif ($type == 2) $stage = $arg[1]; } elseif ($arg[0] == "P1") { $player[1]['name'] = $arg[1]; if ($type == 2) { $player[1]['x'] = $arg[2]; $player[1]['y'] = $arg[3]; } } elseif ($arg[0] == "P2") { $player[2]['name'] = $arg[1]; if ($type == 2) { $player[2]['x'] = $arg[2]; $player[2]['y'] = $arg[3]; } } elseif ($arg[0] == "P3") { $player[3]['name'] = $arg[1]; if ($type == 2) { $player[3]['x'] = $arg[2]; $player[3]['y'] = $arg[3]; } } elseif ($arg[0] == "P4") { $player[4]['name'] = $arg[1]; if ($type == 2) { $player[4]['x'] = $arg[2]; $player[4]['y'] = $arg[3]; } } } if (!$type) { echo "
Désolé, il n'y a aucune quête actuellement.
\n"; } else { echo "Quête :".htmlentities(ucfirst($text)).".
\n"; if ($type == 1) { echo "Temps restant : ".duration($time-time()). "
\n"; } elseif ($type == 2) { if ($stage == 1) { echo "Destination actuelle : [$p1[0],$p1[1]]
\n"; } else { echo "Destination actuelle : [$p2[0],$p2[1]]
>\n"; } } for ($i=1;$i<=4;$i++) { echo "Participant $i : ".htmlentities($player[$i]['name']).
"
\n";
if ($type == 2) {
echo " Position : [".$player[$i]['x'].",".$player[$i]['y']."]
[Les participant sont en bleu et leur destination en rouge]
\n". "