Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script type="text/javascript" src="jquery-3.2.1.min.js"></script>
  5. </head>
  6. <body>
  7. <style type="text/css">
  8. body {
  9. background: url(images/radar.png) no-repeat;
  10. width: 1000px;
  11. height: 1000px;
  12. background-size: 1000px 1000px;
  13. }
  14.  
  15. #alert {
  16. position: fixed;
  17. color: #FFF;
  18. font-size: 14pt;
  19. font-weight: bold;
  20. font-family: "Arial Black";
  21. }
  22.  
  23. #cp {
  24. width: 16px;
  25. height: 16px;
  26. border-radius: 50%;
  27. background: #CC0000;
  28. position: absolute;
  29. text-align: center;
  30. }
  31.  
  32. #CPs {
  33. position: fixed;
  34. bottom: 20px;
  35. right: 20px;
  36. color: #FFF;
  37. font-size: 14pt;
  38. font-weight: bold;
  39. font-family: "Arial Black";
  40. }
  41. </style>
  42. <script type="text/javascript">
  43. $( document ).on( "mousemove", function( event ) { //dab
  44. var x = event.pageX;
  45. x *= 6;
  46. x -= 3000;
  47. var y = event.pageY;
  48. y *= 6;
  49. y -= 3000;
  50. if(y < 0) {
  51. y = Math.abs(y);
  52. }
  53. else if(y > 1)
  54. y = -y;
  55.  
  56. $( "#alert" ).html( "pageX: " + x + "<br>pageY: " + y);
  57. });
  58.  
  59. var nextID = 0;
  60.  
  61. $("body").click(function(){
  62. var x = event.pageX;
  63. var y = event.pageY;
  64. $("body").append("<div id='cp' style='left: " + x + "px; top: " + y + "px'>" + nextID + "</div>");
  65. x *= 6;
  66. x -= 3000;
  67. y *= 6;
  68. y -= 3000;
  69. if(y < 0) {
  70. y = Math.abs(y);
  71. }
  72. else if(y > 1)
  73. y = -y;
  74. $("#CPs #textarea").append("\n\nMapAndreas_FindZ_For2DCoord(" + x + ", " + y + ", GameRaceCP[" + nextID + "][cpZ]);\nGameRaceCP[" + nextID + "][cpX] = " + x + ";\nGameRaceCP[" + nextID + "][cpY] = " + y + ";");
  75. $("#CPsql #textarea").append("\nINSERT INTO raceCPS SET cpid = " + nextID + ", x = " + x + ", y = " + y + ";");
  76. nextID += 1;
  77. });
  78. </script>
  79. <div id="alert">nun</div>
  80. <div id="CPs"><textarea id="textarea" rows="16" cols="100"></textarea></div>
  81. </body>
  82. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement