Szerző Téma: getElementData argument 1 got nil  (Megtekintve 985 alkalommal)

getElementData argument 1 got nil
« Dátum: 2016. augusztus 29. - 21:36:10 »
0 Show voters
Sziasztok! Tudom hogy mostanában sokat kérdezek , de megint bajba ütköztem! (Debug: ..../client.lua:11: Bad Argument @ \'getElementData\' [Excpected element at argument 1. got nil )
Client-Side:
 

function suska ()
setElementData (thePlayer, \"mobillap\", 1)
end
addEventHandler (\"onClientResourceStart\", suska)
local screenW, screenH = guiGetScreenSize()
addEventHandler(\"onClientRender\", root,
    function()
lap = getElementData (thePlayer, \"mobillap\")
showCursor(true)
if lap == 1 then --kezdőoldal
        dxDrawImage(screenW * 0.8490, screenH * 0.3333, 259, 522, \":hud/sonyspb1.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(screenW * 0.8542, screenH * 0.3426, 40, 34, \":hud/kameraicon.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(screenW * 0.8490, screenH * 0.7333, 49, 54, \":hud/hivasicon.png\", 0, 0, 0, tocolor(118, 38, 216, 255), false)
        dxDrawImage(1625, 918, 268, 4, \":hud/sonyspgreenled.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1625, 918, 268, 4, \":hud/sonysppurpleled.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1625, 918, 268, 4, \":hud/sonyspredled.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
elseif lap == 2 then
 
outputChatBox(\"Müködik a rohadt test....\",thePlayer)
 
end -- lapos elágazás vége
 
--ezek mindig itt vannak......
dxDrawImage(screenW * 0.5740, screenH * 0.2065, 1377, 814, \":hud/sonysp.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawLine(1630 - 1, 846 - 1, 1630 - 1, 882, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(1889, 846 - 1, 1630 - 1, 846 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(1630 - 1, 882, 1889, 882, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(1889, 882, 1889, 846 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.8490, screenH * 0.7833, 259, 36, tocolor(1, 0, 0, 255), false)
        dxDrawRectangle(screenW * 0.8490, screenH * 0.3324, 259, 11, tocolor(1, 1, 0, 200), false)
        dxDrawImage(1829, 846, 40, 33, \":hud/1.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1649, 847, 40, 35, \":hud/2.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1739, 846, 40, 36, \":hud/3.png\", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    end
)
 
    function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan(screenW * 0.8490, screenH * 0.7333, 49, 54, absX, absY)  then
                    setElementData(thePlayer, \"mobillap\", 2)
                end
            end
        end
        ) 

getElementData argument 1 got nil
« Válasz #1 Dátum: 2016. augusztus 29. - 21:58:01 »
0 Show voters
Írd át localPlayer-re.

getElementData argument 1 got nil
« Válasz #2 Dátum: 2016. augusztus 29. - 22:07:01 »
0 Show voters
Oké megprobálom!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal