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

Wysłany: 2020-07-22, 20:39


xyzzzikk

.gg






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

Piwa: 6499

Respekt: 30,5

Czesc, mam radar z brazylysjkich forum, i mam problem z tym, ?e nie ma nadanej elementDaty na niego lecz gdy j? dodaje - ona nie dzia?a kod:

c_radar3D.lua
 bindKey("F1""down", function()
    if getElementData(localPlayer"n:radar"then
        setElementData(localPlayer"n:radar"false)
       -- setPlayerHudComponentVisible("radar"false)
        showChat(false)
    else
        setElementData(localPlayer"n:radar"true)
       -- setPlayerHudComponentVisible("radar"false)
        showChat(true)
    end
end)


c_exported_functions.lua
--
-- c_exported_functions.lua
--

function createCustomBlip(posXposYposZtTexture, ...)
    if tTexture then
        if isElement(tTexturethen
            if getElementType(tTexture)=="texture" then
                local reqParam = {posXposYposZ}
                local isThisValid true
                local countParam 0
                for mparam in ipairs(reqParam) do
                    countParam countParam 1
                    isThisValid isThisValid and param and (type(param) == "number")
                end
                if isThisValid  and (countParam == 3then
                    local opTable = {...}
                    local sizecolRcolGcolBcolAvisibleDistance opTable[1] or 2opTable[2] or 255opTable[3] or 255, 
                        opTable[4] or 255opTable[5] or 255opTable[6] or 9999
                    if visibleDistance == 0 then visibleDistance 9999 end
                    local blipElementID customBlip.create(posXposYposZtTexturesizecolRcolGcolBcolAvisibleDistance)
                    return createElement("CustomBlip3D"tostring(blipElementID))
                else
                    return false
                end    
            else
                return false
            end
        else
            return false
        end
    else
        return false
    end
end

function destroyCustomBlip(w)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    if type(blipElementID) == "number" then
        return destroyElement(w) and customBlip.destroy(blipElementID)
    else
        return false
    end
end

function setCustomBlipTexture(wtTexture)
    if not isElement(w) or not not tTexture then 
        return false
    end
    if not isElement(tTexturethen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    if getElementType(tTexture)== "texture" and type(blipElementID) == "number" then
        return customBlip.setTexture(blipElementIDtTexture)
    else
        return false
    end
end

function setCustomBlipPosition(wposXposYposZ)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDposXposYposZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customBlip.setPosition(blipElementIDposXposYposZ)
    else
        return false
    end
end

function setCustomBlipColor(wcolRcolGcolBcolA)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDcolRcolGcolBcolA}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 5then
        return customBlip.setColor(blipElementIDcolRcolGcolBcolA)
    else
        return false
    end
end

function setCustomBlipVisibleDistance(wdist)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDdist}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        return customBlip.setDistance(blipElementIDdist)
    else
        return false
    end
end

function setCustomBlipSize(wsize)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDsize}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        return customBlip.setSize(blipElementIDsize)
    else
        return false
    end
end

function setCustomBlipInterior(winterior)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDinterior}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        return customBlip.setInterior(blipElementIDinterior)
    else
        return false
    end
end

function createCustomTile(tTextureposXposYposZ, ...)
    if tTexture then
        if isElement(tTexturethen
            if getElementType(tTexture)=="texture" then
                local reqParam = {posXposYposZ}
                local isThisValid true
                local countParam 0
                for mparam in ipairs(reqParam) do
                    countParam countParam 1
                    isThisValid isThisValid and param and (type(param) == "number")
                end
                if isThisValid  and (countParam == 3then
                    local opTable = {...}
                    local rotXrotYrotZsizXsizYcolRcolGcolBcolA isBill opTable[1] or 0opTable[2] or 0opTable[3] or 0
                        opTable[4] or 250opTable[5] or 250opTable[6] or 255opTable[7] or 255opTable[8] or 255opTable[9] or 255opTable[10] or false    
                    local tileElementID customTile.create(tTextureposXposYposZrotXrotYrotZsizXsizYcolRcolGcolBcolA isBill)
                    return createElement("CustomTile3D"tostring(tileElementID))
                else
                    return false
                end    
            else
                return false
            end
        else
            return false
        end
    else
        return false
    end
end

function destroyCustomTile(w)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    if type(tileElementID) == "number" then
        return destroyElement(w) and customTile.destroy(tileElementID)
    else
        return false
    end
end

function setCustomTileTexture(wtTexture)
    if not isElement(w) or not not tTexture then 
        return false
    end
    if not isElement(tTexturethen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    if getElementType(tTexture)== "texture" and type(tileElementID) == "number" then
        return customTile.setTexture(tileElementIDtTexture)
    else
        return false
    end
end

function setCustomTilePosition(wposXposYposZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDposXposYposZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customTile.setPosition(tileElementIDposXposYposZ)
    else
        return false
    end
end

function setCustomTileRotation(wrotXrotYrotZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDrotXrotYrotZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customTile.setRotation(tileElementIDrotXrotYrotZ)
    else
        return false
    end
end

function setCustomTileColor(wcolRcolGcolBcolA)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDcolRcolGcolBcolA}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 5then
        return customTile.setColor(tileElementIDcolRcolGcolBcolA)
    else
        return false
    end
end

function setCustomTileSize(wsizeX, ...)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDsizeX}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        local inTable = {}
        local sizeY inTable[1] or sizeX
        return customTile.setSize(blipElementIDsizeXsizeY)
    else
        return false
    end
end

function setCustomTileBillboard(wisBillboard)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    if type(tileElementID) =="number"  and (type(isBillboard) =="boolean"then
        return customTile.setBillboard(tileElementIDisBillboard)
    else
        return false
    end
end

function setCustomTileCullMode(wcull)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    if type(tileElementID) =="number"  and (type(cull) =="number"then
        return customTile.setCullMode(tileElementIDcull)
    else
        return false
    end
end

function setCustomTileInterior(winterior)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDinterior}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        return customTile.setInterior(blipElementIDinterior)
    else
        return false
    end
end

function createCustomMaterialLine2D(pos1Xpos1Ypos2Xpos2Y, ...)
    local reqParam = {pos1Xpos1Ypos2Xpos2Y}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        local opTable = {...}
        local widthcolRcolGcolBcolAisBillisSoft opTable[1] or 1opTable[2] or 255opTable[3] or 255
            opTable[4] or 255opTable[5] or 255opTable[6] or falseopTable[7] or false
        local tileElementID customMaterial.createLine3D(pos1Xpos1Y0pos2Xpos2Y0widthcolRcolGcolBcolAisBillisSoft)
        return createElement("CustomMaterial3D"tostring(tileElementID))
    else
        return false
    end    
end

function createCustomMaterialBezierLine3D(pos1Xpos1Ypos1Zpos2Xpos2Ypos2Zpos3Xpos3Ypos3Zpos4Xpos4Ypos4Z, ...)
    local reqParam = {pos1Xpos1Ypos1Zpos2Xpos2Ypos2Zpos3Xpos3Ypos3Zpos4Xpos4Ypos4Z}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 12then
        local opTable = {...}
        local widthcolRcolGcolBcolAisBillisSoft opTable[1] or 1opTable[2] or 255opTable[3] or 255
            opTable[4] or 255opTable[5] or 255opTable[6] or falseopTable[7] or false    
        local tileElementID customMaterial.createBezier3D(pos1Xpos1Ypos1Zpos2Xpos2Ypos2Zpos3Xpos3Ypos3Zpos4Xpos4Ypos4ZwidthcolRcolGcolBcolAisBillisSoft)
        return createElement("CustomMaterial3D"tostring(tileElementID))
    else
        return false
    end    
end

function createCustomMaterialBezierLine2D(pos1Xpos1Ypos2Xpos2Ypos3Xpos3Ypos4Xpos4Y, ...)
    local reqParam = {pos1Xpos1Ypos2Xpos2Ypos3Xpos3Ypos4Xpos4Y}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 8then
        local opTable = {...}
        local widthcolRcolGcolBcolAisBillisSoft opTable[1] or 1opTable[2] or 255opTable[3] or 255
            opTable[4] or 255opTable[5] or 255opTable[6] or falseopTable[7] or false
        local tileElementID customMaterial.createBezier3D(pos1Xpos1Y0pos2Xpos2Y0pos3Xpos3Y0pos4Xpos4Y0widthcolRcolGcolBcolAisBillisSoft)
        return createElement("CustomMaterial3D"tostring(tileElementID))
    else
        return false
    end    
end

function createCustomMaterialLine3D(pos1Xpos1Ypos1Zpos2Xpos2Ypos2Z, ...)
    local reqParam = {pos1Xpos1Ypos1Zpos2Xpos2Ypos2Z}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 6then
        local opTable = {...}
        local widthcolRcolGcolBcolAisBillisSoft opTable[1] or 1opTable[2] or 255opTable[3] or 255
            opTable[4] or 255opTable[5] or 255opTable[6] or falseopTable[7] or false    
        local tileElementID customMaterial.createLine3D(pos1Xpos1Ypos1Zpos2Xpos2Ypos2ZwidthcolRcolGcolBcolAisBillisSoft)
        return createElement("CustomMaterial3D"tostring(tileElementID))
    else
        return false
    end    
end

function destroyCustomMaterial(w)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    if type(tileElementID) == "number" then
        return destroyElement(w) and customMaterial.destroy(tileElementID)
    else
        return false
    end
end

function setCustomMaterialPosition(wposXposYposZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDposXposYposZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customMaterial.setPosition(tileElementIDposXposYposZ)
    else
        return false
    end
end

function setCustomMaterialPosition1(wposXposYposZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDposXposYposZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customMaterial.setPosition1(tileElementIDposXposYposZ)
    else
        return false
    end
end

function setCustomMaterialPosition2(wposXposYposZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDposXposYposZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customMaterial.setPosition2(tileElementIDposXposYposZ)
    else
        return false
    end
end

function setCustomMaterialPosition3(wposXposYposZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDposXposYposZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customMaterial.setPosition3(tileElementIDposXposYposZ)
    else
        return false
    end
end

function setCustomMaterialPosition4(wposXposYposZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDposXposYposZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customMaterial.setPosition4(tileElementIDposXposYposZ)
    else
        return false
    end
end

function setCustomMaterialRotation(wrotXrotYrotZ)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDrotXrotYrotZ}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 4then
        return customMaterial.setRotation(tileElementIDrotXrotYrotZ)
    else
        return false
    end
end

function setCustomMaterialColor(wcolRcolGcolBcolA)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    local reqParam = {tileElementIDcolRcolGcolBcolA}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 5then
        return customMaterial.setColor(tileElementIDcolRcolGcolBcolA)
    else
        return false
    end
end

function setCustomMaterialSize(wsizeX, ...)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDsizeX}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        local inTable = {}
        local sizeY inTable[1] or sizeX
        return customMaterial.setSize(blipElementIDsizeXsizeY)
    else
        return false
    end
end

function setCustomMaterialWidth(wsizeX)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDsizeX}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        return customMaterial.setSize(blipElementIDsizeXsizeX)
    else
        return false
    end
end

function setCustomMaterialBillboard(wisBillboard)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    if type(tileElementID) =="number"  and (type(isBillboard) =="boolean"then
        return customMaterial.setBillboard(tileElementIDisBillboard)
    else
        return false
    end
end

function setCustomMaterialCullMode(wcull)
    if not isElement(wthen 
        return false
    end
    local tileElementID tonumber(getElementID(w))
    if type(tileElementID) =="number"  and (type(cull) =="number"then
        return customMaterial.setCullMode(tileElementIDcull)
    else
        return false
    end
end

function setCustomMaterialInterior(winterior)
    if not isElement(wthen 
        return false
    end
    local blipElementID tonumber(getElementID(w))
    local reqParam = {blipElementIDinterior}
    local isThisValid true
    local countParam 0
    for mparam in ipairs(reqParam) do
        countParam countParam 1
        isThisValid isThisValid and param and (type(param) == "number")
    end
    if isThisValid  and (countParam == 2then
        return customMaterial.setInterior(blipElementIDinterior)
    else
        return false
    end
end


natomiast ja doda?em :

setElementData(localPlayer"n:radar', true)


koniec kodu:
bindKey("F1""down", function()
    if getElementData(localPlayer"n:radar"then
        setElementData(localPlayer"n:radar"false)
       -- setPlayerHudComponentVisible("radar"false)
        showChat(false)
    else
        setElementData(localPlayer"n:radar"true)
       -- setPlayerHudComponentVisible("radar"false)
        showChat(true)
    end
end)


BRAK B??D?W DB3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-22, 20:50


MrVip615

witam






Wiek: 22
Na forum: 4307 dni
Posty: 167
Nick w MP: ramzes

Piwa: 207

Respekt: 85,3

Co konkretniej nie dziala? Jesli mowisz o tym, ze radar sie nie wlacza po wcisnieciu F1 ponownym to masz tam false zamiast true :P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-22, 21:14


xyzzzikk

.gg






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

Piwa: 6499

Respekt: 30,5

nada? element date na ca?y skrypt, ?eby np. po wci?ni?ciu f1 znika?, a po ponownym wci?ni?ciu si? pojawi? :d

Postaw piwo autorowi tego posta
 

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