gwjasonbr Posted July 31, 2020 Posted July 31, 2020 Tenho um servidor de '' ROLEPLAY '' e estava jogando em um servidor que os staff ficava invisivel igual o gta v que o id não aparece e queria saber como faz esse script como eu não sei fazer só pago a host e só Administro... se poder ajuda.
Moderators Lord Henry Posted July 31, 2020 Moderators Posted July 31, 2020 Trata-se de uma dúvida de programação. Tópico movido para a seção adequada. Você faz isso com setElementAlpha. Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
Blaack Posted July 31, 2020 Posted July 31, 2020 9 hours ago, gwjasonbr said: Tenho um servidor de '' ROLEPLAY '' e estava jogando em um servidor que os staff ficava invisivel igual o gta v que o id não aparece e queria saber como faz esse script como eu não sei fazer só pago a host e só Administro... se poder ajuda. Use o setElementAlpha para deixar o player invisível, já em seu nametag por id use o getElementAlpha se for igual 255, aparece o id; Já se for igual à 0, não mostra!
gwjasonbr Posted July 31, 2020 Author Posted July 31, 2020 (edited) qual que ta certo? local drawDistance = 7 g_StreamedInPlayers = {} function toggleInvisibility(thePlayer) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("Staff01")) then local enabled = getElementData(thePlayer, "invisible") if (enabled == true) then setElementAlpha(thePlayer, 0) setElementData(thePlayer, "reconx", false) outputChatBox (" -> Você desativou a invisibilidade", thePlayer) setElementData(thePlayer, "invisible", false) elseif (enabled == false or enabled == nil) then setElementAlpha(thePlayer, 0) setElementData(thePlayer, "reconx", true) outputChatBox (" -> Você ativou a invisibilidade", thePlayer) setElementData(thePlayer, "invisible", true) else end outputChatBox ("Acesso negado", thePlayer) else end end addCommandHandler("invi", toggleInvisibility) 2- 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 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 table.remove(g_StreamedInPlayers, k) end end addEventHandler("onClientRender", root, onClientRender) addCommandHandler("invv", toggleInvisibility) addCommandHandler("inv", toggleInvisibility) Edited July 31, 2020 by gwjasonbr
gwjasonbr Posted July 31, 2020 Author Posted July 31, 2020 6 hours ago, ~#BlackSCR said: Use o setElementAlpha para deixar o player invisível, já em seu nametag por id use o getElementAlpha se for igual 255, aparece o id; Já se for igual à 0, não mostra! function toggleInvisibility(thePlayer) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("Staff01")) then local enabled = getElementData(thePlayer, "invisible") if (enabled == true) then setElementAlpha(thePlayer, 255) setElementData(thePlayer, "reconx", false) outputChatBox (" -> Você desativou a invisibilidade", thePlayer) setElementData(thePlayer, "invisible", false) elseif (enabled == false or enabled == nil) then setElementAlpha(thePlayer, 0) setElementData(thePlayer, "reconx", true) outputChatBox (" -> Você ativou a invisibilidade", thePlayer) getElementAlpha(thePlayer, "invisible", true) else end else outputChatBox ("Acesso negado", thePlayer) end end addCommandHandler("invisivel", toggleInvisibility) addCommandHandler("inv", toggleInvisibility) Assim ?
Moderators Lord Henry Posted August 4, 2020 Moderators Posted August 4, 2020 Utilize o botão <> do fórum para postar seus scripts. Não cole direto no texto. Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
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