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

Wysłany: 2020-10-31, 15:41


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
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.

S side

for i,v in pairs(stanowiskaSwiatla) do
    v.cuboid=createColCuboid(unpack(v.cpos))
    v.marker=createMarker(v.mpos[1], v.mpos[2], v.mpos[3], "cylinder"1.10131255255)
    setElementData(v.marker,"marker:duty",v.job_id)
    setElementData(v.marker,"marker:cuboid",v.cuboid)

    t=createElement("text")
    setElementData(t,"name",v.text)
    setElementPosition(t,v.mpos[1], v.mpos[2], v.mpos[3]+1)
    addEventHandler("onMarkerHit"v.marker, function(el,md)
    if getElementType(el)~= "player" then return end
    local cs=getElementData(source"marker:cuboid")
    if not cs then return end
    local job=getElementData(source,"marker:duty")
    local ljob=getElementData(el,"player:duty")
    if job ~= ljob then
        outputChatBox(" Nie jeste? zatrudniony w tym warsztacie."el25500)
        return
    end
    local vehicles=getElementsWithinColShape(cs,"vehicle")
    if #vehicles < 1 then
        outputChatBox(" Na stanowisku monta?u nie ma ?adnego pojazdu."el,25500)
        return
    end
    if #vehicles > 1 then
        outputChatBox(" Na stanowisku monta?u jest zbyt du?o pojazd?w."el,25500)
        return
    end
    if getElementHealth(vehicles[1]) < 900 then
        outputChatBox(" Pojazd jest zbyt uszkodzony!"el25500)
        return
    end
    triggerClientEvent(el,"pokazPanelTuningu"el vehicles[1])
    triggerEvent "ref_tune_mechSource"el vehicles[1])
end)
end

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 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
end)


C side


                local var_money math.floor(((procent_dla_melepeciaga/100) * 5));
        triggerServerEvent("tuner_sendInfo"tunertuner)
        triggerServerEvent("givePlayerMoney"tunervar_money);
        triggerServerEvent("ref_tune_mechSource"veh1);



for i,v in ipairs(ulepszenia_pojazdow) do                
                if v[i].name == "MK1" then
                    local MK1 veh1:getData("vehicle:mk1")
                    local a=guiGridListAddRow(GUIEditor.gridlist[1])        
                    if MK1 then
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"tuning"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    else
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"demtuning - 50%"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    end


Podpis


Modern Stories
Discord
https://discord.gg/MRJSYq8
Forum
https://msmta.pl
Panel Gracza
https://panel.msmta.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-10-31, 16:38


TheGuruPolska







Wiek: 36
Na forum: 3767 dni
Posty: 65
Nick w MP: TheGuru

Piwa: 47

Respekt: 50

Sk?d bierzesz veh1?
 local MK1 veh1:getData("vehicle:mk1")


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-10-31, 16:40


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
addEvent("pokazPanelTuningu"true)
addEventHandler("pokazPanelTuningu"localPlayer, function(veh)
    if not veh or not isElement(veh) or getElementType(veh) ~= "vehicle" then
        outputChatBox("* Brak pojazdu!"25500);
        return
    end
    if getVehicleController(veh) == false then
        outputChatBox("* Brak kierowcy!"25500);
        return
    end
    if getVehicleController(veh):getData("offerta:tuning"then
        outputChatBox("* Kierowca aktualnie ma wy?wietlon? ofert?!"25500);
        return
    end
    if not veh:getData('vehicle:id'then 
        outputChatBox("* Ten pojazd nie jest prywatny!"25500);
        return 
    end
    if veh:getData("vehicle:ownedPlayer") ~= getVehicleController(veh):getData("player:sid"then
        outputChatBox("* Ten pojazd nie nale?y do tego kierowcy!"25500)
        return
    end
    if not isElement(GUIEditor.window[1]) then
        if getElementData(veh"vehicle:spawn"then
            showCursor(true)
            veh1 veh
            setElementData(localPlayer"tune:car"veh)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-10-31, 16:43


TheGuruPolska







Wiek: 36
Na forum: 3767 dni
Posty: 65
Nick w MP: TheGuru

Piwa: 47

Respekt: 50

Bez sensu

veh1 veh
setElementData(localPlayer"tune:car"veh)

Spr?buj jeszcze zmieni?

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 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 tunezamien na pojazd
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-02, 22:35


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Nic nadal to samo, a je?li zamieni? to:

  if v[i].name == "MK1" then --na v.name
To nie pokazuje si? na gridliscie

[ Dodano: 2020-11-02, 23:50 ]
Mniejsza zrobi?em. 8-)

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], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"demtuning - 50%"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost/2), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    else
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"tuning"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    end
Mo?na lock

Postaw piwo autorowi tego posta
 

 
Tagi: odświeżanie :: gridlisty
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