Archz Posted March 31, 2021 Share Posted March 31, 2021 então esse script deixa o id invisível para todo mundo, e queria colocar que somente membros da acl staff consiga ver o id, normalmente, já procurei tutorial e não entendi muito bem como fazer isso, alguém poderia me ajudar nessa questão? local drawDistance = 7 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then if getElementAlpha(player) > 0 then -- se o alpha do player for maior que 0 mostra o ID local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText(""..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(0, 255, 0) end end end end end else table.remove(g_StreamedInPlayers, k) end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart() local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) Link to comment
Rakashy Posted April 1, 2021 Share Posted April 1, 2021 Por favor, poste o script corretamente como script para que eu possa te ajudar. Todavia, troque isto: function onClientResourceStart() local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) Por isto: function onClientResourceStart(localPlayer) local players = getElementsByType("player") if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(localPlayer)), aclGetGroup("ACL")) then -- Não se esqueça de colocar a acl. setPlayerNametagShowing(v, true) return end for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) E me diga se funcionou, se não funcionar, e puder colocar mais detalhes sobre, ficarei feliz em ajudar. Link to comment
Archz Posted April 2, 2021 Author Share Posted April 2, 2021 então não funcionou, desculpa pela forma do script e que eu n sei colocar como forma de scritp, so copiei e colei aqui, perdao, mais tipo oq eu queria era deixar para todo mundo do servidor não aparecer o id, e para os que estao na acl staff conseguir ver o id em cima da cabeça Link to comment
Other Languages Moderators Lord Henry Posted April 5, 2021 Other Languages Moderators Share Posted April 5, 2021 Utilize o botão <> do fórum para postar scripts. Não cole direto no texto. Link to comment
LucasST Posted April 6, 2021 Share Posted April 6, 2021 Vou dar um exemplo por enquanto utilizando ElementData, pois acl utilizaria eventos para a verificação da mesma. Spoiler local drawDistance = 7 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() if getElementData(localPlayer, "STAFF") then for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then if getElementAlpha(player) > 0 then -- se o alpha do player for maior que 0 mostra o ID local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText(""..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(0, 255, 0) end end end end else table.remove(g_StreamedInPlayers, k) end end end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart() local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now