Mastercz

Untitled

May 14th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php
  2. // Livemap Größe
  3. $Xmax = 1024;
  4. $Ymax = 1024;
  5.  
  6. // Konstante
  7. $X1 = -2140;
  8. $Y1 = 2010;
  9. $X2 = 1428;
  10. $Y2 = -1038;
  11.  
  12. $password = "coolesau";
  13.  
  14. if ($_GET['blip'] == 1)
  15. if ($_GET['password'] != $password) exit;
  16. if ($_GET['clear'] == 1)
  17. $im = imagecreatefromjpeg('map_blank.jpg');
  18. else
  19. $im = imagecreatefromjpeg('map_spieler3.jpg');
  20.  
  21. imagealphablending($im, true);
  22. for ($i = 0; $i < count($_GET['Px']); $i++)
  23. {
  24. $X = (float) $_GET['Px'][$i];
  25. $Y = (float) $_GET['Py'][$i];
  26. $id = (int) $_GET['blip'][$i];
  27.  
  28. $Xcoord = $Xmax * ($X - $X1) / ($X2 - $X1);
  29. $Ycoord = $Ymax * ($Y - $Y1) / ($Y2 - $Y1);
  30.  
  31. $blip = imagecreatefrompng('blips/'.$id.'.png');
  32. $size = getimagesize('blips/'.$id.'.png');
  33. imagecopy($im, $blip, $Xcoord - $size[0]/2, $Ycoord - $size[1]/2, 0, 0, $size[0], $size[1]);
  34. }
  35.  
  36. imagejpeg($im, "map_spieler3.jpg", 100);
  37. imagedestroy($im);
  38.  
  39. if ($_GET['blip'] == 2)
  40. {
  41. if ($_GET['password'] != $password) exit;
  42. if ($_GET['clear'] == 1)
  43. $im = imagecreatefromjpeg('map_blank.jpg');
  44. else
  45. $im = imagecreatefromjpeg('map_fahrzeuge.jpg');
  46.  
  47. imagealphablending($im, true);
  48. for ($i = 0; $i < count($_GET['Cx']); $i++)
  49. {
  50. $X = (float) $_GET['Cx'][$i];
  51. $Y = (float) $_GET['Cy'][$i];
  52. $id = (int) $_GET['blip'][$i];
  53.  
  54. $Xcoord = $Xmax * ($X - $X1) / ($X2 - $X1);
  55. $Ycoord = $Ymax * ($Y - $Y1) / ($Y2 - $Y1);
  56.  
  57. $blip = imagecreatefrompng('blips/'.$id.'.png');
  58. $size = getimagesize('blips/'.$id.'.png');
  59. imagecopy($im, $blip, $Xcoord - $size[0]/2, $Ycoord - $size[1]/2, 0, 0, $size[0], $size[1]);
  60. }
  61.  
  62. imagejpeg($im, "map_fahrzeuge.jpg", 100);
  63. imagedestroy($im);
  64. }
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment