Advertisement
Mister_Stefan

2077UI (Onetap)

Feb 9th, 2021
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********************************************
  2. *
  3. *             Cyberpunk 2077 UI
  4. *           Create by Robonyantame  https://www.onetap.com/members/robonyantame.103584
  5. *           Create Date:2020/12/21
  6. *                 18:02:35
  7. *        Fix By XieShenDaDa [zhende] https://www.onetap.com/members/xieshendada.176/
  8. *
  9. //-----------------------------------------\\
  10. *
  11. *                  Thanks:
  12. *         tilestra <- Account banning
  13. *        BetterUI and Better Colors API
  14. *
  15. ********************************************/
  16.  
  17. //==========================================================================================================\\
  18. //Menu
  19. //------------------------------
  20. //Add New Table
  21. UI.AddSubTab(["Visuals", "SUBTAB_MGR"], "Cyberpunk");
  22.  
  23. UI.AddSliderInt(["Visuals", "Cyberpunk", "Cyberpunk"], ">>-  Cyberpunk 2077 UI  -<<", 0, 0);
  24. UI.AddSliderInt(["Visuals", "Cyberpunk", "Cyberpunk"], ">>-  Create by Robonyantame  -<<", 0, 0);
  25.  
  26. UI.AddMultiDropdown(["Visuals", "Cyberpunk", "Cyberpunk"],"Enable UI",["Health_Armor","Weapon"]);
  27.  
  28. //Health and Armor Render Coordinates
  29. UI.AddSliderInt(["Visuals", "Cyberpunk", "Cyberpunk"], "Health_Armor_X", 0, Render.GetScreenSize()[0]);
  30. UI.AddSliderInt(["Visuals", "Cyberpunk", "Cyberpunk"], "Health_Armor_Y", 0, Render.GetScreenSize()[1]);
  31.  
  32. //Weapon Render Coordinates
  33. UI.AddSliderInt(["Visuals", "Cyberpunk", "Cyberpunk"], "Weapon_X", 0, Render.GetScreenSize()[0]);
  34. UI.AddSliderInt(["Visuals", "Cyberpunk", "Cyberpunk"], "Weapon_Y", 0, Render.GetScreenSize()[1]);
  35.  
  36. //FuCk YoU :)
  37. UI.SetEnabled(["Config", "Cheat", "General", "RAGE QUIT"], 0)
  38. //==========================================================================================================\\
  39.  
  40. //==========================================================================================================\\
  41. //API and Library
  42. //------------------------------
  43.  
  44. //weapon icon
  45. function get_icon(a) {
  46.     var letter = ""
  47.     switch (a) {
  48.         case "desert eagle":
  49.             letter = "A"
  50.             break
  51.         case "dual berettas":
  52.             letter = "B"
  53.             break
  54.         case "five seven":
  55.             letter = "E"
  56.             break
  57.         case "glock 18":
  58.             letter = "C"
  59.             break
  60.         case "ak 47":
  61.             letter = "W"
  62.             break
  63.         case "aug":
  64.             letter = "U"
  65.             break
  66.         case "awp":
  67.             letter = "Z"
  68.             break
  69.         case "famas":
  70.             letter = "R"
  71.             break
  72.         case "m249":
  73.             letter = "g"
  74.             break
  75.         case "g3sg1":
  76.             letter = "X"
  77.             break
  78.         case "galil ar":
  79.             letter = "Q"
  80.             break
  81.         case "m4a4":
  82.             letter = "S"
  83.             break
  84.         case "m4a1 s":
  85.             letter = "T"
  86.             break
  87.         case "mac 10":
  88.             letter = "K"
  89.             break
  90.         case "p2000":
  91.             letter = "E"
  92.             break
  93.         case "mp5 sd":
  94.             letter = "N"
  95.             break
  96.         case "ump 45":
  97.             letter = "L"
  98.             break
  99.         case "xm1014":
  100.             letter = "b"
  101.             break
  102.         case "pp bizon":
  103.             letter = "M"
  104.             break
  105.         case "mag 7":
  106.             letter = "d"
  107.             break
  108.         case "negev":
  109.             letter = "f"
  110.             break
  111.         case "sawed off":
  112.             letter = "c"
  113.             break
  114.         case "tec 9":
  115.             letter = "H"
  116.             break
  117.         case "zeus x27":
  118.             letter = "h"
  119.             break
  120.         case "p250":
  121.             letter = "F"
  122.             break
  123.         case "mp7":
  124.             letter = "N"
  125.             break
  126.         case "mp9":
  127.             letter = "O"
  128.             break
  129.         case "nova":
  130.             letter = "e"
  131.             break
  132.         case "p90":
  133.             letter = "P"
  134.             break
  135.         case "scar 20":
  136.             letter = "Y"
  137.             break
  138.         case "sg 553":
  139.             letter = "V"
  140.             break
  141.         case "ssg 08":
  142.             letter = "a"
  143.             break
  144.         case "knife":
  145.             letter = "1"
  146.             break
  147.         case "flashbang":
  148.             letter = "i"
  149.             break
  150.         case "high explosive grenade":
  151.             letter = "j"
  152.             break
  153.         case "smoke grenade":
  154.             letter = "k"
  155.             break
  156.         case "molotov":
  157.             letter = "l"
  158.             break
  159.         case "decoy grenade":
  160.             letter = "m"
  161.             break
  162.         case "incendiary grenade":
  163.             letter = "n"
  164.             break
  165.         case "c4 explosive":
  166.             letter = "o"
  167.             break
  168.         case "usp s":
  169.             letter = "G"
  170.             break
  171.         case "cz75 auto":
  172.             letter = "I"
  173.             break
  174.         case "r8 revolver":
  175.             letter = "J"
  176.             break
  177.  
  178.         case "bayonet":
  179.             letter = "1"
  180.             break
  181.         case "flip knife":
  182.             letter = "2"
  183.             break
  184.         case "gut knife":
  185.             letter = "3"
  186.             break
  187.         case "karambit":
  188.             letter = "4"
  189.             break
  190.         case "m9 bayonet":
  191.             letter = "5"
  192.             break
  193.         case "huntsman knife":
  194.             letter = "6"
  195.             break
  196.         case "bowie knife":
  197.             letter = "7"
  198.             break
  199.         case "butterfly knife":
  200.             letter = "8"
  201.             break
  202.         case "shadow daggers":
  203.             letter = "9"
  204.             break
  205.         case "falchion knife":
  206.             letter = "0"
  207.             break
  208.         case "ursus knife":case "navaja knife":case "stiletto knife":case "skeleton knife":case "nomad knife":case "survival knife":case "paracord knife":case "classic knife":case "talon knife":
  209.             letter = "1"
  210.             break
  211.         default:
  212.             letter = ""
  213.             break
  214.     }
  215.     return letter
  216. }
  217.  
  218. // I am learning how to use functions and return
  219. // So the code will look bad
  220. // Sorry! :3
  221. function def_font(size){
  222.     var font = Render.GetFont("bahnschrift.ttf",size,true);
  223.     return font;
  224. }
  225.  
  226. function Weapon_font(size){
  227.     var font = Render.GetFont("astriumwep.ttf",size,true);
  228.     return font;
  229. }
  230.  
  231. function Visibility(variable,Visibility){
  232.     if(Visibility == true){
  233.         Visibility = 1
  234.     }
  235.     if(Visibility == false){
  236.         Visibility = 0
  237.     }
  238.  
  239.     var enable = UI.SetEnabled(["Visuals", "Cyberpunk", "Cyberpunk", variable], Visibility);
  240.     return enable;
  241. }
  242.  
  243. //BetterUI and Better Colors API
  244. //Dragging properties Variable.
  245. var area = {};
  246.  
  247. area.new = function(x, y, w, h)
  248. {
  249.     const area_info_t = {
  250.         x: x,
  251.         y: y,
  252.         x2: x + w,
  253.         y2: y + h
  254.     };
  255.  
  256.     return area_info_t;
  257. }
  258.  
  259. area.in_bounds = function(area, point)
  260. {
  261.     return point.x > area.x && point.x < area.x2 && point.y > area.y && point.y < area.y2;
  262. }
  263.  
  264. var point = {};
  265.  
  266. point.new = function(x, y)
  267. {
  268.     const point_info_t = {
  269.         x: x,
  270.         y: y
  271.     };
  272.  
  273.     return point_info_t;
  274. }
  275.  
  276. //==========================================================================================================\\
  277.  
  278. //==========================================================================================================\\
  279. //Render Function
  280. //------------------------------
  281.  
  282. //Health and Armor
  283. function Health_Armor(){
  284.  
  285.     //------------------------------
  286.     //Variable
  287.     //------------------------------
  288.     var me = Entity.GetLocalPlayer();
  289.     var health = Entity.GetProp(me,"CBasePlayer", "m_iHealth");
  290.     var armor = Entity.GetProp(Entity.GetLocalPlayer(), "CCSPlayerResource", "m_iArmor");
  291.     var Armor_text = "" + armor;
  292.     var Health_text = "" + health;
  293.     var x = UI.GetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Health_Armor_X"]);
  294.     var y = UI.GetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Health_Armor_Y"]);
  295.     //------------------------------
  296.     //Render
  297.     //------------------------------
  298.  
  299.     if(health == "m_iHealth" || armor == "m_iArmor"){
  300.         Health_text = "0";
  301.         Armor_text = "0";
  302.     }
  303.  
  304.     if(iAlpha > 1){
  305.         iAlpha--;
  306.     }
  307.  
  308.     if(getExp > Levelexp){
  309.         getExp = 0;
  310.         Level ++;
  311.         Levelexp = Levelexp + 2;
  312.     }
  313.  
  314.     //Shadows
  315.     Render.FilledRect( x+40, y+12, 223, 10, [ 155, 51, 47, 102 ]);
  316.     if(health <=100){
  317.     Render.FilledRect( x+40, y+12, (health * 2.23), 10, [ 234, 89, 82, 102 ]);
  318.     }else{
  319.     Render.FilledRect( x+40, y+12, 223, 10, [ 234, 89, 82, 102 ]);
  320.     }
  321.     Render.FilledRect( x+40, y+6, 223, 3, [ 47, 81, 79, 102 ]);
  322.     Render.FilledRect( x+40, y+6, (armor * 2.23), 3, [ 139, 200, 191, 102 ]);
  323.     Render.String( x+280, y+13, 0, Health_text, [222, 79, 70, 102], def_font(25));
  324.     if(health <=1000){
  325.     Render.String( x+320, y+9, 0, Armor_text, [139, 200, 191, 102], def_font(19));
  326.     }else{
  327.     Render.String( x+330, y+9, 0, Armor_text, [139, 200, 191, 102], def_font(19));
  328.     }
  329.     Render.FilledRect(x+6, y+6, 2, 21,   [59, 153, 163, 102]);
  330.     Render.FilledRect(x+32, y+6, 2, 27,   [59, 153, 163, 102]);
  331.     Render.FilledRect(x+6, y+6, 27, 2,   [59, 153, 163, 102]);
  332.     Render.FilledRect(x+16, y+33, 18, 2,   [59, 153, 163, 102]);
  333.     Render.Line( x+6, y+26, x+15, y+34, [59, 153, 163, 102]);
  334.     Render.Line( x+7, y+26, x+16, y+34, [59, 153, 163, 102]);
  335.  
  336.  
  337.     //Display Health
  338.     Render.FilledRect( x+34, y+6, 223, 10, [ 155, 51, 47, 255 ]); //Health Background Color
  339.  
  340.     if(health <=100){
  341.     Render.FilledRect( x+34, y+6, (health * 2.23), 10, [ 234, 89, 82, 255 ]);
  342.     }else{
  343.     Render.FilledRect( x+34, y+6, 223, 10, [ 234, 89, 82, 255 ]);
  344.     }
  345.  
  346.     //Display Armor
  347.     Render.FilledRect( x+34, y, 223, 3, [ 47, 81, 79, 255 ]); //Armor Background Color
  348.     Render.FilledRect( x+34, y, (armor * 2.23), 3, [ 139, 200, 191, 255 ]); //Armor Color
  349.  
  350.     //Display Remaining Health and Armor
  351.     Render.String( x+274, y+7, 0, Health_text, [222, 79, 70, 255], def_font(25));//Remaining Health
  352.  
  353.     if(health <=1000){
  354.     Render.String( x+314, y+3, 0, Armor_text, [139, 200, 191, 255], def_font(19));
  355.     }else{
  356.     Render.String( x+324, y+3, 0, Armor_text, [139, 200, 191, 255], def_font(19));
  357.     }
  358.  
  359.     //Level Framework
  360.     Render.FilledRect(x, y, 2, 21,   [59, 153, 163, 255]);//Left
  361.     Render.FilledRect(x+26, y, 2, 27,   [59, 153, 163, 255]);//Right
  362.     Render.FilledRect(x, y, 27, 2,   [59, 153, 163, 255]);//Top
  363.     Render.FilledRect(x+10, y+27, 18, 2,   [59, 153, 163, 255]);//Bottom
  364.     Render.Line( x, y+20, x+9, y+28, [59, 153, 163, 255]);//Angled
  365.     Render.Line( x+1, y+20, x+10, y+28, [59, 153, 163, 255]);//Angledx2
  366.  
  367.     //Display Level
  368.     Render.String( x+14, y+5, 1, ""+Level, [139, 200, 191, 255], def_font(17));
  369.     Render.String( x+34 , y+21, 0, 'You Kill Player! Get 1 Exp! ', [139, 200, 191, iAlpha], def_font(17));
  370.  
  371.     //BetterUI and Better Colors API
  372.     //Create dragging properties.
  373.     const window_area = area.new(x, y, 200, 32);
  374.     const mouse_pos = point.new(Input.GetCursorPosition()[0], Input.GetCursorPosition()[1]);
  375.     if (Input.IsKeyPressed(1) && UI.IsMenuOpen())
  376.     {
  377.         if (area.in_bounds(window_area, mouse_pos))
  378.         {
  379.             UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Health_Armor_X"], mouse_pos.x - 100);
  380.             UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Health_Armor_Y"], mouse_pos.y - 10);
  381.         }
  382.     }
  383.  
  384.     //Check Localplayer
  385.     if (!Entity.IsValid(Entity.GetLocalPlayer())) return;
  386.  
  387. }
  388.  
  389. //Health and Armor Visibility
  390. UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Health_Armor_X"], 656);
  391. UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Health_Armor_Y"], 81);
  392. Visibility("Health_Armor_X",false);
  393. Visibility("Health_Armor_Y",false);
  394.  
  395. //Weapon
  396. function Weapon(){
  397.  
  398.     //------------------------------
  399.     //Variable
  400.     //------------------------------
  401.     var me = Entity.GetLocalPlayer();
  402.     var weapon = Entity.GetWeapon(me);
  403.     var weapon_name = Entity.GetName(weapon);
  404.  
  405.     var ammo = Entity.GetProp(weapon,"CBaseCombatWeapon" ,"m_iClip1");
  406.     var ammo_reserve = Entity.GetProp(weapon, "CBaseCombatWeapon", "m_iPrimaryReserveAmmoCount");
  407.     var x = UI.GetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Weapon_X"]);
  408.     var y = UI.GetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Weapon_Y"]);
  409.     //------------------------------
  410.     //Render
  411.     //------------------------------
  412.     if(ammo < 0){
  413.         ammo = 0
  414.     }
  415.     //Shadows
  416.     Render.String( x+29+6, y-6, 1, (""+00+ammo), [85, 226, 236, 102], def_font(33));
  417.     Render.String( x+88+6, y-6, 1, (""+00+ammo_reserve), [240, 91, 82, 102], def_font(29));
  418.     Render.String( x+126+6, y-2-6, 0, get_icon(weapon_name), [240, 91, 82, 102], Weapon_font(65));
  419.     Render.String( x+150+6, y-16-6, 0, weapon_name, [240, 91, 82, 102], def_font(16));
  420.  
  421.     //Ammo
  422.     Render.String( x+29, y, 1, (""+00+ammo), [85, 226, 236, 255], def_font(33));
  423.     Render.String( x+88, y, 1, (""+00+ammo_reserve), [240, 91, 82, 255], def_font(29));
  424.  
  425.     //weapon
  426.     Render.String( x+126, y-2, 0, get_icon(weapon_name), [240, 91, 82, 255], Weapon_font(65));
  427.     Render.String( x+150, y-16, 0, weapon_name, [240, 91, 82, 255], def_font(16));
  428.  
  429.     //BetterUI and Better Colors API
  430.     //Create dragging properties.
  431.     const window_area = area.new(x, y, 200, 32);
  432.     const mouse_pos = point.new(Input.GetCursorPosition()[0], Input.GetCursorPosition()[1]);
  433.     if (Input.IsKeyPressed(1) && UI.IsMenuOpen())
  434.     {
  435.         if (area.in_bounds(window_area, mouse_pos))
  436.         {
  437.             UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Weapon_X"], mouse_pos.x - 100);
  438.             UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Weapon_Y"], mouse_pos.y - 10);
  439.         }
  440.     }
  441.  
  442.     //Check Localplayer
  443.     if (!Entity.IsValid(Entity.GetLocalPlayer())) return;
  444.  
  445. }
  446.  
  447. //Weapon Visibility
  448. UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Weapon_X"], 43);
  449. UI.SetValue(["Visuals", "Cyberpunk", "Cyberpunk", "Weapon_Y"], 816);
  450. Visibility("Weapon_X",false);
  451. Visibility("Weapon_Y",false);
  452.  
  453. //==========================================================================================================\\
  454.  
  455. //==========================================================================================================\\
  456. //Misc Function
  457. //------------------------------
  458.  
  459. function onDraw(){
  460.     //Display Health and Armor
  461.     var me = Entity.GetLocalPlayer();
  462.     var health = Entity.GetProp(me,"CBasePlayer", "m_iHealth");
  463.     if(UI.GetValue(["Visuals", "Cyberpunk", "Cyberpunk","Enable UI"]) & (1 << 0)){
  464.         Health_Armor();
  465.     }
  466.     if(UI.GetValue(["Visuals", "Cyberpunk", "Cyberpunk","Enable UI"]) & (1 << 1) && health > 1){
  467.         Weapon()
  468.     }
  469. }
  470.  
  471. //Close js
  472. function onUnload(){
  473.  
  474.     Cheat.ExecuteCommand("cl_draw_only_deathnotices 0");
  475.     Cheat.ExecuteCommand("cl_drawhud_force_radar 0");
  476.  
  477. }
  478. //==========================================================================================================\\
  479.  
  480. //==========================================================================================================\\
  481. //here is tilestra's Function and Variable
  482. //https://onetap.su/members/tilestra.54952/
  483. //Sorry,I Copy your hub js
  484. //------------------------------
  485.  
  486. var iAlpha = 0, iExp = 0, getExp = 0, Level = 1, Levelexp = 3, iKills = 0, Level2 = 0;
  487.  
  488. //Out match is ended
  489. function EVENT_MATCH_END()
  490. {
  491.     RESET();
  492.     //Next map
  493.     iExp = 0, getExp = 0,Level = 1;
  494. }
  495.  
  496. //Setup to default everything at player spawn
  497. function EVENT_PLAYER_SPAWN()
  498. {
  499.     PlayerIndex = Event.GetInt("userid");
  500.     iPlayerIndex = Entity.GetEntityFromUserID(PlayerIndex);
  501.    
  502.     //Reset for us
  503.     if(Entity.GetLocalPlayer() == iPlayerIndex)    RESET();
  504. }
  505.  
  506. //Setup to default everything at round start
  507. function EVENT_ROUND_START()
  508. {
  509.     RESET();
  510.    
  511. }
  512.  
  513. function RESET()
  514. {
  515.     iAlpha = 0;
  516. }
  517.  
  518. //------------------------------
  519.  
  520. function EVENT_DEATH()
  521. {
  522.     //Get them
  523.     iVictim = Event.GetInt("userid");
  524.     iVictim_index = Entity.GetEntityFromUserID(iVictim);
  525.     iAttacker = Event.GetInt("attacker");
  526.     iAttacker_index = Entity.GetEntityFromUserID(iAttacker);
  527.  
  528.     if(Entity.GetLocalPlayer() == iVictim_index && Entity.GetLocalPlayer() !== iAttacker_index)    return;
  529.  
  530.     //A kill count only for us + info
  531.     if(Entity.GetLocalPlayer() == iAttacker_index)
  532.     {
  533.         //Simulating Exp
  534.         iExp = getExp;
  535.         //Frame count and transparency
  536.         iAlpha = 255;
  537.         //Reset if MAX (or remove if u want)
  538.         getExp++;
  539.     }
  540. }
  541.  
  542. //==========================================================================================================\\
  543. //Callback
  544. //------------------------------
  545. Cheat.RegisterCallback("Draw", "onDraw")
  546. Cheat.RegisterCallback("Unload", "onUnload");
  547.  
  548. //here is tilestra's Callback
  549. //https://onetap.su/members/tilestra.54952/
  550. //------------------------------
  551. Global.RegisterCallback("player_death", "EVENT_DEATH");
  552. Global.RegisterCallback("round_start", "EVENT_ROUND_START");
  553. Global.RegisterCallback("player_spawned", "EVENT_PLAYER_SPAWN");
  554. Global.RegisterCallback("cs_intermission", "EVENT_MATCH_END");
  555. Global.RegisterCallback("cs_win_panel_match", "EVENT_MATCH_END");
  556. //==========================================================================================================\\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement