Im working on a CJ clothes script, to save it, Im using this function:
function createClothesJSONString ( returnType )
local clothesTable = {}
local smtn = false
for i=0,17 do
local texture, model = getPedClothes ( localPlayer, i )
if ( texture ) then
local theType, theIndex = getTypeIndexFromClothes ( texture, model )
clothesTable[theType] = theIndex
smtn = true
end
end
if ( smtn ) then
if ( returnType == "JSON" ) then
return "" .. toJSON( clothesTable ):gsub( " ", "" ) .. ""
else
return clothesTable
end
else
return "NULL"
end
end
The output this function gives is this for example:
[{"1":25,"2":14,"3":13,"0":0,"13":8,"15":10}]
"1" = clothesType
:25 = clothesIndex
etc.
But the problem is, as you can see it outputs, "0":0. This causes shirts not being saved because it always set their shirt to player_torso. Anyone has any idea how I can fix this?