killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
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 = true , right = true , front = true , rear = true , color ={ 255 , 0 , 0 }}) -- ca ? e czerwone
elseif getElementData ( veh , 'vehicle:neony' ) == 'CzerwoneBoki' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = false , rear = false , color ={ 255 , 0 , 0 }}) -- boki czerwone
elseif getElementData ( veh , 'vehicle:neony' ) == 'ZieloneCale' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = true , rear = true , color ={ 0 , 255 , 0 }}) -- zieloe ca ? e
elseif getElementData ( veh , 'vehicle:neony' ) == 'ZieloneBoki' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = false , rear = false , color ={ 0 , 255 , 0 }}) -- zielone boki
elseif getElementData ( veh , 'vehicle:neony' ) == 'RozoweCale' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = true , rear = true , color ={ 255 , 0 , 255 }}) -- r ?? owe ca ? e
elseif getElementData ( veh , 'vehicle:neony' ) == 'RozoweBoki' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = false , rear = false , color ={ 255 , 0 , 255 }}) -- r ?? owe boki
elseif getElementData ( veh , 'vehicle:neony' ) == 'BialeCale' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = true , rear = true , color ={ 255 , 255 , 255 }}) -- bia ? e ca ? e
elseif getElementData ( veh , 'vehicle:neony' ) == 'BialeBoki' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = false , rear = false , color ={ 255 , 255 , 255 }}) -- bia ? e boki
elseif getElementData ( veh , 'vehicle:neony' ) == 'NiebieskieCoki' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = true , rear = true , color ={ 0 , 0 , 255 }}) -- niebieskie ca ? e
elseif getElementData ( veh , 'vehicle:neony' ) == 'NiebieskieBoki' then
setElementData ( veh , 'vehicle:neony' , { left = true , right = true , front = false , rear = false , color ={ 0 , 0 , 255 }}) -- 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 ( vehicle , true )
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 frozen = isElementFrozen ( vehicle ) and 1 or 0
for i = 0 , 6 do table . insert ( panelstates , getVehiclePanelState ( 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" ,
model , x , y , z , rx , ry , rz , "0" , desc , health , fuel , mileage , frozen , driver , pojemnosc , cylindry , rodzaj_paliwa , naped , trakcja , hamulce , neonyxd , c1 , c2 , c3 , c4 , c5 , c6 , c7 , c8 , c9 , c10 , c11 , c12 , panelstates , paintjob , upgrades , h1 , h2 , h3 , player , tostring ( blokada ), id ))
if ( type ( rent ) == "table" ) then
local rr = string . format ( "%s" , table . concat ( rent , ',' ) )
local query2 = exports [ 'pystories-db' ]: dbSet ( "UPDATE pystories_vehicles SET rent=? WHERE id=?" , rr , id )
end
end
end
#22
tabela mysql