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: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

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"1255255255155)
setElementInterior(marker3)

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.220.220.590.53"Zmiana tablic"true)
guiWindowSetSizable(wm.windowfalse)
guiWindowSetMovable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
wm.gridlist=guiCreateGridList(0.030.090.930.72truewm.window)
guiGridListAddColumn(wm.gridlist"ID"0.2)
guiGridListAddColumn(wm.gridlist"Nazwa"0.5)
guiGridListAddColumn(wm.gridlist"Tablica"0.2)
wm.edit=guiCreateEdit(0.040.830.270.11""truewm.window)
wm.submit=guiCreateButton(0.350.840.280.11"Zmie? tablic?(5000 PLN)"truewm.window)
wm.close=guiCreateButton(0.680.840.280.11"Zamknij"truewm.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."25500)
            return
        end
        if string.len(new_board) > 5 then
            outputChatBox("* Podaj mniej znak?w."25500)
            return
        end
        if cost getPlayerMoney(localPlayerthen
            outputChatBox("* Nie posiadasz tyle got?wki."25500)
            return
        end
        local id=tostring(guiGridListGetItemText(wm.gridlistselectedRow1))
        local name=tostring(guiGridListGetItemText(wm.gridlistselectedRow2))
        triggerServerEvent("board:new"resourceRootidnamenew_boardcost)
    end
    if source == wm.close then
        if guiGetVisible(wm.window) == true then
            showCursor(false)
            guiSetVisible(wm.windowfalse)
        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.gridlistrow1v.idfalsefalse)
        guiGridListSetItemText(wm.gridlistrow2getVehicleNameFromModel(v.model), falsefalse)
        guiGridListSetItemText(wm.gridlistrow3v.plateText or v.idfalsefalse)
    end
end)

addEventHandler("onClientMarkerHit"marker, function(el,md)
    if el~=localPlayer then return end
    if not guiGetVisible(wm.gridlistthen
        showCursor(true)
        guiSetVisible(wm.windowtrue)
        triggerServerEvent("board:download"resourceRootel)
    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: 3619 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

W jakim sensie obram?wk??

Podpis
Portfolio marceliborowczak.me
Postaw piwo autorowi tego posta
 

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


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

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