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

Wysłany: 2017-05-12, 15:23


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
db3
attempt to call global '3DResim' (a nil value)

ta funkcja

function _3DResim(TheElement,Image,distance,height,width,R,G,B,alpha)
        local xygetElementPosition(TheElement)
        local x2y2z2 getElementPosition(localPlayer)
        local distance distance or 20
        local height height or 1
        local width width or 1
                                local checkBuildings checkBuildings or true
                                local checkPeds checkPeds or false
                                local checkObjects checkObjects or true
                                local checkDummies checkDummies or true
                                local seeThroughStuff seeThroughStuff or false
                                local ignoreSomeObjectsForCamera ignoreSomeObjectsForCamera or false
                                local ignoredElement ignoredElement or nil
        if (isLineOfSightClear(xyzx2y2z2checkBuildingscheckPeds checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
          local sxsy getScreenFromWorldPosition(xyz+height)
          if(sx) and (sythen
            local distanceBetweenPoints getDistanceBetweenPoints3D(xyzx2y2z2)
            if(distanceBetweenPoints distancethen
              dxDrawMaterialLine3D(xyz+1+height-(distanceBetweenPoints/distance), xyz+heightImagewidth-(distanceBetweenPoints/distance), tocolor(or 255or 255or 255alpha or 255))
            end
          end
      end
  end

na samym pocz?tku jak edytowa?em to tam o endy si? k?uci?o , a teraz jak wyjecha?o mi z t? funkcj? to naprawd? nie potrafi?em se poradzi? .

gdyby kto? potrzebowa? wgl?d do ca?ego kodu


parkYerleri =  {}
park dxCreateTexture("Odznaki/dreamhack.png")
parkYerleri[1] = createMarker(1670.70520, -1706.1412415.60938"corona"12551850)
parkYerleri[2] = createMarker(1670.60999, -1707.6688215.60938"corona"12551850)
parkYerleri[3] = createMarker(1652.39282, -1706.3110415.609"corona"12551850)



function panelOrtala (center_window)
    local screenWscreenH guiGetScreenSize()
    local windowWwindowH guiGetSize(center_windowfalse)
    local x= (screenW windowW) /2,(screenH windowH) /2
    return guiSetPosition(center_windowxyfalse)
end

---Panel
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        PencerePark guiCreateWindow(00250255"Sklep"false)
        guiWindowSetSizable(PencereParkfalse)
        gridlistPark guiCreateGridList(1029280139falsePencerePark)
        guiGridListAddColumn(gridlistPark"CZ75"1)
        for 1do
            guiGridListAddRow(gridlistPark)
        end
        guiGridListSetItemText(gridlistPark01"Chc? zaparkowa?"falsefalse)
        guiGridListSetItemText(gridlistPark11"Nie chc? parkowa?"falsefalse)
        guiGridListSetItemColor(gridlistPark01772540255)
        guiGridListSetItemColor(gridlistPark1125500255)
        parket guiCreateButton(1017825128"Wybierz"falsePencerePark)
        guiSetFont(parket"default-bold-small")
        guiSetVisible(PencerePark,false)
        panelOrtalaPencerePark )
    end
)

function parkYeri()
  for i,v in ipairs(parkYerleri) do
  _3DResim(v,park);
  xygetElementPosition(v)
  dxDrawOctagon3D(x,y,z-0.811tocolor(0,255,255,255) )
end
end


addEventHandler("onClientRender"getRootElement(), parkYeri)
for i=1,500 do
end
addEventHandler('onClientMarkerHit'parkVerleri[i],
function(markerfunc)
if markerfunc ~= localPlayer then return end
guiSetVisible(PencerePark,true)
showCursor(true)
xygetElementPosition(parkYerleri[i])
setElementPosition(hitElementx,y,z)
setElementFrozen(hitElementtrue)
end
)


function _3DResim(TheElement,Image,distance,height,width,R,G,B,alpha)
        local xygetElementPosition(TheElement)
        local x2y2z2 getElementPosition(localPlayer)
        local distance distance or 20
        local height height or 1
        local width width or 1
                                local checkBuildings checkBuildings or true
                                local checkPeds checkPeds or false
                                local checkObjects checkObjects or true
                                local checkDummies checkDummies or true
                                local seeThroughStuff seeThroughStuff or false
                                local ignoreSomeObjectsForCamera ignoreSomeObjectsForCamera or false
                                local ignoredElement ignoredElement or nil
        if (isLineOfSightClear(xyzx2y2z2checkBuildingscheckPeds checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
          local sxsy getScreenFromWorldPosition(xyz+height)
          if(sx) and (sythen
            local distanceBetweenPoints getDistanceBetweenPoints3D(xyzx2y2z2)
            if(distanceBetweenPoints distancethen
              dxDrawMaterialLine3D(xyz+1+height-(distanceBetweenPoints/distance), xyz+heightImagewidth-(distanceBetweenPoints/distance), tocolor(or 255or 255or 255alpha or 255))
            end
          end
      end
  end
  function dxDrawOctagon3D(xyzradiuswidthcolor)
  if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" then
    return false
  end

  local radius radius or 1
  local radius2 radius/math.sqrt(2)
  local width width or 1
  local color color or tocolor(255,255,255,150)

  point = {}

    for i=1,do
      point[i] = {}
    end

    point[1].x
    point[1].y-radius
    point[2].x+radius2
    point[2].y-radius2
    point[3].x+radius
    point[3].y
    point[4].x+radius2
    point[4].y+radius2
    point[5].x
    point[5].y+radius
    point[6].x-radius2
    point[6].y+radius2
    point[7].x-radius
    point[7].y
    point[8].x-radius2
    point[8].y-radius2

  for i=1,do
    if ~= 8 then
      xyzx2y2z2 point[i].x,point[i].y,z,point[i+1].x,point[i+1].y,z
    else
      xyzx2y2z2 point[i].x,point[i].y,z,point[1].x,point[1].y,z
    end
    dxDrawLine3D(xyzx2y2z2colorwidth)
  end
  return true
end

function tik()
  local degisken guiGridListGetItemText gridlistParkguiGridListGetSelectedItem gridlistPark ), )
  if source == parket then
    if degisken == "Nie chc? parkowa?" then
  arac getPedOccupiedVehicle(localPlayer)
    guiSetVisible(PencerePark,false)
        setElementFrozen aracfalse )
    showCursor(false)
  end
  if degisken == "Chc? zaparkowa?" then
  arac getPedOccupiedVehicle(localPlayer)
    guiSetVisible(PencerePark,false)
        setElementFrozen aractrue )
    showCursor(false)
  end
end
end
addEventHandler("onClientGUIClick"getRootElement(), tik)


Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-12, 20:54


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466


parkYerleri =  {}
park dxCreateTexture("Odznaki/dreamhack.png")
parkYerleri[1] = createMarker(1670.70520, -1706.1412415.60938"corona"12551850)
parkYerleri[2] = createMarker(1670.60999, -1707.6688215.60938"corona"12551850)
parkYerleri[3] = createMarker(1652.39282, -1706.3110415.609"corona"12551850)



function panelOrtala (center_window)
    local screenWscreenH guiGetScreenSize()
    local windowWwindowH guiGetSize(center_windowfalse)
    local x= (screenW windowW) /2,(screenH windowH) /2
    return guiSetPosition(center_windowxyfalse)
end

---Panel
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        PencerePark guiCreateWindow(00250255"Sklep"false)
        guiWindowSetSizable(PencereParkfalse)
        gridlistPark guiCreateGridList(1029280139falsePencerePark)
        guiGridListAddColumn(gridlistPark"CZ75"1)
        for 1do
            guiGridListAddRow(gridlistPark)
        end
        guiGridListSetItemText(gridlistPark01"Chc? zaparkowa?"falsefalse)
        guiGridListSetItemText(gridlistPark11"Nie chc? parkowa?"falsefalse)
        guiGridListSetItemColor(gridlistPark01772540255)
        guiGridListSetItemColor(gridlistPark1125500255)
        parket guiCreateButton(1017825128"Wybierz"falsePencerePark)
        guiSetFont(parket"default-bold-small")
        guiSetVisible(PencerePark,false)
        panelOrtalaPencerePark )
    end
)

addEventHandler("onClientRender"getRootElement(), parkYeri)
for i=1,500 do
end
addEventHandler('onClientMarkerHit'parkVerleri[i],
function(markerfunc)
if markerfunc ~= localPlayer then return end
guiSetVisible(PencerePark,true)
showCursor(true)
xygetElementPosition(parkYerleri[i])
setElementPosition(hitElementx,y,z)
setElementFrozen(hitElementtrue)
end
)


function _3DResim(TheElement,Image,distance,height,width,R,G,B,alpha)
        local xygetElementPosition(TheElement)
        local x2y2z2 getElementPosition(localPlayer)
        local distance distance or 20
        local height height or 1
        local width width or 1
                                local checkBuildings checkBuildings or true
                                local checkPeds checkPeds or false
                                local checkObjects checkObjects or true
                                local checkDummies checkDummies or true
                                local seeThroughStuff seeThroughStuff or false
                                local ignoreSomeObjectsForCamera ignoreSomeObjectsForCamera or false
                                local ignoredElement ignoredElement or nil
        if (isLineOfSightClear(xyzx2y2z2checkBuildingscheckPeds checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
          local sxsy getScreenFromWorldPosition(xyz+height)
          if(sx) and (sythen
            local distanceBetweenPoints getDistanceBetweenPoints3D(xyzx2y2z2)
            if(distanceBetweenPoints distancethen
              dxDrawMaterialLine3D(xyz+1+height-(distanceBetweenPoints/distance), xyz+heightImagewidth-(distanceBetweenPoints/distance), tocolor(or 255or 255or 255alpha or 255))
            end
          end
      end
  end
  
  function parkYeri()
  for i,v in ipairs(parkYerleri) do
  _3DResim(v,park);
  xygetElementPosition(v)
  dxDrawOctagon3D(x,y,z-0.811tocolor(0,255,255,255) )
end
end

  function dxDrawOctagon3D(xyzradiuswidthcolor)
  if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" then
    return false
  end

  local radius radius or 1
  local radius2 radius/math.sqrt(2)
  local width width or 1
  local color color or tocolor(255,255,255,150)

  point = {}

    for i=1,do
      point[i] = {}
    end

    point[1].x
    point[1].y-radius
    point[2].x+radius2
    point[2].y-radius2
    point[3].x+radius
    point[3].y
    point[4].x+radius2
    point[4].y+radius2
    point[5].x
    point[5].y+radius
    point[6].x-radius2
    point[6].y+radius2
    point[7].x-radius
    point[7].y
    point[8].x-radius2
    point[8].y-radius2

  for i=1,do
    if ~= 8 then
      xyzx2y2z2 point[i].x,point[i].y,z,point[i+1].x,point[i+1].y,z
    else
      xyzx2y2z2 point[i].x,point[i].y,z,point[1].x,point[1].y,z
    end
    dxDrawLine3D(xyzx2y2z2colorwidth)
  end
  return true
end

function tik()
  local degisken guiGridListGetItemText gridlistParkguiGridListGetSelectedItem gridlistPark ), )
  if source == parket then
    if degisken == "Nie chc? parkowa?" then
  arac getPedOccupiedVehicle(localPlayer)
    guiSetVisible(PencerePark,false)
        setElementFrozen aracfalse )
    showCursor(false)
  end
  if degisken == "Chc? zaparkowa?" then
  arac getPedOccupiedVehicle(localPlayer)
    guiSetVisible(PencerePark,false)
        setElementFrozen aractrue )
    showCursor(false)
  end
end
end
addEventHandler("onClientGUIClick"getRootElement(), tik)


Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
MartinPanZycia
Wysłany: 2017-05-14, 09:48


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
teraz te db3
attempt to index global 'parkVerleri' (a nil value)

addEventHandler('onClientMarkerHit'parkVerleri[i],

zmieni? na

addEventHandler('onClientMarkerHit'parkYerleri[i],

?
My?l? ,?e wyst?pi?a tu liter?wka , zaraz to poprawi? i sprawdz? czy dzia?a .
Nadal nie dzia?a , tym razem z Eventami
Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil]
i podam linijke kt?ra obwi?zuje

addEventHandler("onClientRender"getRootElement(), parkYeri)

t? , oczywi?cie za pomoc nagrodz? ci? amited, :piwo:

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-14, 12:27


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8


Więcej informacji znajdziesz w Wikipedii MTA:

onClientMarkerHit
Musisz poda? element markera i funkcje w twoim przypadku markery to parkYereli 1,2,3 a funkcja to nazwa funkcji, kt?ra ma si? wykona? po wej?ciu w marker.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
MartinPanZycia
Wysłany: 2017-05-14, 20:54


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3728 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
marcin778,
przeciesz funckja jest podana

function parkYeri()
  for i,v in ipairs(parkYerleri) do
  _3DResim(v,park);
  xygetElementPosition(v)
  dxDrawOctagon3D(x,y,z-0.811tocolor(0,255,255,255) )
end
end

tylko z elementami tam nie rozumiem ...

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

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