Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze skryptem php
2late4u
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 31.10.2010

Ostrzeżenie: (0%)
-----


Witam, mam problem ze skryptem który w założeniach miał wyświetlać obecny status serwera gry counter strike.
Skrypt jednak jakby nie łączył się z serwerem ponieważ pokazuje informację która ma być zwracana w przypadku offline'a.
co widać w praktyce: http://www.autoradprofit.bydgoszcz.pl/stat...72.37.178:27015
ja dopiero co raczkuje w php więc proszę o pomoc.
załączam całość w rar'ku
z góry dzięki.

http://www.speedyshare.com/files/24953063/status.rar
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Fifi209
post
Post #2





Grupa: Zarejestrowani
Postów: 4 655
Pomógł: 556
Dołączył: 17.03.2009
Skąd: Katowice

Ostrzeżenie: (0%)
-----


Wrzuć skrypt na forum - to jest w Twoim interesie.
Wątpię, że ktoś będzie pobierał nieznane pliki.
Go to the top of the page
+Quote Post
2late4u
post
Post #3





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 31.10.2010

Ostrzeżenie: (0%)
-----


Proszę bardzo:
  1. <?php
  2. require_once('status/class.hlsocket.php');
  3. define('TEMPESTA', 'status/fonts/tempesta.ttf');
  4. define('TAHOMA', 'status/fonts/tahoma.ttf');
  5. define('VERDANA', 'status/fonts/verdana.ttf');
  6. define('TAHOMA_BOLD', 'status/fonts/tahoma_bold.ttf');
  7. $server = $_GET['server'];
  8. if (isset($server) && !empty($server)) {
  9. list($ip, $port) = explode(":", $server);
  10. $s1_status = new HLSocket($ip, $port);
  11. $s1_info = $s1_status->details();
  12. if($s1_info['hostname']=="")
  13. {
  14. $hostname = 'Serwer '.$server.' jest OFFLINE';
  15. $players = "x";
  16. $playersmax = "x";
  17. $map = "OFFLINE";
  18. }
  19. else
  20. {
  21. $hostname = $s1_info['hostname'];
  22. $players = $s1_info['players'];
  23. $playersmax = $s1_info['max'];
  24. $map = $s1_info['map'];
  25. }
  26. $im = imagecreatefrompng("status/background.png");
  27. $white = imagecolorallocate($im, 255, 255, 255);
  28. $info = $server ." ". $players ." / ". $playersmax ." ". $map;
  29. imagettftext($im, 7, 0, 30, 10, $white, VERDANA, $hostname);
  30. imagettftext($im, 7, 0, 30, 21, $white, VERDANA, $info);
  31.  
  32. } else {
  33. $im = imagecreatefrompng("status/background.png");
  34. $white = imagecolorallocate($im, 255, 255, 255);
  35. $info = "123.456:27015 31 / 32 de_inferno";
  36. imagettftext($im, 7, 0, 30, 10, $white, VERDANA, "test @ freefrags.pl");
  37. imagettftext($im, 7, 0, 30, 21, $white, VERDANA, $info);
  38. }
  39.  
  40. header('Content-type: image/png');
  41. imagepng($im);
  42. imagedestroy($im);
  43. ?>


Ten post edytował 2late4u 2.11.2010, 11:59:29
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 7.10.2025 - 08:47