Jump to content

Organizar os eventos 'DxDrawRetangle e DxDrawText'


Recommended Posts

addEventHandler("onClientRender", root,
    function()
        local item1 = getElementData(localPlayer,"inv:comida") or false
        local item2 = getElementData(localPlayer,"inv:agua") or false
        local item3 = getElementData(localPlayer,"inv:munição") or false
        if item1 >= 0  then
        dxDrawRectangle(350, 267, 73, 64, tocolor(6, 6, 6, 250), false)
        dxDrawText("Comida - "..item1, 350, 267, 423, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        end
        if item2 >= 0 then
        dxDrawRectangle(427, 267, 73, 64, tocolor(6, 6, 6, 250), false)
        dxDrawText("Água - "..item2, 427, 267, 500, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        end
        if item3 >= 0 then
        dxDrawRectangle(504, 267, 73, 64, tocolor(6, 6, 6, 250), false)
        dxDrawText("Munição - "..item3, 504, 267, 577, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
    end
    end
)

 

Estou tentando criar um inventário que organize os itens acima sem o uso do database, mysql ou sqlite, esse é apenas um exemplar, eu tenho muitas dúvidas e quero aprender a mexer com a função "for ... do", eu sei que é essencial nesse meu script.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...