Radar CS Custom Lotus_.

Radar Ultimate, blue if friends are dead, yellow if they are in combat.

// ==UserScript==
// @name         Radar CS Custom Lotus_. 
// @description  Radar Ultimate, blue if friends are dead, yellow if they are in combat.
// @version      2.96
// @match        https://game.play-cs.com/*
// @license MIT
// @grant        none
// @namespace https://gf.qytechs.cn/users/1509136
// ==/UserScript==
(()=>{var e=document.createElement("style");e.innerHTML=`
    .hud-radar, .hud-radar * { display: none !important; }
  `,document.head.appendChild(e);const c={},p={},a="__c4_virtual_id__";let t;document.getElementById("radarCS")?.remove(),document.getElementById("menuHamburgerCS")?.remove();const u=116;if(setInterval(()=>{var e=[...document.querySelectorAll(".scoreboard-hud-ct-body tr"),...document.querySelectorAll(".scoreboard-hud-tr-body tr")];const i=new Set,n=Date.now();if(e.forEach(e=>{var t,e=e.innerText?.trim();const r=(t=(e=e).replace(/^\[[^\]]*\]\[[^\]]*\]/,"").match(/^(.+?)\s*-?([\d\.\-]+)\s*(Dead|Bomb)?$/))?{nome:t[1].replace(/(\s*(DE|SM|FL|AR|HE|KT)\s*)+$/g,"").replace(/\s{2,}/g," ").trim(),score:-parseFloat(t[2]),dead:e.includes("Dead")}:null;if(r&&r.nome){let o=null,d=null,a=null;if(window.radarDx&&window.g_PlayerExtraInfo)for(let[t,e]of Object.entries(window.radarDx))if(Object.values(window.g_PlayerExtraInfo).find(e=>e?.id?.toString()===t&&e?.name?.includes(r.nome))){o=t,d=e?.[0]?.toFixed(0),a=e?.[1]?.toFixed(0);break}if(o){i.add(o);let e=c[o];"number"==typeof(e=e||{nome:r.nome,score:r.score,prevScore:r.score,status:r.dead?"Dead":"Alive",id:o,x:d,y:a}).prevScore&&2e3<Math.abs(e.prevScore-r.score)&&!r.dead&&(p[o]={cor:"yellow",ate:n+3e3}),"Dead"!==e.status&&r.dead&&(p[o]={cor:"blue",ate:n+3e3,x:d??e.x,y:a??e.y}),e.prevScore=r.score,e.score=r.score,e.status=r.dead?"Dead":"Alive",e.x=d,e.y=a,c[o]=e}}}),window.radarDx){let d=!1;Object.entries(window.radarDx).forEach(([,e])=>{var t,o;!e||!Array.isArray(e)||e.length<3||([e,t,o]=e,3===o&&(c[a]={nome:"C4",score:"-",status:"Plantada/Dropada",id:"-",x:Math.round(e),y:Math.round(t)},d=!0))}),!d&&c[a]&&delete c[a]}const t=Date.now();Object.keys(c).forEach(e=>{e===a||i.has(e)||p[e]&&!(t>p[e].ate)||(delete c[e],delete p[e])})},300),!document.getElementById("radarCS")){const h=document.createElement("div");h.id="radarCS",Object.assign(h.style,{position:"fixed",left:"10px",top:"56px",width:"232px",height:"232px",background:"rgba(0,0,0,0.7)",border:"1px solid #ccc",borderRadius:"50%",overflow:"hidden",zIndex:9999});var e=document.createElement("div"),o=(Object.assign(e.style,{position:"absolute",top:"116px",left:"0",width:"100%",height:"1px",backgroundColor:"#777"}),document.createElement("div"));Object.assign(o.style,{position:"absolute",left:"116px",top:"0",width:"1px",height:"100%",backgroundColor:"#777"}),h.appendChild(e),h.appendChild(o),document.body.appendChild(h),t=setInterval(()=>{h.querySelectorAll(".ponto, .star-me, .c4x").forEach(e=>e.remove());const s=Date.now(),l=!!(e=document.querySelector(".hud-bomb-timer-num"))&&"none"!==(t=window.getComputedStyle(e)).display&&"hidden"!==t.visibility&&null!==e.offsetParent;var e,t;Object.values(c).forEach(o=>{let e=o.x,d=o.y;if(p[o.id]&&"blue"===p[o.id].cor&&s<p[o.id].ate&&(e=p[o.id].x,d=p[o.id].y),e&&d&&(e=parseFloat(e),d=parseFloat(d),isFinite(e))&&isFinite(d)){var a=window.myAngle??0,r=Math.sqrt(e*e+d*d)/32,r=Math.min(r,u),a=(180*Math.atan2(d,e)/Math.PI-a+90)*Math.PI/180,i=r*Math.cos(a),r=-r*Math.sin(a),a=u+i,i=u+r;let t="white";if("C4"===o.nome)if(l){t="red";const n=document.createElement("div");n.className="ponto",Object.assign(n.style,{position:"absolute",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:t,left:a-6+"px",top:i-6+"px",border:"2px solid #000"}),h.appendChild(n)}else{r=document.createElement("div");r.className="c4x",Object.assign(r.style,{position:"absolute",width:"16px",height:"16px",left:a-8+"px",top:i-8+"px",zIndex:10001}),r.innerHTML=`
              <svg width="16" height="16">
                <line x1="2" y1="2" x2="14" y2="14" stroke="red" stroke-width="3"/>
                <line x1="14" y1="2" x2="2" y2="14" stroke="red" stroke-width="3"/>
              </svg>
            `,h.appendChild(r)}else{r=window.radarDx?.[o.id];r&&3<=r.length&&(3===(r=r[2])?t="red":2===r&&(t="orange"));let e="2px solid #000";"#ff0"!==(t=p[o.id]&&s<p[o.id].ate?"yellow"===p[o.id].cor?"#ff0":"#00a":t)&&"#00a"!==t||(e="2px solid #fff"),"red"===t&&(e="2px solid #000"),"white"===t&&(e="2px solid #000");const n=document.createElement("div");n.className="ponto",Object.assign(n.style,{position:"absolute",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:t,left:a-6+"px",top:i-6+"px",border:e}),h.appendChild(n)}}});const o=window.CS_ENV&&CS_ENV.my_cvars&&CS_ENV.my_cvars.name||"Desconhecido";Object.values(c).find(e=>e.nome===o&&"Alive"===e.status&&(!e.x||!e.y||isNaN(Number(e.x))||isNaN(Number(e.y))))&&(u,(t=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("width","16"),t.setAttribute("height","16"),t.classList.add("star-me"),t.style.position="absolute",t.style.left="108px",t.style.top="108px",t.style.zIndex=2,t.innerHTML=`
          <polygon points="8,2 10,7 16,7 11,10.5 13,16 8,12.5 3,16 5,10.5 0,7 6,7"
            fill="#fff" stroke="#222" stroke-width="1"/>
        `,h.appendChild(t))},300)}})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址