Siemaneczko, mam problem z od?wie?aniem gridlisty, a dok?adnie po wej?ciu lub tuningu "Akcja" powinna si? zmieni? na demont, aczkolwiek tak si? nie dzieje. Zrobi?em eventy ale pewnie nie prawid?owo. Prosi? bym o pomoc.
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)
for i,v in ipairs(ulepszenia_pojazdow) do
if v[i].name == "MK1" then --na v.name
[ Dodano: 2020-10-31, 16:45 ]
A jakie b?edy masz w db3?
[ Dodano: 2020-10-31, 16:57 ]
Tu masz b??dy.
addEvent("ref_tune_mechSource", true)
addEventHandler("ref_tune_mechSource", getRootElement(), function(ccar)
local q = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=?", getElementData(ccar, "vehicle:id"))
local pojazd = {}
for i = 1, #q do
table.insert(pojazd, {mk1 = q[i]["mk1"],mk2 = q[i]["mk2"],mk3 = q[i]["mk3"],mk4 = q[i]["mk4"],rh = q[i]["rh"]})
end
return tune -- nie ma tu tune, zamien na pojazd
end)
if v[i].name == "MK1" then --na v.name
local MK1 = getElementData(veh1, "vehicle:mk1") == 1
local a=guiGridListAddRow(GUIEditor.gridlist[1])
if 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, "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)
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, "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)
end
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