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

Wysłany: 2020-05-20, 16:09


xyzzzikk

.gg






Wiek: 18
Na forum: 2774 dni
Posty: 175
Nick w MP: aspyk

Piwa: 6499

Respekt: 30,5

Cze??, pobra?em paczk? square RPG

I taki problem, ?e jak zaloguje si? na ich gamemodzie to hud normalnie dzia?a,
lecz gdy zrobie to na pysie to nie dzia?a, a eldaty zmieni?em na te z pysa i problem nie znika...


Skrypt:

--[[
    HUD
    @author value <value2k@gmail.com>
    Nie masz prawa u?ytego kodu bez mojej zgody
]]

local swsh guiGetScreenSize()

addEventHandler("onClientRender"getRootElement(), function ()
    if not getElementData(localPlayer"player:logged"then return end
    if isPlayerMapVisible() then return end
    
    local enabled getElementData(localPlayer"hud:enabled")
    if enabled then
        local y 10
    
    
        --[[dxDrawText(formatClock(), sw-228y+1sw-930tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228y-1sw-930tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228y+1sw-1130tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228y-1sw-1130tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228ysw-1030tocolor(255255255255), 1.3"default""right")
        17]]
        
        
        local money string.format("%09d"getPlayerMoney(localPlayer))--getElementData(localPlayer"user:money")) 
        dxDrawText("$"..moneysw-228y+1sw-930tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228y-1sw-930tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228y+1sw-1130tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228y-1sw-1130tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228ysw-1030tocolor(255255255255), 1.8"clear""right")
        35
    
        local hp 216*(getElementHealth(localPlayer)/100)
        dxDrawEmptyRectangle(sw-230y22020tocolor(000255), 3)
        dxDrawLine(sw-228y+10sw-228+hpy+10tocolor(106153101255), 16)
        30
        
        local armor getPedArmor(localPlayer)
        if armor 0 then
            dxDrawEmptyRectangle(sw-230y22020tocolor(000255), 3)
            dxDrawLine(sw-228y+10sw-228+(216*(armor/100)), y+10tocolor(122125128255), 16)
            30
        end
    
        if isPedInWater(localPlayerthen
            local oxygen getPedOxygenLevel(localPlayer)
            dxDrawEmptyRectangle(sw-230y22020tocolor(000255), 3)
            dxDrawLine(sw-228y+10sw-228+(216*(oxygen/1000)), y+10tocolor(0180247255), 16)
            30
        end
        
        if isPedInVehicle(localPlayerthen
            local veh getPedOccupiedVehicle(localPlayer)
            if veh then
                local speed math.floor(getElementSpeed(veh1))
                local h getVehicleHandling(veh)
                local p speed/h['maxVelocity']
                if 1 then
                    p 1
                end
                local rspeed =166*p
            --    if (speed/h['maxVelocity']) > 0.75 then
                    --r,g,interpolateBetween(1236252551010, (p-0.75)/0.25"Linear")
            --    else
                    r,g,9193116
                --end
                dxDrawEmptyRectangle(sw-200sh-5017020tocolor(000255), 3) -- Paliwo
                dxDrawLine(sw-198sh-40sw-32sh-40tocolor(0123240255), 16)
                
                dxDrawEmptyRectangle(sw-200sh-7517020tocolor(000255), 3) -- Zdrowie
                dxDrawLine(sw-198sh-65sw-(198-(166*(getElementHealth(veh)/1000))), sh-65tocolor(106153101255), 16)
                
                dxDrawEmptyRectangle(sw-200sh-10017020tocolor(000255), 3) -- Pr?dko??
                dxDrawLine(sw-198sh-90sw-(198-rspeed), sh-90tocolor(r,g,b255), 16)
                
                dxDrawText(math.floor(getElementHealth(veh)/10).."%"sw-198sh-65sw-32sh-65tocolor(255255255255), 1"sans""center""center")
                dxDrawText(speed.."km/h"sw-198sh-90sw-32sh-90tocolor(255255255255), 1"sans""center""center")
                dxDrawText("25 litr?w"sw-198sh-40sw-32sh-40tocolor(255255255255), 1"sans""center""center")
                
                local dist string.format("%7.1f"getElementData(veh"veh:distance"))
                dxDrawText(dist.."km"sw-258+2sh-123+2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258-2sh-123+2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258+2sh-123-2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258-2sh-123-2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258sh-123sw-32sh-40tocolor(255255255255), 1.2"sans""right")
                --dxDrawText(speed.."km/h"sw-258sh-115sw-32sh-40tocolor(255255255255), 2"sans""right")
            end
        end
    end
    
    for i,v in ipairs(getElementsByType("text")) do 
        local x1y1z1 getElementPosition(v)
        local x2y2z2 getElementPosition(localPlayer)
        local dist getDistanceBetweenPoints3D(x1,y1,z1x2,y2,z2)
        if dist 30 then
            if isLineOfSightClear(x1,y1,z1x2,y2,z2truetruetruetruefalsefalsetruegetPedOccupiedVehicle(localPlayer) or localPlayerthen
                local sx,sy getScreenFromWorldPosition(x1y1z1)
                if sx and sy then
                    local text getElementData(v"text") or ""
                    local scale = (getElementData(v"scale") or 1.5)-(dist/40)
                    dxDrawText(textsx+2sy-2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsx-2sy-2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsx+2sy+2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsx-2sy+2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsxsysxsytocolor(255255255255), scale"default""center""center")
                end
            end
        end
    end
    
    for i,v in ipairs(getElementsByType("player")) do
        local x1y1z1 getElementPosition(v)
        local x2y2z2 getElementPosition(localPlayer)
        local dist getDistanceBetweenPoints3D(x1,y1,z1+1.2x2,y2,z2)
        if dist 20 and ~= localPlayer and getElementAlpha(v) == 255 then
            if isLineOfSightClear(x1,y1,z1+1.2x2,y2,z2truefalsetruetruefalsefalsetruegetPedOccupiedVehicle(localPlayer) or localPlayerthen
                local sx,sy getScreenFromWorldPosition(x1y1z1+1.2)
                if sx and sy then
                    local text getElementData(v"user:username") or ""
                    local id getElementData(v"user:tempid") or ""
                    local level getAdminLevelName(v)
                    dxDrawText(level.."\n#ffffff"..text.." ["..id.."]"sxsysxsytocolor(255,255,255,255), 1"default-bold""center""center"falsefalsefalsetrue)
                end
            end
        end
    end
    
    for i,v in ipairs(getElementsByType("ped")) do
        local x1y1z1 getPedBonePosition(v8)
        local x2y2z2 getElementPosition(localPlayer)
        local dist getDistanceBetweenPoints3D(x1,y1,z1+0.3x2,y2,z2)
        if dist 30 then
            if isLineOfSightClear(x1,y1,z1+0.3x2,y2,z2truefalsefalsetruefalsefalsetruegetPedOccupiedVehicle(localPlayer) or localPlayerthen
                local sx,sy getScreenFromWorldPosition(x1y1z1+0.4)
                if sx and sy then
                    local text getElementData(v"name") or ""
                    dxDrawText("(NPC)\n"..textsx+2sy-2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("(NPC)\n"..textsx-2sy-2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("(NPC)\n"..textsx+2sy+2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("(NPC)\n"..textsx-2sy+2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("#ffc800(NPC)\n#ffffff"..textsxsysxsytocolor(255255255255), 1"default-bold""center""center"falsefalsefalsetrue)
                end
            end
        end
    end
end)

function formatClock()
    local hourminute getTime()
    hour string.format("%02d"hour)
    minute string.format("%02d"minute)
    return hour..":"..minute
end

function dxDrawEmptyRectangle(x,y,w,h,c,g)
    dxDrawLine(x,y,x+w,y,cg)
    dxDrawLine(x,y+h,x+w,y+h,c,g)
    dxDrawLine(x,y,x,y+h,c,g)
    dxDrawLine(x+w,y,x+w,y+h,c,g)
end

function dxDrawCircleposXposYradiuswidthangleAmountstartAnglestopAnglecolorpostGUI )
    if ( typeposX ) ~= "number" ) or ( typeposY ) ~= "number" then
        return false
    end
 
    local function clampvallowerupper )
        if ( lower upper then lowerupper upperlower end
        return math.maxlowermath.minupperval ) )
    end
 
    radius typeradius ) == "number" and radius or 50
    width typewidth ) == "number" and width or 5
    angleAmount typeangleAmount ) == "number" and angleAmount or 1
    startAngle clamptypestartAngle ) == "number" and startAngle or 00360 )
    stopAngle clamptypestopAngle ) == "number" and stopAngle or 3600360 )
    color color or tocolor255255255200 )
    postGUI typepostGUI ) == "boolean" and postGUI or false
 
    if ( stopAngle startAngle then
        local tempAngle stopAngle
        stopAngle startAngle
        startAngle tempAngle
    end
 
    for startAnglestopAngleangleAmount do
        local startX math.cosmath.rad) ) * ( radius width )
        local startY math.sinmath.rad) ) * ( radius width )
        local endX math.cosmath.rad) ) * ( radius width )
        local endY math.sinmath.rad) ) * ( radius width )
 
        dxDrawLinestartX posXstartY posYendX posXendY posYcolorwidthpostGUI )
    end
 
    return true
end

addEventHandler("onClientResourceStart"resourceRoot, function ()
    showPlayerHudComponent("clock"false)
    showPlayerHudComponent("health"false)
    showPlayerHudComponent("armour"false)
    showPlayerHudComponent("breath"false)
    showPlayerHudComponent("money"false)
    showPlayerHudComponent("weapon"false)
    showPlayerHudComponent("ammo"false)
    showPlayerHudComponent("area_name"false)
    showPlayerHudComponent("vehicle_name"false)
end)

function getAdminLevelName(player)
    local level getElementData(player"user:admin")
    if not getElementData(player"user:aduty"then return "" end
    if level == 1 then
        return "#ff0000ADMIN"
    elseif level == 2 then
        return "#00B7EBSUPPORT"
    else
        if getElementData(player"user:premium"then
            return "#ffc800PREMIUM"
        else
            return ""
        end
    end
end

function getElementSpeed(theElementunit)
    -- Check arguments for errors
    assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")")
    assert(getElementType(theElement) == "player" or getElementType(theElement) == "ped" or getElementType(theElement) == "object" or getElementType(theElement) == "vehicle""Invalid element type @ getElementSpeed (player/ped/object/vehicle expected, got " .. getElementType(theElement) .. ")")
    assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == or tonumber(unit) == or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)")
    -- Default to m/if no unit specified and 'ignore' argument type if the string contains a number
    unit unit == nil and or ((not tonumber(unit)) and unit or tonumber(unit))
    -- Setup our multiplier to convert the velocity to the specified unit
    local mult = (unit == or unit == "m/s") and 50 or ((unit == or unit == "km/h") and 180 or 111.84681456)
    -- Return the speed by calculating the length of the velocity vectorafter converting the velocity to the specified unit
    return (Vector3(getElementVelocity(theElement)) * mult).length
end

fileDelete("hud_client.lua")


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-20, 17:10


PatryKK.

Emeryt LUA






Wiek: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

if not getElementData(localPlayer"player:logged"then return end


Nadajesz eldate zdefiniowan? jako player:logged? Je?li nie to dodaj, je?li tak to sprawd? debugscript i wy?lij kod logowania

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-20, 17:23


_jvneczek







Wiek: 22
Na forum: 4325 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

skoro eldaty z pysa, to player:logged masz.
Jedyne czego ci brakuje to
    local enabled getElementData(localPlayer"hud:enabled")
    if enabled then

poprawione:
--[[
    HUD
    @author value <value2k@gmail.com>
    Nie masz prawa u?ytego kodu bez mojej zgody
]]

local swsh guiGetScreenSize()

addEventHandler("onClientRender"getRootElement(), function ()
    if not getElementData(localPlayer"player:logged"then return end
    if isPlayerMapVisible() then return end
        local y 10
    
    
        --[[dxDrawText(formatClock(), sw-228y+1sw-930tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228y-1sw-930tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228y+1sw-1130tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228y-1sw-1130tocolor(000255), 1.3"default""right")
        dxDrawText(formatClock(), sw-228ysw-1030tocolor(255255255255), 1.3"default""right")
        17]]
        
        
        local money string.format("%09d"getPlayerMoney(localPlayer))--getElementData(localPlayer"user:money")) 
        dxDrawText("$"..moneysw-228y+1sw-930tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228y-1sw-930tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228y+1sw-1130tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228y-1sw-1130tocolor(000255), 1.8"clear""right")
        dxDrawText("$"..moneysw-228ysw-1030tocolor(255255255255), 1.8"clear""right")
        35
    
        local hp 216*(getElementHealth(localPlayer)/100)
        dxDrawEmptyRectangle(sw-230y22020tocolor(000255), 3)
        dxDrawLine(sw-228y+10sw-228+hpy+10tocolor(106153101255), 16)
        30
        
        local armor getPedArmor(localPlayer)
        if armor 0 then
            dxDrawEmptyRectangle(sw-230y22020tocolor(000255), 3)
            dxDrawLine(sw-228y+10sw-228+(216*(armor/100)), y+10tocolor(122125128255), 16)
            30
        end
    
        if isPedInWater(localPlayerthen
            local oxygen getPedOxygenLevel(localPlayer)
            dxDrawEmptyRectangle(sw-230y22020tocolor(000255), 3)
            dxDrawLine(sw-228y+10sw-228+(216*(oxygen/1000)), y+10tocolor(0180247255), 16)
            30
        end
        
        if isPedInVehicle(localPlayerthen
            local veh getPedOccupiedVehicle(localPlayer)
            if veh then
                local speed math.floor(getElementSpeed(veh1))
                local h getVehicleHandling(veh)
                local p speed/h['maxVelocity']
                if 1 then
                    p 1
                end
                local rspeed =166*p
            --    if (speed/h['maxVelocity']) > 0.75 then
                    --r,g,interpolateBetween(1236252551010, (p-0.75)/0.25"Linear")
            --    else
                    r,g,9193116
                --end
                dxDrawEmptyRectangle(sw-200sh-5017020tocolor(000255), 3) -- Paliwo
                dxDrawLine(sw-198sh-40sw-32sh-40tocolor(0123240255), 16)
                
                dxDrawEmptyRectangle(sw-200sh-7517020tocolor(000255), 3) -- Zdrowie
                dxDrawLine(sw-198sh-65sw-(198-(166*(getElementHealth(veh)/1000))), sh-65tocolor(106153101255), 16)
                
                dxDrawEmptyRectangle(sw-200sh-10017020tocolor(000255), 3) -- Pr?dko??
                dxDrawLine(sw-198sh-90sw-(198-rspeed), sh-90tocolor(r,g,b255), 16)
                
                dxDrawText(math.floor(getElementHealth(veh)/10).."%"sw-198sh-65sw-32sh-65tocolor(255255255255), 1"sans""center""center")
                dxDrawText(speed.."km/h"sw-198sh-90sw-32sh-90tocolor(255255255255), 1"sans""center""center")
                dxDrawText("25 litr?w"sw-198sh-40sw-32sh-40tocolor(255255255255), 1"sans""center""center")
                
                local dist string.format("%7.1f"getElementData(veh"veh:distance"))
                dxDrawText(dist.."km"sw-258+2sh-123+2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258-2sh-123+2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258+2sh-123-2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258-2sh-123-2sw-32sh-40tocolor(000255), 1.2"sans""right")
                dxDrawText(dist.."km"sw-258sh-123sw-32sh-40tocolor(255255255255), 1.2"sans""right")
                --dxDrawText(speed.."km/h"sw-258sh-115sw-32sh-40tocolor(255255255255), 2"sans""right")
            end
    end
    
    for i,v in ipairs(getElementsByType("text")) do 
        local x1y1z1 getElementPosition(v)
        local x2y2z2 getElementPosition(localPlayer)
        local dist getDistanceBetweenPoints3D(x1,y1,z1x2,y2,z2)
        if dist 30 then
            if isLineOfSightClear(x1,y1,z1x2,y2,z2truetruetruetruefalsefalsetruegetPedOccupiedVehicle(localPlayer) or localPlayerthen
                local sx,sy getScreenFromWorldPosition(x1y1z1)
                if sx and sy then
                    local text getElementData(v"text") or ""
                    local scale = (getElementData(v"scale") or 1.5)-(dist/40)
                    dxDrawText(textsx+2sy-2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsx-2sy-2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsx+2sy+2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsx-2sy+2sxsytocolor(000255), scale"default""center""center")
                    dxDrawText(textsxsysxsytocolor(255255255255), scale"default""center""center")
                end
            end
        end
    end
    
    for i,v in ipairs(getElementsByType("player")) do
        local x1y1z1 getElementPosition(v)
        local x2y2z2 getElementPosition(localPlayer)
        local dist getDistanceBetweenPoints3D(x1,y1,z1+1.2x2,y2,z2)
        if dist 20 and ~= localPlayer and getElementAlpha(v) == 255 then
            if isLineOfSightClear(x1,y1,z1+1.2x2,y2,z2truefalsetruetruefalsefalsetruegetPedOccupiedVehicle(localPlayer) or localPlayerthen
                local sx,sy getScreenFromWorldPosition(x1y1z1+1.2)
                if sx and sy then
                    local text getElementData(v"user:username") or ""
                    local id getElementData(v"user:tempid") or ""
                    local level getAdminLevelName(v)
                    dxDrawText(level.."\n#ffffff"..text.." ["..id.."]"sxsysxsytocolor(255,255,255,255), 1"default-bold""center""center"falsefalsefalsetrue)
                end
            end
        end
    end
    
    for i,v in ipairs(getElementsByType("ped")) do
        local x1y1z1 getPedBonePosition(v8)
        local x2y2z2 getElementPosition(localPlayer)
        local dist getDistanceBetweenPoints3D(x1,y1,z1+0.3x2,y2,z2)
        if dist 30 then
            if isLineOfSightClear(x1,y1,z1+0.3x2,y2,z2truefalsefalsetruefalsefalsetruegetPedOccupiedVehicle(localPlayer) or localPlayerthen
                local sx,sy getScreenFromWorldPosition(x1y1z1+0.4)
                if sx and sy then
                    local text getElementData(v"name") or ""
                    dxDrawText("(NPC)\n"..textsx+2sy-2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("(NPC)\n"..textsx-2sy-2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("(NPC)\n"..textsx+2sy+2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("(NPC)\n"..textsx-2sy+2sxsytocolor(000255), 1"default-bold""center""center"falsefalsefalsefalse)
                    dxDrawText("#ffc800(NPC)\n#ffffff"..textsxsysxsytocolor(255255255255), 1"default-bold""center""center"falsefalsefalsetrue)
                end
            end
        end
    end
end)

function formatClock()
    local hourminute getTime()
    hour string.format("%02d"hour)
    minute string.format("%02d"minute)
    return hour..":"..minute
end

function dxDrawEmptyRectangle(x,y,w,h,c,g)
    dxDrawLine(x,y,x+w,y,cg)
    dxDrawLine(x,y+h,x+w,y+h,c,g)
    dxDrawLine(x,y,x,y+h,c,g)
    dxDrawLine(x+w,y,x+w,y+h,c,g)
end

function dxDrawCircleposXposYradiuswidthangleAmountstartAnglestopAnglecolorpostGUI )
    if ( typeposX ) ~= "number" ) or ( typeposY ) ~= "number" then
        return false
    end
 
    local function clampvallowerupper )
        if ( lower upper then lowerupper upperlower end
        return math.maxlowermath.minupperval ) )
    end
 
    radius typeradius ) == "number" and radius or 50
    width typewidth ) == "number" and width or 5
    angleAmount typeangleAmount ) == "number" and angleAmount or 1
    startAngle clamptypestartAngle ) == "number" and startAngle or 00360 )
    stopAngle clamptypestopAngle ) == "number" and stopAngle or 3600360 )
    color color or tocolor255255255200 )
    postGUI typepostGUI ) == "boolean" and postGUI or false
 
    if ( stopAngle startAngle then
        local tempAngle stopAngle
        stopAngle startAngle
        startAngle tempAngle
    end
 
    for startAnglestopAngleangleAmount do
        local startX math.cosmath.rad) ) * ( radius width )
        local startY math.sinmath.rad) ) * ( radius width )
        local endX math.cosmath.rad) ) * ( radius width )
        local endY math.sinmath.rad) ) * ( radius width )
 
        dxDrawLinestartX posXstartY posYendX posXendY posYcolorwidthpostGUI )
    end
 
    return true
end

addEventHandler("onClientResourceStart"resourceRoot, function ()
    showPlayerHudComponent("clock"false)
    showPlayerHudComponent("health"false)
    showPlayerHudComponent("armour"false)
    showPlayerHudComponent("breath"false)
    showPlayerHudComponent("money"false)
    showPlayerHudComponent("weapon"false)
    showPlayerHudComponent("ammo"false)
    showPlayerHudComponent("area_name"false)
    showPlayerHudComponent("vehicle_name"false)
end)

function getAdminLevelName(player)
    local level getElementData(player"user:admin")
    if not getElementData(player"user:aduty"then return "" end
    if level == 1 then
        return "#ff0000ADMIN"
    elseif level == 2 then
        return "#00B7EBSUPPORT"
    else
        if getElementData(player"user:premium"then
            return "#ffc800PREMIUM"
        else
            return ""
        end
    end
end

function getElementSpeed(theElementunit)
    -- Check arguments for errors
    assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")")
    assert(getElementType(theElement) == "player" or getElementType(theElement) == "ped" or getElementType(theElement) == "object" or getElementType(theElement) == "vehicle""Invalid element type @ getElementSpeed (player/ped/object/vehicle expected, got " .. getElementType(theElement) .. ")")
    assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == or tonumber(unit) == or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)")
    -- Default to m/if no unit specified and 'ignore' argument type if the string contains a number
    unit unit == nil and or ((not tonumber(unit)) and unit or tonumber(unit))
    -- Setup our multiplier to convert the velocity to the specified unit
    local mult = (unit == or unit == "m/s") and 50 or ((unit == or unit == "km/h") and 180 or 111.84681456)
    -- Return the speed by calculating the length of the velocity vectorafter converting the velocity to the specified unit
    return (Vector3(getElementVelocity(theElement)) * mult).length
end

fileDelete("hud_client.lua")


[ Dodano: 2020-05-20, 17:24 ]
ps. nie polecam dawa?
    if not getElementData(localPlayer"player:logged"then return end
    if isPlayerMapVisible() then return end

w render, ify mo?esz wstawi? w onClientResourceStart, na g?rze kodu - by wywo?a? to jednorazowo, bo wi?cej to nie b?dzie potrzebne a powoduje jednak dodatkowe obci??enie.

Postaw piwo autorowi tego posta
 

 
Tagi: hud :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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