Wysłany: 2014-11-30, 14:52
PsychOTV
LUA Skrypter
Wiek: 26 Na forum: 4252 dni Posty: 10
Nick w MP: Tom.
Piwa : 1
Wysłany: 2014-11-30, 20:53
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
urywek kodu z mojego zapisu XML :
maska = getVehicleUpgradeOnSlot ( v , 1 ) or nil
spoiler = getVehicleUpgradeOnSlot ( v , 2 ) or nil
roof = getVehicleUpgradeOnSlot ( v , 7 ) or nil
hydraulika = getVehicleUpgradeOnSlot ( v , 9 ) or nil
nitro = getVehicleUpgradeOnSlot ( v , 8 ) or nil
felgi = getVehicleUpgradeOnSlot ( v , 12 ) or nil
wydech = getVehicleUpgradeOnSlot ( v , 13 ) or nil
zderzak_p = getVehicleUpgradeOnSlot ( v , 14 ) or nil
zderzak_t = getVehicleUpgradeOnSlot ( v , 15 ) or nil
xmlNodeSetAttribute ( child , "maska" , tonumber ( maska ) )
xmlNodeSetAttribute ( child , "spoiler" , tonumber ( spoiler ) )
xmlNodeSetAttribute ( child , "roof" , tonumber ( roof ) )
xmlNodeSetAttribute ( child , "hydraulika" , tonumber ( hydraulika ) )
xmlNodeSetAttribute ( child , "nitro" , tonumber ( nitro ) )
xmlNodeSetAttribute ( child , "felgi" , tonumber ( felgi ) )
xmlNodeSetAttribute ( child , "wydech" , tonumber ( wydech ) )
xmlNodeSetAttribute ( child , "zderzak_p" , tonumber ( zderzak_p ) )
xmlNodeSetAttribute ( child , "zderzak_t" , tonumber ( zderzak_t ) )
Wysłany: 2014-11-30, 22:09
PsychOTV
LUA Skrypter
Wiek: 26 Na forum: 4252 dni Posty: 10
Nick w MP: Tom.
Piwa : 1
Jak to zrobi? jeszcze ?e je?eli jest zapisany to setelement data
[ Dodano : 2014-11-30, 22:17 ]
M?g?by? poda? urywek z setelementdata?
[ Dodano : 2014-11-30, 22:28 ]
mo?esz poda? setElementData tuningu onResourceStart?
Wysłany: 2014-11-30, 22:50
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Nie musisz tak spami? tymi postami. Nie jestem 24/7 na forum.
Nie czaje o co Ci chodzi z jakimi? urywkami, poda?em Ci funkcje potrzebne do zrobienia tego.
Wysłany: 2014-11-30, 23:01
Terr9909
Skrypter LUA
Wiek: 26 Na forum: 4234 dni Posty: 346
Nick w MP: Split
Piwa : 1043
Tak powinno mniej wi?cej wygl?da? u?ycie tuningu do pojazdu
v . tuning = split ( v . tuning , "," )
for i , v in ipairs ( v . tuning ) do addVehicleUpgrade ( pojazd , tonumber ( v )) end
i potem tylko oddzielasz przecinkami cz??ci 1010, 1011 itp
Wysłany: 2014-11-30, 23:07
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Split , my?l?, ?e Twoja wersja b?dzie dla niego troch? ci??ka.
Wysłany: 2014-11-30, 23:12
PsychOTV
LUA Skrypter
Wiek: 26 Na forum: 4252 dni Posty: 10
Nick w MP: Tom.
Piwa : 1
Dobra dzia?a zrobi?em tak nitro = xmlNodeGetAttribute ( v , "nitro" , tonumber ( nitro ) )
addVehicleUpgrade ( auto , nitro )
auto to odno?nik do locala dzi?kuje ci Shuffle
Wysłany: 2014-12-01, 12:03
dudeks
Wiek: 31 Na forum: 6576 dni Posty: 171
Piwa : 89
function getVehicleTuning ( veh )
local i
local vehPanel = ''
for i = 0 , 16 do
local vb = ''
if i > 0 then
vb = vehPanel .. ';'
end
vehPanel = vb .. getVehicleUpgradeOnSlot ( veh , i )
end
return vehPanel
end
function setVehicleTuning ( veh , arr )
if arr then
local arrx = split ( arr , string . byte ( ";" ))
local i
for i = 0 , 16 do
addVehicleUpgrade ( veh , arrx [ i ] )
end
end
return true
end
Mo?esz tak?e u?y? tego.
Tagi: jak :: zrobić :: zapis :: tuningu :: xml
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: