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

Wysłany: 2020-09-27, 18:41


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

Witajcie chcia?bym si? zapyta? co tutaj jest ?le zrobi?em sobie w systemie pojazd?w neony

if getElementData(veh'vehicle:neony') == "Brak" then
        elseif getElementData(veh,'vehicle:neony') == 'CzerwoneCale' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=truerear=truecolor={25500}}) -- ca?e czerwone
        elseif getElementData(veh,'vehicle:neony') == 'CzerwoneBoki' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=falserear=falsecolor={25500}}) -- boki czerwone
        elseif getElementData(veh,'vehicle:neony') == 'ZieloneCale' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=truerear=truecolor={02550}}) -- zieloe ca?e
        elseif getElementData(veh,'vehicle:neony') == 'ZieloneBoki' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=falserear=falsecolor={02550}}) -- zielone boki    
        elseif getElementData(veh,'vehicle:neony') == 'RozoweCale' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=truerear=truecolor={2550255}}) -- r??owe ca?e    
        elseif getElementData(veh,'vehicle:neony') == 'RozoweBoki' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=falserear=falsecolor={2550255}}) -- r??owe boki
        elseif getElementData(veh,'vehicle:neony') == 'BialeCale' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=truerear=truecolor={255255255}}) -- bia?e ca?e
        elseif getElementData(veh,'vehicle:neony') == 'BialeBoki' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=falserear=falsecolor={255255255}}) -- bia?e boki
        elseif getElementData(veh,'vehicle:neony') == 'NiebieskieCoki' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=truerear=truecolor={00255}}) -- niebieskie ca?e    
        elseif getElementData(veh,'vehicle:neony') == 'NiebieskieBoki' then 
        setElementData(veh,'vehicle:neony', {left=trueright=truefront=falserear=falsecolor={00255}}) -- niebieskie boki
        end


i gdy ma zapisa? pojazd wywala b??d


bad argument #22 to 'format' (string expected, got table)


kod


function onSaveVehicle(vehicle)
    if getElementData(vehicle,"vehicle:spawn"then
        -- Setting
        local panelstates={}
        local model=getElementModel(vehicle)
        local health=getElementHealth(vehicle)
        local x,y,z=getElementPosition(vehicle)
        local rx,ry,rz=getElementRotation(vehicle)
        local desc=getElementData(vehicle,"vehicle:desc") or ""
        local id=getElementData(vehicle,"vehicle:id")
        local fuel=getElementData(vehicle,"vehicle:fuel")
        local mileage=getElementData(vehicle,"vehicle:mileage")
        local pojemnosc=getElementData(vehicle,"vehicle:silnik")
        --local silnik=getElementData(vehicle,"vehicle:silnik")
        local cylindry=getElementData(vehicle,"vehicle:cylindry")
        local rodzaj_paliwa=getElementData(vehicle,"vehicle:fuel:typ")
        local naped=getElementData(vehicle,"vehicle:naped")
        local trakcja=getElementData(vehicle,"vehicle:trakcja")
        local hamulce=getElementData(vehicle,"vehicle:hamulce")
        local neonyxd getElementData(vehicle,"vehicle:neony")
        local c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12=getVehicleColor(vehicletrue)
        local driver=getElementData(vehicle,"vehicle:driver") or ""
        local rent=getElementData(vehicle,"vehicle:rent") or ''
        local player=getElementData(vehicle,"vehicle:ownedPlayer")
        local group=getElementData(vehicle,"vehicle:ownedGroup")
        local blokada=getElementData(vehicle,"vehicle:block")
        local h1,h2,h3=getVehicleHeadLightColor(vehicle)
        local paintjob=getVehiclePaintjob(vehicle)
        local rear="Brak"
        local frozenisElementFrozen(vehicle) and or 0
        for i=0,do table.insert(panelstatesgetVehiclePanelState(vehicle,i)) end
        panelstates=table.concat(panelstates,",")
        upgrades=getVehicleUpgrades(vehicle)
        if not upgrades then upgrades={} end
        upgrades=table.concat(upgrades",")
        -- Query
        local query exports["pystories-db"]:dbSet(string.format("UPDATE pystories_vehicles SET model='%d', pos='%.2f,%.2f,%.2f,%.2f,%.2f,%.2f', rent='%d',text='%s', health='%d', fuel='%d', mileage='%d', frozen='%d', driver='%s',pojemnosc='%s', cylindry='%s', rodzaj_paliwa='%s', naped='%s', trakcja='%s', hamulce='%s', neony='%s', color='%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d', panelstates='%s', paintjob='%d', tuning='%s', headlights='%d,%d,%d', ownedPlayer='%d', blokada='%s' WHERE id=%d",
        modelx,y,zrx,ry,rz"0",desc,healthfuelmileagefrozendriver,pojemnosccylindryrodzaj_paliwanapedtrakcjahamulce,neonyxdc1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12panelstatespaintjobupgradesh1,h2,h3playertostring(blokada), id))
        if (type(rent) == "table"then
        local rr string.format("%s"table.concat(rent',') )
        local query2exports['pystories-db']:dbSet("UPDATE pystories_vehicles SET rent=? WHERE id=?",rr,id)
        end
    end
end




#22

neony='%s'


tabela mysql



Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-09-27, 19:47


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

No pod element dat? masz tabel?, a tego nie mo?esz zapisa? bo masz tam wstawi? tekst.

U?yj

Więcej informacji znajdziesz w Wikipedii MTA:

toJSON

albo zmodyfikuje tabel? na tekst pod element dat?.

Postaw piwo autorowi tego posta
 

 
Tagi: dziwny :: przypadek :: którego :: nie :: rozumem
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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