Jump to content

[Notice Panel]


undefined

Recommended Posts

Im make a notice panel. But it's not work and not give error...

Help me pls... :(

local x,y = guiGetScreenSize() 
function mesaj( ) 
    mesajGrid = guiCreateGridList((x/2)-212, (y/2)-112, 424, 224, false) 
    guiSetAlpha(mesajGrid, 0.70) 
    guiSetVisible(mesajGrid, false) 
  
    editBox = guiCreateMemo(10, 10, 404, 72, "", false, mesajGrid) 
    send = guiCreateButton(138, 173, 79, 26, "Gönder", false, mesajGrid) 
    close = guiCreateButton(236, 173, 50, 26, "Kapat", false, mesajGrid) 
         
    reklamLab = guiCreateLabel(138, 199, 148, 21, "Hubbub Games", false, mesajGrid) 
    guiSetFont(reklamLab, "default-bold-small") 
    guiLabelSetHorizontalAlign(reklamLab, "center", false) 
    guiLabelSetVerticalAlign(reklamLab, "center") 
     
    fontGrid = guiCreateGridList(10, 85, 118, 111, false, mesajGrid) 
    guiGridListAddColumn(fontGrid, "Font", 0.7) 
    font = 
    { 
    {"Bankgothic","bankgothic"}, 
    {"Pricedown","pricedown"}, 
    {"Diploma","diploma"}, 
    {"Default-Bold","default-bold"}, 
    } 
  
    scaleGrid = guiCreateGridList(296, 85, 118, 111, false, mesajGrid) 
    guiGridListAddColumn(scaleGrid, "Scale", 0.7) 
    scale = 
    { 
    {"2.00",2.00}, 
    {"1.50",1.50}, 
    {"1.00",1.00}, 
    {"0.9",0.90}, 
    {"0.8",0.80}, 
    {"0.7",0.70}, 
    {"0.6",0.60}, 
    {"0.5",0.50}, 
    } 
     
    fontTamam = guiCreateButton(10, 199, 118, 17, "Tamam", false, mesajGrid) 
    boyutTamam = guiCreateButton(296, 199, 118, 17, "Tamam", false, mesajGrid) 
         
    addEventHandler ( "onClientGUIClick", send, oyuncu, false ) 
end 
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), mesaj ) 
  
function oyuncu ( button ) 
    if button == "left" then 
        local text = guiGetText ( editBox ) 
        local texts = dxDrawText("#f5fd00Notice: "..text, 10, 285, 790, 313, tocolor(255, 255, 255, 255), select2, select1, "center", "center", false, true, true, true, false) 
    end 
end 
  
function fontList() 
 guiGridListClear (fontGrid) 
    for i,font in ipairs(font) do 
    local row = guiGridListAddRow(fontGrid) 
    guiGridListSetItemText(fontGrid, row, 1, tostring(font[1]), false, false) 
    guiGridListSetItemData(fontGrid, row, 1, tostring(font[2])) 
    end 
end 
  
function scaleList() 
 guiGridListClear (scaleGrid) 
    for i,scale in ipairs(scale) do 
    local row = guiGridListAddRow(scaleGrid) 
    guiGridListSetItemText(scaleGrid, row, 1, tostring(scale[1]), false, false) 
    guiGridListSetItemData(scaleGrid, row, 1, tostring(scale[2])) 
    end 
end 
  
function select1() 
        if (source == fontTamam) then 
        local row, col = guiGridListGetSelectedItem(fontGrid)   
            if (row and col and row ~= -1 and col ~= -1) then 
            local fonts = tonumber(guiGridListGetItemData(fontGrid, row, 1)) 
                if model ~= "" then 
                dxSetFont(texts, font) 
                end 
            end 
      end 
end 
  
function select2() 
            if (source == boyutTamam) then 
            local row, col = guiGridListGetSelectedItem(scaleGrid)   
            if (row and col and row ~= -1 and col ~= -1) then 
            local scales = tonumber(guiGridListGetItemData(scaleGrid, row, 1)) 
                if model ~= "" then 
                dxSetSize(texts, scale) 
                end 
            end 
        end 
    end 
  
function mesajac() 
    if (guiGetVisible (mesajGrid) == true) then 
    guiSetVisible(mesajGrid, false) 
    showCursor(false) 
    elseif (guiGetVisible (mesajGrid) == false) then 
    guiSetVisible(mesajGrid, true) 
    showCursor(true) 
    end 
    end 
    bindKey ("K", "down", mesajac) 
     
function close() 
if source == close then 
guiSetVisible ( mesajGrid,false ) 
showCursor(false) 
end 
end 
  
addEventHandler("onClientGUIClick", root, fontList) 
addEventHandler("onClientGUIClick", root, scaleList) 
addEventHandler("onClientGUIClick", root, close) 
addEventHandler("onClientGUIClick", root, select1) 
addEventHandler("onClientGUIClick", root, select2) 

Link to comment

https://wiki.multitheftauto.com/wiki/DxDrawText

In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see onClientRender).

select1 and select2 is function not a variable you can't use it as argument of font and font size. Also dxSetFont and dxSetSize is not a valid mta function and i can't see it defined as custom function anywhere in the code.

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...