ashais13 Posted December 21, 2006 Report Share Posted December 21, 2006 kaa lai palaiz so samp monitoru man vinjs uzraadas saadi ko es daru nepareizi seit monis kaa man vinjs izskatas <html> <head> <title>SA:MP Server Query Script</title> <style type="text/css"> body { font-family: verdana; font-size: 11px; } td { font-family: verdana; font-size: 11px; } </style> </head> <body bgcolor="#1B304B" text="#EEEEEE"> <br><center><b><font color="#ffffff">SA:MP Server Query Script</font></b></center><br><br> <table width="350" bgcolor="#000000" cellpadding="4" cellspacing="1" align="center"> <? // if ($_GET['ip']) $ip = $_GET['ip']; // if ($_GET['port']) $port = $_GET['port']; if (!isset($ip)) $ip = '83.149.98.25'; if (!isset($port)) $port = 7777; $fp = fsockopen('udp://' . $ip, $port, $errno, $errstr); if (!$fp) { echo "<tr><td bgcolor=\"#2B5486\">Socket Error: $errno - $errstr</td></tr>\n"; } else { $packet = 'SAMP'; $packet .= chr(strtok($ip, '.')); $packet .= chr(strtok('.')); $packet .= chr(strtok('.')); $packet .= chr(strtok('.')); $packet .= chr($port & 0xFF); $packet .= chr($port >> 8 & 0xFF); fwrite($fp, $packet.'i'); fread($fp, 11); $is_passworded = ord(fread($fp, 1)); $plr_count = ord(fread($fp, 2)); $max_plrs = ord(fread($fp, 2)); $strlen = ord(fread($fp, 4)); $hostname = fread($fp, $strlen); $strlen = ord(fread($fp, 4)); $gamemode = fread($fp, $strlen); $strlen = ord(fread($fp, 4)); $mapname = fread($fp, $strlen); echo ' <tr><td bgcolor="#2B5486" colspan="2" align="center"><b>' . $hostname . '</b></td></tr>'."\n"; echo ' <tr><td bgcolor="#2B5486" width="100">Players: </td><td bgcolor="#2B5486" width="250">' . $plr_count . ' / ' . $max_plrs . '</td></tr>'."\n"; echo ' <tr><td bgcolor="#2B5486">GameMode: </td><td bgcolor="#2B5486">' . $gamemode . '</td></tr>'."\n"; echo ' <tr><td bgcolor="#2B5486">MapName: </td><td bgcolor="#2B5486">' . $mapname . '</td></tr>'."\n"; if ($is_passworded) { echo ' <tr><td bgcolor="#2B5486">Passworded: </td><td bgcolor="#2B5486">Yes</td></tr>'."\n"; } else { echo ' <tr><td bgcolor="#2B5486">Passworded: </td><td bgcolor="#2B5486">No</td></tr>'."\n"; } fwrite($fp, $packet.'c'); fread($fp, 11); $plr_count = ord(fread($fp, 2)); if ($plr_count > 0) { echo ' </table><br>'."\n"; echo ' <table width="350" bgcolor="#000000" cellpadding="4" cellspacing="1" align="center">'."\n"; echo ' <tr><td bgcolor="#2B5486" colspan="2" align="center"><b>Players:</b></td></tr>'."\n"; echo ' <tr><td bgcolor="#2B5486" align="center" width="250"><b>Player</b></td><td bgcolor="#2B5486" align="center" width="100"><b>Score</b></td></tr>'."\n"; for ($i=0; $i<$plr_count; $i++) { $strlen = ord(fread($fp, 1)); $plrname = fread($fp, $strlen); $score = samp_getLong(fread($fp, 4)); echo ' <tr><td bgcolor="#2B5486">' . $plrname . '</td><td bgcolor="#2B5486">' . $score . '</td></tr>'."\n"; } } fclose($fp); } ?> </table><br> <center><small>© 2006 SA:MP Team. All rights reserved.</small></center> </body> </html> <? function samp_getLong($dat) { $num=0; if ((ord(substr($dat,3,1)) & 128) > 0) { for ($i=0; $i<strlen($dat); $i++) { $num-=((255-ord(substr($dat,$i,1))) << 8*$i); } $num--; } else { for ($i=0; $i<strlen($dat); $i++) { $num+=(ord(substr($dat,$i,1)) << 8*$i); } } return $num; } Link to comment Share on other sites More sharing options...
andrisp Posted December 21, 2006 Report Share Posted December 21, 2006 1) Izmanto paste.php.lv, 2) Nomaini visus <? uz <?php vai arī iekš php.ini ieslēdz short tags. Link to comment Share on other sites More sharing options...
ashais13 Posted December 21, 2006 Author Report Share Posted December 21, 2006 (edited) nekas nemainas :( un tagad man vel kautkadu error met virsu Edited December 21, 2006 by ashais13 Link to comment Share on other sites More sharing options...
andrisp Posted December 21, 2006 Report Share Posted December 21, 2006 (edited) Ko tu tieši izdarīji ? Ja met php erroru, tad mainījās gan - skripts izpildās. Protams, vai pareizi - tas ir cits jautājums. Edited December 21, 2006 by andrisp Link to comment Share on other sites More sharing options...
ashais13 Posted December 21, 2006 Author Report Share Posted December 21, 2006 ieliku tos <?php Link to comment Share on other sites More sharing options...
hackerman Posted December 21, 2006 Report Share Posted December 21, 2006 Arī php.ini izlaboji? Link to comment Share on other sites More sharing options...
ashais13 Posted December 21, 2006 Author Report Share Posted December 21, 2006 (edited) nezinu kur tads atroadas :D man jau masjaslapa uz e107 nezinu vai pat man tads php.ini ir Edited December 21, 2006 by ashais13 Link to comment Share on other sites More sharing options...
andrisp Posted December 21, 2006 Report Share Posted December 21, 2006 hackerman, ja viņš izlaboja <? uz <?php, tad viņam php.ini failā izmaiņas nav jāveic. Link to comment Share on other sites More sharing options...
hackerman Posted December 21, 2006 Report Share Posted December 21, 2006 (edited) :D Edited December 21, 2006 by hackerman Link to comment Share on other sites More sharing options...
ashais13 Posted December 21, 2006 Author Report Share Posted December 21, 2006 doamaji te C:\WINDOWS ??? Link to comment Share on other sites More sharing options...
ashais13 Posted December 21, 2006 Author Report Share Posted December 21, 2006 nu davaj :( Link to comment Share on other sites More sharing options...
hackerman Posted December 21, 2006 Report Share Posted December 21, 2006 (edited) Pateica, ka ja izlaboji to vietu, tad nevajag neko labot tajā ini failā... P.S. Kad agrāk ķēpājos ar php-fusion, man viņš nestrādāja pilnībā =/ Viņam kkas tur čakarējās... Pārinstalēju serveri uz appserv (es iesaku appserv-win32-2.5.6 vai jaunāku ) :) Bet es negalvoju, ka vaina ir serverī... Atceros ka esmu izmēģinājis visus serverus...Gan xapm, wapm, appserv un t.t. Appserv, ja nokonfigurē viņš ir labs :) Edited December 21, 2006 by hackerman Link to comment Share on other sites More sharing options...
andrisp Posted December 21, 2006 Report Share Posted December 21, 2006 (edited) ashais13, tu ar galvu draudzējaties ? Tev problēma ir skriptā. Liec to php.ini mierā. PS. Par Start -> Search neesi dzirdējis ? PS2. e107 ir būvēts uz PHP bāzes. Tas nav kaut kas neatkarīgs no PHP. Tātad php.ini tev ir jābūt. PS3. hackerman, visi tie "serveri" ir viens un tas pats - apache + php + vēl kaut kas. Atšķirība ir tikai konfigurācijās un kā tas viss ir sakabināts kopā. Edited December 21, 2006 by andrisp Link to comment Share on other sites More sharing options...
ashais13 Posted December 21, 2006 Author Report Share Posted December 21, 2006 hmm tad ka lai vinju palaizu man ir wamp :( Link to comment Share on other sites More sharing options...
ashais13 Posted December 21, 2006 Author Report Share Posted December 21, 2006 da paski ko lai es tada gadijuma daru??? Link to comment Share on other sites More sharing options...
Recommended Posts