Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-11-02, 16:05


NoNamik







Wiek: 35
Na forum: 2186 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

witam jak usunac nametagi na /inv

--local nametagFont "default"
local nametagFont dxCreateFont"czcionka.ttf"20 )
if not nametagFont then nametagFont "default-bold" end
local vopisFont dxCreateFont"czcionka.ttf"20 )
if not vopisFont then vopisFont "default-bold" end

local screenSize Vector2(guiGetScreenSize())
local timer false
local nametagAlpha 175
local nametagColor =
{
    255,
    255,
    255
}

-- Funkcja nametag?w graczy i pojazd?w
-- zazwyczaj sdla u?atwienia wygl?du.
addEventHandler("onClientRender"root, function()
    local rootxrootyrootz getCameraMatrix()
        for i,player in ipairs(getElementsByType("player")) do
            if getElementDimension(localPlayer) == getElementDimension(player) and getElementInterior(localPlayer) == getElementInterior(playerthen
                local x,y,getPedBonePosition(player,7)
                local sxsy getScreenFromWorldPosition(xyz+0.50)
                local sxc,syc =getScreenFromWorldPosition(xyz+0.69)
                local sxc1,syc2 =getScreenFromWorldPosition(xyz+0.57)
                local sxc2,syc3 =getScreenFromWorldPosition(xyz+0.63)
                local sxc5,syc5 =getScreenFromWorldPosition(xyz+0.42)
                if sx and sy and sxc and syc and sxc1 and syc2 then
                local distance getDistanceBetweenPoints3D(rootxrootyrootzxyz)
                if getElementAlpha(player) < and not getElementData(localPlayer,"player:admin"then
                return end
                if(distance <= 12then
                --if isLineOfSightClearrootx,rooty,rootzx,y,ztruefalsefalsefalsefalsefalsetrue,localPlayer then
                      dxDrawText ((getPlayerName(player).." [#b8b8b8"..getElementData(player,"id").."#ffffff]"):gsub("#%x%x%x%x%x%x",""),sxsysxsy,tocolor(255255255,255),1.0,"default-bold","center","center",false,false,false,truetrue)
                    if getElementData(player,"player:premium"then
                    dxDrawText ("[PREMIUM]",sxc1syc2sxc1syc2tocolor(16919146255),1.02,"default","center","center",false,false,false,truetrue)
                    end
                    if getElementData(player,"player:premiumplus"then
                    dxDrawText ("[PREMIUM+]",sxc1syc2 -15sxc1syc2tocolor(11619146255),1.02,"default","center","center",false,false,false,truetrue)
                    end
                    if getElementData(player"player:mute"then 
                    dxDrawText ("[Zmutowany]",sxc5syc5sxc5syc5,tocolor(25500255),1.02,"default","center","center",false,false,false,truetrue)
                    end
                    local frakcja getElementData(player"player:faction")
                    if frakcja == "SAPD" then
                    dxDrawText("[San Andreas Police Departament]"sxc2syc3sxc2syc3tocolor(30253255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif frakcja == "SAFD" then
                    dxDrawText("[San Andreas Fire Departament]"sxc2syc3sxc2syc3tocolor(25500255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif frakcja == "SAMC" then
                    dxDrawText("[San Andreas Medical Center]"sxc2syc3sxc2syc3tocolor(0255255255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif frakcja == "SARA" then
                    dxDrawText("[San Andreeas Road Assistance]"sxc2syc3sxc2syc3tocolor(205870255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif frakcja == "TSA" then
                    dxDrawText("[Transport San Andreas]"sxc2syc3sxc2syc3tocolor(2552550255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    end
                    local level getElementData(player"player:level")
                    if type(level) == "number" then
                    if level == 6 then
                    dxDrawText("Support"sxcsycsxcsyctocolor(02550255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif level == 1 then
                    dxDrawText("Moderator"sxcsycsxcsyctocolor(0255255255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif level == 2 then
                    dxDrawText("Administrator"sxcsycsxcsyctocolor(25500255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif level == 3 then
                    dxDrawText("Opiekun"sxcsycsxcsyctocolor(2550255255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif level == 5 then
                    dxDrawText("RCON"sxcsycsxcsyctocolor(1020255255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif level == 7 then
                    dxDrawText("VCEO"sxcsycsxcsyctocolor(2551000255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    elseif level == 4 then
                    dxDrawText("CEO"sxcsycsxcsyctocolor(2552550255), 1.02"default-bold""center""center",false,false,false,truetrue)
                    end
                    --dxDrawText (name,fX+1fY+1fX+1fY+1,white,nametagScale,"default","center","center",false,false,false,true,true )
                    if getElementData(localPlayer,"player:duty") == "SAMC" then
                    dxDrawRectangle(sx-25*2-1sy+5*2100-distance18+2-distance/2.0tocolor(27,27,27,155)) 
                    dxDrawRectangle(sx-25*2sy+5*2+1getElementHealth(player)-distance18-distance/1.0tocolor(255,5,5,155))
                    end
                  end
                end
            end
        end
    end
    for i,ped in ipairs(getElementsByType("ped")) do
        if ped~=localPlayer and getElementDimension(localPlayer)==getElementDimension(ped) and getElementInterior(localPlayer) == getElementInterior(ped) and getElementAlpha(ped) > 0 then
            local x,y,z=getElementPosition(ped)
            local sx,sy =getScreenFromWorldPosition(xyz+1)
            if sx and sy then
                local desc=getElementData(ped,"ped:desc")
                if desc then
                    local distance getDistanceBetweenPoints3D(rootx,rooty,rootz,x,y,z)
                    if distance <= 25 then
                        dxDrawText(descsxsysxsytocolor(255255255255), 1.0"default`""center""center")
                    end
                end
            end
        end
    end
    for i,vehicle in ipairs(getElementsByType("vehicle")) do
        local x,y,z=getElementPosition(vehicle)
        local sx,sy=getScreenFromWorldPosition(x,y,z)
        if sx and sy then
            local desc=getElementData(vehicle,"vehicle:desc")
            if desc then
                local distance=getDistanceBetweenPoints3D(rootx,rooty,rootz,x,y,z)
                if distance <= 25 then
                    if isLineOfSightClearrootx,rooty,rootzx,y,ztruefalsefalsetruefalsefalsetrue,localPlayer then
                    dxDrawText(desc:gsub("#%x%x%x%x%x%x",""), sxsysxsytocolor(255255255255), 1.00,"default""center""center")
                    end
                end
            end
        end
    end
end)

addEventHandler("onClientResourceStart"resourceRoot, function()
    for _,v in ipairs(getElementsByType("player")) do
        setPlayerNametagShowing(vfalse)
    end
end)

addEventHandler("onClientPlayerSpawn"root,  function()
    setPlayerNametagShowing(sourcefalse)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-02, 17:42


VVirmex

Sgrypter luja






Wiek: 21
Na forum: 3365 dni
Posty: 281
Nick w MP: AxyZ

Piwa: 234

Respekt: 110
Respekt: 110

Najlepiej jakby? zrobi? co? takiego pod ka?dym sprawdzeniem elementdaty (nick, frakcja itd.):


elseif getElementAlpha(player) == 0 then return end



My?l? ?e to powinno rozwi?za? problem :)

[ Dodano: 2020-11-02, 21:26 ]
Albo po prostu wklej po ipairs:

if getElementAlpha(player) == 0 then return end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-02, 21:53


vAnimo

Zielony w luła






Wiek: 19
Na forum: 2312 dni
Posty: 165
Nick w MP: vAnimo

Piwa: 882

Respekt: 70

dodaj to do komendy /inv
-- do w??czania inva
setElementData(plr,"p:inv",true)
--do wylaczania
setElementData(plr,"p:inv",false)

a to do nametag?w
addEventHandler("onClientRender"root, function()
    local rootxrootyrootz getCameraMatrix()
        for i,player in ipairs(getElementsByType("player")) do
if getElementData(player,"p:inv"then return end


[ Dodano: 2020-11-02, 21:56 ]
albo tak jak pan wy?ej sprawdzaj alphe :)

Postaw piwo autorowi tego posta
 

 
Tagi: /inv :: nametagi
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » /inv nametagi Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku