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

Wysłany: 2018-11-29, 20:49


kuba43







Wiek: 45
Na forum: 3366 dni
Posty: 166
Nick w MP: definitly

Piwa: 17

Respekt: 30,5

Siema mam ten error https://imgur.com/a/zNtVJoV
a o to kod



local utils = {nametagFont = setFont("archivo_narrow", 19), location = setFont("sign_painter", 38)}
local screenSize = Vector2(guiGetScreenSize())
local timer = false

addEventHandler("onClientMinimize", root, function()
    localPlayer:setData("player:minimalized", getTickCount())
    localPlayer:setData("player:tick", getTickCount())
    timer = Timer(function() localPlayer:setData("player:tick", getTickCount()) end, 1000, 0)
end)

addEventHandler("onClientRestore", root, function()
    localPlayer:setData("player:minimalized", false)
    if timer and timer.valid then timer:destroy() end
end)

addEventHandler("onClientRender", root, function()
    if not isPlayerMapVisible() and not localPlayer:getData("player:hud_visible") then
        local position = {getElementPosition(localPlayer)}
        local city = getZoneName(position[1], position[2], position[3], true)
        local street = getZoneName(position[1], position[2], position[3], false)
        if dxSetAspectRatioAdjustmentEnabled then dxSetAspectRatioAdjustmentEnabled(true) end
        
        if city == "Unknown" then street = "" end
        if city ~= street then street = "   "..street.."\n"..city else street = "   "..street end
        if isPlayerHudComponentVisible("radar") and localPlayer.interior == 0 and localPlayer.dimension == 0 then
            dxDrawText(street, (260/1280*screenSize.x)+1, (660/720*screenSize.y)+1, (399/1280*screenSize.x)+1, (670/720*screenSize.y)+1, tocolor(0, 0, 0, 255), 0.5, utils.location or "default-bold", "left", "center")
            dxDrawText(street, 260/1280*screenSize.x, 660/720*screenSize.y, 399/1280*screenSize.x, 670/720*screenSize.y, tocolor(255, 255, 255, 255), 0.5, utils.location or "default-bold", "left", "center")
        end
    end
end)

local function checkLevel(player)
    distance = 0
    if player:getData("player:level") then distance = 0.62 else distance = 0.56 end
    return distance
end

addEventHandler("onClientRender", root, function()
    for k,v in pairs(Element.getAllByType("player")) do
        if localPlayer.interior == v.interior and localPlayer.dimension == v.dimension then
            local camera = {getCameraMatrix()}
            local bone = {v:getBonePosition(8)}
            local distance = getDistanceBetweenPoints3D(camera[1], camera[2], camera[3], bone[1], bone[2], bone[3])
            if localPlayer:getData("player:hud_visible") then return false end
            
            if distance <= 30 and v.alpha >= 230 then
            local coords = {getScreenFromWorldPosition(bone[1], bone[2], bone[3])}
            coords[2] = coords[2]+checkLevel(v)
                if coords[1] and coords[2] then
                    local minimalized = ""
                    local minimal = v:getData("player:minimalized")
                    if minimal then 
                        local tick = v:getData("player:tick")
                        if tick then
                            local tick = tick - minimal
                            local sekundy=math.floor(tick/1000) or 0
                            local godziny = string.format("%02.f", math.floor(sekundy/3600));
                            local minuty = string.format("%02.f", math.floor(sekundy/60 - (godziny*60)));
                            local secs = string.format("%02.f", math.floor(sekundy - godziny*3600 - minuty *60));
                            minimalized = "zminimalizowany(a) od: "..godziny.."h "..minuty.."m "..secs.."s" 
                        end
                    end
                    
                    local data = (v:getData("player:level") and v:getData("player:duty"))
                    rank = ranks[v:getData("player:level")] or ""
                    visualrank = v:getData("player:visualrank")
                    visualid = v:getData("player:visualid") or "#FFFFFF"
                    if v:getData("chat_typing") then chat = "#9F9F9F(...)#ffffff" else chat = "" end
                    if v:getData("player:muted") then prefix = "#8060FF(MUTE)" else prefix = "" end
                    if v:getData("player:duty") == "SAPD" then dutyf = "#0000CDSan Andreas Police Department" elseif v:getData("player:duty") == "SAMD" then dutyf = "#00A0FFSan Andreas Medical Department" elseif v:getData("player:duty") == "FDSA" then dutyf = "#FF0000Fire Department San Andreas" elseif v:getData("player:duty") == "Tuner SF" then dutyf = "Monter cz??ci samochodowych" end
                    statue = ""

                    if data and not visualrank then
                        dxDrawText(minimalized.."\n\n"..statue:gsub("#%x%x%x%x%x%x","").."\n"..dutyf:gsub("#%x%x%x%x%x%x","").."\n"..rank.."\n["..(v:getData("id") or 0).."] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat:gsub("#%x%x%x%x%x%x","").."\n"..prefix:gsub("#%x%x%x%x%x%x",""), coords[1]+1, coords[2]+1, coords[1]+1, coords[2]+1, tocolor(0, 0, 0, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                        dxDrawText(minimalized.."\n\n"..statue.."\n"..dutyf.."\n"..getColorWhereRank(v)..""..rank.."#FFFFFF\n["..getColorWhereRank(v)..""..(v:getData("id") or 0).."#FFFFFF] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat.."\n"..prefix, coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                    elseif data and visualrank then
                        dxDrawText(minimalized.."\n\n"..statue:gsub("#%x%x%x%x%x%x","").."\n"..dutyf:gsub("#%x%x%x%x%x%x","").."\n"..getColorWhereRank(v):gsub("#%x%x%x%x%x%x","")..""..visualrank:gsub("#%x%x%x%x%x%x","").."\n["..getColorWhereRank(v):gsub("#%x%x%x%x%x%x","")..""..visualid:gsub("#%x%x%x%x%x%x","")..""..(v:getData("id") or 0).."] "..string.gsub(v.name, "#%x%x%x%x%x%x", ""):gsub("#%x%x%x%x%x%x","").." "..chat.."\n"..prefix:gsub("#%x%x%x%x%x%x",""), coords[1]+1, coords[2]+1, coords[1]+1, coords[2]+1, tocolor(0, 0, 0, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                        dxDrawText(minimalized.."\n\n"..statue.."\n"..dutyf.."\n"..getColorWhereRank(v)..""..visualrank.."#FFFFFF\n["..getColorWhereRank(v)..""..visualid..""..(v:getData("id") or 0).."#FFFFFF] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat.."\n"..prefix, coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)    
                    elseif v:getData("player:level") and not visualrank then
                        dxDrawText(minimalized.."\n\n"..statue:gsub("#%x%x%x%x%x%x","").."\n"..rank.."\n["..(v:getData("id") or 0).."] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat:gsub("#%x%x%x%x%x%x","").."\n"..prefix:gsub("#%x%x%x%x%x%x",""), coords[1]+1, coords[2]+1, coords[1]+1, coords[2]+1, tocolor(0, 0, 0, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                        dxDrawText(minimalized.."\n\n"..statue.."\n"..getColorWhereRank(v)..""..rank.."#FFFFFF\n["..getColorWhereRank(v)..""..(v:getData("id") or 0).."#FFFFFF] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat.."\n"..prefix, coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                    elseif v:getData("player:level") and visualrank then
                        dxDrawText(minimalized.."\n\n"..statue:gsub("#%x%x%x%x%x%x","").."\n"..visualrank:gsub("#%x%x%x%x%x%x","").."\n["..(v:getData("id") or 0).."] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat:gsub("#%x%x%x%x%x%x","").."\n"..prefix:gsub("#%x%x%x%x%x%x",""), coords[1]+1, coords[2]+1, coords[1]+1, coords[2]+1, tocolor(0, 0, 0, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                        dxDrawText(minimalized.."\n\n"..statue.."\n"..visualrank.."#FFFFFF\n["..visualid..""..(v:getData("id") or 0).."#FFFFFF] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat.."\n"..prefix, coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                    elseif v:getData("player:duty") then
                        dxDrawText(minimalized.."\n\n"..statue:gsub("#%x%x%x%x%x%x","").."\n"..dutyf:gsub("#%x%x%x%x%x%x","").."\n["..(v:getData("id") or 0).."] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat:gsub("#%x%x%x%x%x%x","").."\n"..prefix:gsub("#%x%x%x%x%x%x",""), coords[1]+1, coords[2]+1, coords[1]+1, coords[2]+1, tocolor(0, 0, 0, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                        dxDrawText(minimalized.."\n\n"..statue.."\n"..dutyf.."\n#FFFFFF["..getColorWhereRank(v)..""..(v:getData("id") or 0).."#FFFFFF] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat.."\n"..prefix, coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                    else
                        dxDrawText(minimalized.."\n\n"..statue:gsub("#%x%x%x%x%x%x","").."\n["..(v:getData("id") or 0).."] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat:gsub("#%x%x%x%x%x%x","").."\n"..prefix:gsub("#%x%x%x%x%x%x",""), coords[1]+1, coords[2]+1, coords[1]+1, coords[2]+1, tocolor(0, 0, 0, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                        dxDrawText(minimalized.."\n\n"..statue.."\n["..getColorWhereRank(v)..""..(v:getData("id") or 0).."#FFFFFF] "..string.gsub(v.name, "#%x%x%x%x%x%x", "").." "..chat.."\n"..prefix, coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 0.7-distance/45, utils.nametagFont or "default-bold", "center", "center", false, true, false, true)
                    end
                end
            end
        end
    end
end)

function checkPlayerChatTyping()
    if isChatBoxInputActive() then
        if getElementData(localPlayer, "chat_typing")==false then
            setElementData(localPlayer, "chat_typing", true)
        end
    else
        if getElementData(localPlayer, "chat_typing")==true then
            setElementData(localPlayer, "chat_typing", false)
        end
    end
end
setTimer(checkPlayerChatTyping, 100, 0)


Podpis
„(…) wystarczy, że odpowiesz sobie na jedno zajebiście, ale to zajebiście, ważne pytanie: co lubię w życiu robić. A potem zacznij to robić.”.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 12:01


TeeNekk

Cienzaruwka :v






Wiek: 23
Na forum: 3351 dni
Posty: 264
Nick w MP: TeeNekk.

Piwa: 919

Respekt: 110,5
Respekt: 110,5

wska? linijk?.

Podpis
Pomogłem Ci
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 15:14


kuba43







Wiek: 45
Na forum: 3366 dni
Posty: 166
Nick w MP: definitly

Piwa: 17

Respekt: 30,5

            coords[2] = coords[2]+checkLevel(v) 


Podpis
„(…) wystarczy, że odpowiesz sobie na jedno zajebiście, ale to zajebiście, ważne pytanie: co lubię w życiu robić. A potem zacznij to robić.”.
Postaw piwo autorowi tego posta
 

 
Tagi: iyw_gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » iyw_gui 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