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

Wysłany: 2019-02-16, 17:46


TheSebaPL

Mod-team






Wiek: 22
Na forum: 3239 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

Witam, mam taki problem poniewa? nie wiem jak doda? obram?wk? do zmiany tablic w gui

kod:

local marker=createMarker(358.59,163.00,1007.38, "cylinder", 1, 255, 255, 255, 155)
setElementInterior(marker, 3)

local t=createElement("text")
setElementPosition(t,358.59,163.00,1008.38)
setElementInterior(t,3)
setElementData(t,"name","Zmiana tablic rejestracyjnych")

local wm={}
wm.window=guiCreateWindow(0.22, 0.22, 0.59, 0.53, "Zmiana tablic", true)
guiWindowSetSizable(wm.window, false)
guiWindowSetMovable(wm.window, false)
guiSetVisible(wm.window, false)
wm.gridlist=guiCreateGridList(0.03, 0.09, 0.93, 0.72, true, wm.window)
guiGridListAddColumn(wm.gridlist, "ID", 0.2)
guiGridListAddColumn(wm.gridlist, "Nazwa", 0.5)
guiGridListAddColumn(wm.gridlist, "Tablica", 0.2)
wm.edit=guiCreateEdit(0.04, 0.83, 0.27, 0.11, "", true, wm.window)
wm.submit=guiCreateButton(0.35, 0.84, 0.28, 0.11, "Zmie? tablic?(5000 PLN)", true, wm.window)
wm.close=guiCreateButton(0.68, 0.84, 0.28, 0.11, "Zamknij", true, wm.window)

addEventHandler("onClientGUIClick", root, function(btn,state)
    if source == wm.submit then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
        local new_board=guiGetText(wm.edit)
        if selectedRow < 0 then return end
        local cost=5000
        if string.len(new_board) < 1 then
            outputChatBox("* Podaj wi?cej znak?w.", 255, 0, 0)
            return
        end
        if string.len(new_board) > 5 then
            outputChatBox("* Podaj mniej znak?w.", 255, 0, 0)
            return
        end
        if cost > getPlayerMoney(localPlayer) then
            outputChatBox("* Nie posiadasz tyle got?wki.", 255, 0, 0)
            return
        end
        local id=tostring(guiGridListGetItemText(wm.gridlist, selectedRow, 1))
        local name=tostring(guiGridListGetItemText(wm.gridlist, selectedRow, 2))
        triggerServerEvent("board:new", resourceRoot, id, name, new_board, cost)
    end
    if source == wm.close then
        if guiGetVisible(wm.window) == true then
            showCursor(false)
            guiSetVisible(wm.window, false)
        end
    end
end)

addEvent("board:refresh", true)
addEventHandler("board:refresh", resourceRoot, function(result)
    guiGridListClear(wm.gridlist)
    for i,v in pairs(result) do
        if string.len(v.plateText) < 1 then v.plateText="Brak" end
        local row=guiGridListAddRow(wm.gridlist)
        guiGridListSetItemText(wm.gridlist, row, 1, v.id, false, false)
        guiGridListSetItemText(wm.gridlist, row, 2, getVehicleNameFromModel(v.model), false, false)
        guiGridListSetItemText(wm.gridlist, row, 3, v.plateText or v.id, false, false)
    end
end)

addEventHandler("onClientMarkerHit", marker, function(el,md)
    if el~=localPlayer then return end
    if not guiGetVisible(wm.gridlist) then
        showCursor(true)
        guiSetVisible(wm.window, true)
        triggerServerEvent("board:download", resourceRoot, el)
    end
end)


Prosz? o przerobienie owego kodu.

Za poprawne przerobienie daj? :piwo: i R*

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-17, 16:35


Gravgor







Wiek: 22
Na forum: 3761 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

W jakim sensie obram?wk??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-17, 17:18


TheSebaPL

Mod-team






Wiek: 22
Na forum: 3239 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

Gravgor, aby ?rodek zosta? standardowy tylko woku? tego doda? grafik?.

Postaw piwo autorowi tego posta
 

 
Tagi: ramka :: gui
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