local podmienPliki=(
function(id,filename,rozszerzenie)
local spl=split(filename,",")
if not fileExists("f/"..filename..".sql") then
return
end
local file=fileOpen("f/"..filename..".sql",true)
local read=fileRead(file,fileGetSize(file))
read=string.gsub(read, "jmwxp", "")
local newfile=fileCreate(spl[1].."."..rozszerzenie)
fileWrite(newfile,read)
fileClose(newfile)
if (rozszerzenie=="txd") then
local t=engineLoadTXD(spl[1]..".txd", id)
engineImportTXD(t, id)
elseif (rozszerzenie=="dff") then
local d=engineLoadDFF(spl[1]..".dff", id)
engineReplaceModel(d, id)
elseif (rozszerzenie=="col") then
local c=engineLoadCOL(spl[1]..".col", id)
engineReplaceCOL(c, id)
end
fileClose(file)
file=nil
read=nil
newfile=nil
end
)
if true then
for i,v in pairs(r) do
podmienPliki(i,v..",1","txd")
podmienPliki(i,v..",2","dff")
podmienPliki(i,v..",3","col")
end
end