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

Wysłany: 2018-05-06, 12:09


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
Witam,posiadam skrypt na nami tagi z pystories i chcia?bym doda? nametag dla nowej rangi ale niewiem czemu mi nie dzia?a
KOD
local sw,sh=guiGetScreenSize()


--local nametagFont "default"
local nametagFont dxCreateFont"f/droid-sans.ttf"10)
if not nametagFont then nametagFont "default-bold" end
local fontHeight=dxGetFontHeight(1nametagFont)
local nametagScale 1.10
local nametagAlpha 180
local nametagColor =
{
    255,
    255,
    255
local hp_width=math.floor(sw/20)
if hp_width<50 then hp_width=50 end
local hp_height=math.floor(hp_width/10)

local gsize=sw>800 and 32 or 16


local ourlevel=0
local ourfid=""



setTimer(function()
  ourlevel=getElementData(localPlayer"level") or 0
  ourfid=getElementData(localPlayer"player:faction") or ""
end150000)

function korona()
    local rootxrootyrootz getCameraMatrix()
    for iplayer in ipairs(getElementsByType("player",root,true)) do
        if getElementDimension(localPlayer)==getElementDimension(player) and getElementInterior(localPlayer)==getElementInterior(playerthen
            if getElementAlpha(player) < 1 then
            if not getElementData(localPlayer,"player:admin") == true then return end
            end
            local x,y,getPedBonePosition(player,6)
            if and and z then
                local distance getDistanceBetweenPoints3D(rootxrootyrootzxyz)
                if(distance <= 22then
                    if isLineOfSightClearrootx,rooty,rootzx,y,ztruefalsefalsetruefalsefalsetrue,localPlayer then
                        if getElementData(player,"Ryjek"then
                            if(distance <= 12then
                                dxDrawMaterialLine3D(x,y,z+1.25,x,y,z+0.35,img,1.1,white)
                            end
                        end
                    end
                end
            end
        end
    end
end

addEventHandler("onClientRender"root, function()
  local rootxrootyrootz getCameraMatrix()--getElementPosition(getLocalPlayer())
        for ivehicle in ipairs(getElementsByType("vehicle"roottrue)) do
            local opis=getElementData(vehicle,"opis")
            local poziom=tonumber(getElementData(vehicle,"poziom"))
            if poziom then
                opis= (opis and opis or "") .. " zape?nienie: " ..math.floor(math.max(math.min(poziom,100),0)+0.5).."%"
            end
            if (opisthen
            local x,y,z=getElementPosition(vehicle)
            local distance getDistanceBetweenPoints3D(rootxrootyrootzxyz)
            local kierowca=getVehicleController(vehicle)
            if (distance<=15 or (kierowca and kierowca==localPlayer)) then
                local sx,sy getScreenFromWorldPosition(x,y,z200)
                if (sx and sythen
                    dxDrawText(opissx-(sw/5),sy,sx+(sw/5),sytocolor(255,255,255,155), 1.0"default-small""center","center",false,true)
                end
            end
            end
        end
        
        local ctrl=getKeyState("lalt") or getKeyState("ralt") or getKeyState("lctrl") or getKeyState("rctrl")

        for iplayer in ipairs(getElementsByType("player",root,true)) do
            if player ~= localPlayer and (getElementAlpha(player)>50 or ourlevel>or getElementDimension(player)==901then
                local x,y,getPedBonePosition(player,8)

                local sxsy getScreenFromWorldPosition(xyz+0.5)
                if sx then
                        local distance getDistanceBetweenPoints3D(rootxrootyrootzxyz)
                        if getElementAlpha(player) < and not getElementData(localPlayer,"player:admin"then
                        return end
                        
                        local name "["..getElementData(player"id").."] "..getPlayerName(player)..""
                        local distance getDistanceBetweenPoints3D(rootxrootyrootzxyz)

                        local fX math.floor(sx)
                        local fY math.floor(sy)

                        local alpha 120

                        if(distance <= 35then
                            local org=getElementData(player,"player:organization")
                            if (ctrlthen
                                local fname=getElementData(player"player:faction")
                                if (fnamethen
                                    dxDrawText(fnamefXfY+16fXfY+16tocolor(255,255,255,200), nametagScale*0.9nametagFont"center""center")
                                end
                                if org and org.nazwa then
                                    dxDrawText(org.nazwafXfY+15fXfY+15tocolor0,   0,  0150), nametagScale*1nametagFont"center""center")
                                end
                            end

                            local level tonumber(getElementData(player"player:level"))
                            if level == 1 then
                                dxDrawText("#FFFFFF[#01bf34"..getElementData(player"id").."#FFFFFF] #FFFFFF"..getPlayerName(player):gsub("#%x%x%x%x%x%x","")..""fXfYfXfYtocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                                dxDrawText("#FFFFFF[#01bf34Moderator#FFFFFF]"fXfY-16fXfY-16tocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                             if level == 5 then
                                dxDrawText("#FFFFFF[#007FFF"..getElementData(player"id").."#FFFFFF] #FFFFFF"..getPlayerName(player):gsub("#%x%x%x%x%x%x","")..""fXfYfXfYtocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                                dxDrawText("#FFFFFF[#007FFFTestowy Suport#FFFFFF]"fXfY-16fXfY-16tocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)   
                            elseif level == 2 then
                                dxDrawText("#FFFFFF[#ff0000"..getElementData(player"id").."#FFFFFF] #FFFFFF"..getPlayerName(player):gsub("#%x%x%x%x%x%x","")..""fXfYfXfYtocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                                dxDrawText("#FFFFFF[#ff0000Administrator#FFFFFF]"fXfY-16fXfY-16tocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                            elseif level == 3 then
                                dxDrawText("#FFFFFF[#a31303"..getElementData(player"id").."#FFFFFF] #FFFFFF"..getPlayerName(player):gsub("#%x%x%x%x%x%x","")..""fXfYfXfYtocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                                dxDrawText("#FFFFFF[#a31303ROOT#FFFFFF]"fXfY-16fXfY-16tocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                            elseif level == 4 then
                                dxDrawText("#FFFFFF[#800000"..getElementData(player"id").."#FFFFFF] #FFFFFF"..getPlayerName(player):gsub("#%x%x%x%x%x%x","")..""fXfYfXfYtocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                                dxDrawText("#FFFFFF[#800000Zarzad#FFFFFF]"fXfY-16fXfY-16tocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                            elseif p_level == 1 then
                                dxDrawText("#FFFFFF[#C0FF00"..getElementData(player"id").."#FFFFFF] #FFFFFF"..getPlayerName(player):gsub("#%x%x%x%x%x%x","")..""fXfYfXfYtocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                                dxDrawText("#FFFFFF[#C0FF00Premium#FFFFFF]"fXfY-16fXfY-16tocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true)    
                                                                 else
                                dxDrawText("#FFFFFF[#FFFFFF"..getElementData(player"id").."#FFFFFF] #FFFFFF"..getPlayerName(player):gsub("#%x%x%x%x%x%x","")..""fXfYfXfYtocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true) -- ,false,true
                                dxDrawText("#FFFFFF[#FFFFFF#FFFFFFGracz#FFFFFF]"fXfY-16fXfY-16tocolor(255255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                            end
                            if getElementData(player,"mute:player"then
                            --dxDrawText("[Wyciszony]"sxc1+1syc1+1sxc1+1syc1+1tocolor(000alpha), nametagScalenametagFont"center""center",false,false,false,true,true)
                            dxDrawText("#FFFFFF[#FFFF00Wyciszony#FFFFFF]"fXfY-32fXfY-32tocolor(0255255255), nametagScalenametagFont"center""center",false,false,false,true,true)
                            end



                            if ourfid=="SAMC" then -- pokazujemy hp innych graczy
                                dxDrawRectangle(fX-hp_width/2-1fY+fontHeighthp_width+2hp_height+2tocolor(27,27,27,155))
                                local hp=getElementHealth(player)
                                if hp>100 then hp=100 end
                                local hhp_width=(hp*hp_width/100)
                                dxDrawRectangle(fX-hp_width/2fY+fontHeight+1hhp_widthhp_heighttocolor(255,5,5,155))
                            end

                            local opis=getElementData(player"opis")
                            if opis then
                                local alpha=255-getDistanceBetweenPoints2D(sw/2,sh/2,sx,sy)

                                if alpha>5 then
                                    local sxsy getScreenFromWorldPosition(xyz-0.5)
                                    if sx and sy then
                                        dxDrawText(opissx-(sw/10),sy,sx+(sw/10),sytocolor(255,255,255,alpha), 1.0"default-small""center","center",false,true)
                                    end
                                end
                            end
                        end
                end
            end
        end    

        for iped in ipairs(getElementsByType("ped",root,true)) do
            local name=getElementData(ped,"name")
            if name then
                local x,y,getElementPosition(ped)
                local sxsy getScreenFromWorldPosition(xy1)

                if sx then
                    local distance getDistanceBetweenPoints3D(rootxrootyrootzxyz)

                    local fX sx
                    local fY sy

                    local alpha 120

                    if(distance <= and isLineOfSightClear(rootx,rooty,rootz,x,y,z,false,false,false)) then
                        dxDrawText(namefXfYfXfYtocolor(000alpha), nametagScalenametagFont"center""center")                    
                    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 veh getPedOccupiedVehicle(localPlayer)
                local distance=getDistanceBetweenPoints3D(rootx,rooty,rootz,x,y,z)
                if distance <= 25 then
                    if isLineOfSightClearrootx,rooty,rootzx,y,ztruetruefalsetruefalsetruetrue,vehicle then
                    dxDrawText(desc:gsub("#%x%x%x%x%x%x",""), sx-(sw/10),sy,sx+(sw/10),sytocolor(255,255,255,alpha), 1.0"default""center","center",false,true)
                    end
                end
            end
        end
    end
end)

addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), 
    function()
        for kv in ipairs(getElementsByType("player")) do
            setPlayerNametagShowing vfalse )
        end
    end
)

addEventHandler("onClientPlayerJoin"root, 
--addEventHandler("onClientPlayerSpawn"getRootElement(), 
    function()
        setPlayerNametagShowing sourcefalse )
    end
)

fileDelete("nametags_c.lua")


Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-06, 12:34


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Co ci nie dzia?a? W czym problem? Dopisujesz kolejn? linijk? z elseif

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Rumper
Wysłany: 2018-05-06, 12:43


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
Dzi?ki,Leci :piwo:
Do zamkni?cia

Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Tagi: 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 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