Witam. Mam problem dotycz?cy gui, chcia?em dorobi? Ulepszenia Silnika do tune, wszystko pi?knie dzia?a tylko w gui nie zmienia si? informacja o tune lub demonta?u
Je?li pojazd ma Mk2 to powinno wy?wietla? sie Demont, je?li pojazd nie ma Mk2 powinno si? wy?wietla? Tuning, a wy?wietla si? tylko demont nawet je?li nie masz Mk2
[ Dodano: 2020-07-28, 19:54 ]
No to musisz od?wie?y? dane, wykonaj funkcj? tworz?c? i dodaj?c? opcje demonta?u i monta?u ponownie.
local MK1 = veh1:getData("vehicle:mk1")
local a=guiGridListAddRow(GUIEditor.gridlist[1])
if not MK1 then
guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(v[i].name), false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, "Addon", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "tuning", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(v[i].cost), false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(v[i].desc), false, false)
else
guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(v[i].name), false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, "Addon", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "demtuning - 50%", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(v[i].cost/2), false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(v[i].desc), false, false)
end
addEvent("pokazPanelTuningu", true)
addEventHandler("pokazPanelTuningu", localPlayer, function(veh)
if not veh or not isElement(veh) or getElementType(veh) ~= "vehicle" then
outputChatBox("* Brak pojazdu!", 255, 0, 0);
return
end
if getVehicleController(veh) == false then
outputChatBox("* Brak kierowcy!", 255, 0, 0);
return
end
if getVehicleController(veh):getData("offerta:tuning") then
outputChatBox("* Kierowca aktualnie ma wy?wietlon? ofert?!", 255, 0, 0);
return
end
if not veh:getData('vehicle:id') then
outputChatBox("* Ten pojazd nie jest prywatny!", 255, 0, 0);
return
end
if veh:getData("vehicle:ownedPlayer") ~= getVehicleController(veh):getData("player:sid") then
outputChatBox("* Ten pojazd nie nale?y do tego kierowcy!", 255, 0, 0)
return
end
if not isElement(GUIEditor.window[1]) then
if getElementData(veh, "vehicle:spawn") then
showCursor(true)
veh1 = veh
setElementData(localPlayer, "tune:car", veh)
Po prostu musisz wykona? CA?? funkcj?, gdzie tworzysz gridlist?, dodajesz do niej elementy z tuningiem itd. itd. itd.
Dalej ciemno?
function createTuningMenu()
createGridList(dane bla bla bla)
addGridListRow(dane bla bla bla)
end
event(
--je?li gracz kliknie montaz tuningu, odswiezamy wywo?uj?c funkcj? od tworzenia
createTuningMenu()
)
Ca?kowite uproszczenie, event oczywi?cie onClientGUIClick lub inne co tam masz.
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