Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. <head>
  2. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold" title="roboto">
  3. <script src="nui://game/ui/jquery.js" type="text/javascript"></script>
  4. <script>
  5. function addCommas(nStr) {
  6. nStr += '';
  7. var x = nStr.split('.');
  8. var x1 = x[0];
  9. var x2 = x.length > 1 ? '.' + x[1] : '';
  10. var rgx = /(\d+)(\d{3})/;
  11. while (rgx.test(x1)) {
  12. x1 = x1.replace(rgx, '$1' + '<span style="margin-left: 3px; margin-right: 3px;"/>' + '$2');
  13. }
  14. return x1 + x2;
  15. }
  16.  
  17. var moneyIcon = "$"
  18.  
  19. window.onload = function(e){
  20. // NUI Callback
  21. window.addEventListener('message', function(event){
  22. var item = event.data;
  23.  
  24. if(item.seticon == true)
  25. moneyIcon = item.icon;
  26. if(item.setmoney == true)
  27. document.getElementById("cash").innerHTML = "<div><font style='color: rgb(0, 125, 0); font-weight: 700; margin-right: 6px;'>" + moneyIcon + "</font>" + addCommas(item.money);
  28. if(item.addcash == true){
  29. $(".tiny").remove();
  30.  
  31. var element = $("<div class='tiny'>+<font style='color: rgb(0, 125, 0); font-weight: 700; margin-right: 6px;'>" + moneyIcon + "</font>"+addCommas(item.money)+"</div>")
  32. $("#money").append(element)
  33.  
  34. setTimeout(function(){
  35. $(element).fadeOut(600, function() { $(this).remove(); })
  36. }, 1000)
  37. }
  38. if(item.removecash == true){
  39. $(".tiny").remove();
  40.  
  41. var element = $("<div class='tiny'>-<font style='color: rgb(250, 0, 0); font-weight: 700; margin-right: 6px;'>" + moneyIcon + "</font>"+addCommas(item.money)+"</div>")
  42. $("#money").append(element)
  43.  
  44. setTimeout(function(){
  45. $(element).fadeOut(600, function() { $(this).remove(); })
  46. }, 1000)
  47. }
  48. if(item.removeStartWindow == true){
  49. $("#starter").remove();
  50. }
  51. if(item.setDisplay == true){
  52. $("#money").css('opacity', item.display)
  53. }
  54. })
  55. }
  56. </script>
  57.  
  58. <style>
  59. @font-face {
  60. font-family: pcdown;
  61. src: url(pdown.ttf);
  62. }
  63. .tiny {
  64. font-size: 29px;
  65. position: absolute; right: 10;
  66. }
  67. #money {
  68. font-family: pcdown;
  69. font-size: 35px;
  70. color: white;
  71. padding: 4px;
  72. text-shadow:
  73. -1px -1px 0 #000,
  74. 1px -1px 0 #000,
  75. -1px 1px 0 #000,
  76. 1px 1px 0 #000;
  77. }
  78.  
  79. #container {
  80. position: absolute;
  81. top: 40; right: 40;
  82. }
  83. </style>
  84. </head>
  85.  
  86. <body>
  87. <div id="starter" style="font-family: 'roboto'; color: white; position: absolute; left: 20%; top: 5%; width: 60%; background: rgba(40, 40, 40, 0.8)">
  88.  
  89. </div>
  90. <div id="container">
  91. <div id="money">
  92.  
  93. <div id="cash"/>
  94. </div>
  95. </div>
  96. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement