kewen6969
Mapper / Modeler 3D


Wiek: 26 Na forum: 2225 dni Posty: 11
Nick w MP: zct7zct
Piwa: 1
|
|
|
|
Witam, czy pomógłby mi ktoś rozkodować model?
Stawiam zimne za pomoc
Fragmenty kodu, które odpowiadają za kodowanie:
function decode(path, key)
local f = fileOpen(path)
local rawdatac = fileRead(f, fileGetSize(f))
fileClose(f)
local rawdata = decodeString("tea", rawdatac, {key = key})
return rawdata
end
for i, v in pairs(models) do
if fileExists("files/"..i..".txd") then
local txd = engineLoadTXD("files/"..i..".txd")
engineImportTXD(txd, v)
end
if fileExists("files/"..i..".dffc") then
local data = decode("files/"..i..".dffc", getElementData(getRootElement(), "kodowanieModeli"))
local dff = engineLoadDFF(data)
engineReplaceModel(dff, v, true)
end
if fileExists("files/"..i..".colc") then
local data = decode("files/"..i..".colc", getElementData(getRootElement(), "kodowanieModeli"))
local col = engineLoadCOL(data)
engineReplaceCOL(col, v)
end
end
function skinAllocatedPeds(cmd, name)
local id = engineRequestModel("vehicle")
print(id)
if fileExists("files/" .. name .. ".txd") and fileExists("files/" .. name .. ".dffc") then
txd = engineLoadTXD("files/" .. name .. ".txd")
engineImportTXD(txd, id)
dff = decode("files/"..name..".dffc", getElementData(getRootElement(), "kodowanieModeli"))
engineReplaceModel(dff, id)
outputChatBox("Model ID "..id.." changed correctly.")
else
outputChatBox("Model ID "..id.." couldn't change. REASON: files/" .. id .. ".txd or files/" .. id .. ".dff does not exist.")
end
end
addCommandHandler("sap", skinAllocatedPeds, false, false)
|
|