Jump to content

How to add NEW skins? (replace old)


Simulate

Recommended Posts

  • Replies 86
  • Created
  • Last Reply

Top Posters In This Topic

Posted

I tried it but when I hit F1 to open the skin changer, and I click skin and then clicked on a skin number like 9-41, it didn't change to a custom skin, so I opened admin panel by using the "p" button and then clicked on the resource tab and the resource skins wasn't in there, maybe it doesn't need to be in a zip file?

Posted

I tried it unzipped and it showed up in the resources tab as status "loaded" so I highlighted it and clicked start and then it started downloading 92.13 mb but when it was finished and I tried to change to a skin or character, it didn't use a custom one.

Posted

In the console when I start the serve it says all resources successfully started or loaded or something like that but still won't change skin when in game. What category are they in or are they in the same number ID that Im replaceing like 9-50?

Posted

Go in game and login as admin, then write this command in the chat: /debugscript 3, and then restart the skins resource, see if it outputs any error.

Posted

When I logged in and typed /debugscript 3 in the chat. It said debugscript change to 3. and then I went to the admin panel and clicked the resources tab and then the skins resource status was at "loaded" so, I highlighted the skins resource and hit restart and it said running but at the bottom of the screen it said. WARNING: Loading script failed: skins\script.lua:1: unexpected symbol near '}'

Posted

You created the table wrong, here I fixed it:

local skins = {{fileName="skin1", skinID=9}, {fileName="skin2", skinID=10}, {fileName="skin3", skinID=11}, {fileName="skin4", skinID=12}, {fileName="skin5", skinID=13}, {fileName="skin6", skinID=14}, {fileName="skin7", skinID=15}, {fileName="skin8", skinID=16}, {fileName="skin9", skinID=17}, {fileName="skin10", skinID=18}, {fileName="skin11", skinID=19}, {fileName="skin12", skinID=20}, {fileName="skin13", skinID=21}, {fileName="skin14", skinID=22}, {fileName="skin15", skinID=23}, {fileName="skin16", skinID=24}, {fileName="skin17", skinID=25}, {fileName="skin18", skinID=26}, {fileName="skin19", skinID=27}, {fileName="skin20", skinID=28}, {fileName="skin21", skinID=29}, {fileName="skin22", skinID=30}, {fileName="skin23", skinID=31}, {fileName="skin24", skinID=32}, {fileName="skin25", skinID=33}, {fileName="skin26", skinID=34}, {fileName="skin27", skinID=35}, {fileName="skin28", skinID=36}, {fileName="skin29", skinID=37}, {fileName="skin30", skinID=38}, {fileName="skin31", skinID=39}, {fileName="skin32", skinID=40}, {fileName="skin33", skinID=41}, {fileName="skin34", skinID=43}, {fileName="skin35", skinID=44}, {fileName="skin36", skinID=45}, {fileName="skin37", skinID=46}, {fileName="skin38", skinID=47}, {fileName="skin39", skinID=48}, {fileName="skin40", skinID=49}, {fileName="skin41", skinID=50}} 
  
function load() 
    for index, skin in pairs(skins) do 
        engineImportTXD(engineLoadTXD ( "skins/".. skin.fileName ..".txd" ), tonumber(skin.skinID)) 
        engineReplaceModel(engineLoadDFF ( "skins/".. skin.fileName ..".dff", 0 ), tonumber(skin.skinID)) 
    end 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    local version = getVersion() 
    if string.find(version.mta, "1.1.1") then 
        setTimer ( load, 1000, 1) 
    end 
end) 

Posted

This is exactly what I got in the script.lua:

local skins = {{fileName="skin1", skinID=9}, {fileName="skin2", skinID=10}}, {fileName="skin3", skinID=11}}, {fileName="skin4", skinID=12}}, {fileName="skin5", skinID=13}}, {fileName="skin6", skinID=14}}, {fileName="skin7", skinID=15}}, {fileName="skin8", skinID=16}}, {fileName="skin9", skinID=17}}, {fileName="skin10", skinID=18}}, {fileName="skin11", skinID=19}}, {fileName="skin12", skinID=20}}, {fileName="skin13", skinID=21}}, {fileName="skin14", skinID=22}}, {fileName="skin15", skinID=23}}, {fileName="skin16", skinID=24}}, {fileName="skin17", skinID=25}}, {fileName="skin18", skinID=26}}, {fileName="skin19", skinID=27}}, {fileName="skin20", skinID=28}}, {fileName="skin21", skinID=29}}, {fileName="skin22", skinID=30}}, {fileName="skin23", skinID=31}}, {fileName="skin24", skinID=32}}, {fileName="skin25", skinID=33}}, {fileName="skin26", skinID=34}}, {fileName="skin27", skinID=35}}, {fileName="skin28", skinID=36}}, {fileName="skin29", skinID=37}}, {fileName="skin30", skinID=38}}, {fileName="skin31", skinID=39}}, {fileName="skin32", skinID=40}}, {fileName="skin33", skinID=41}}, {fileName="skin34", skinID=43}}, {fileName="skin35", skinID=44}}, {fileName="skin36", skinID=45}}, {fileName="skin37", skinID=46}}, {fileName="skin38", skinID=47}}, {fileName="skin39", skinID=48}}, {fileName="skin40", skinID=49}}, {fileName="skin41", skinID=50}}

function load()

for index, skin in pairs(skins) do

engineImportTXD(engineLoadTXD ( "skins/".. skin.fileName ..".txd" ), tonumber(skin.skinID))

engineReplaceModel(engineLoadDFF ( "skins/".. skin.fileName ..".dff", 0 ), tonumber(skin.skinID))

end

end

addEventHandler("onClientResourceStart",resourceRoot,

function ()

local version = getVersion()

if string.find(version.mta, "1.1.1") then

setTimer ( load, 1000, 1)

end

end)

Could it mean I need another } behind skinID=9}, cause theres seems to be only one?

Posted

Look, I wasted my time removing all the EXTRA "}" from the script, and now you won't use it? are you kidding me?

Just copy and paste my last post script.

Posted

When I logged in and typed /debugscript 3 in the chat. It said debugscript change to 3. and then I went to the admin panel and clicked the resources tab and then the skins resource status was at "loaded" so, I highlighted the skins resource and hit start and it said started but at the bottom of the screen it said.

WARNING: Loading script failed: skins\script.lua:5: Bad 'txd' pointer @ 'engineimportTXD'(1)

WARNING: Loading script failed: skins\script.lua:6: Bad 'dff' pointer @ 'engineReplaceModel'(1)

Posted

What do you mean by valid? They're skins that I got from the Cleo skin selector mod. I have all the skin packs so I chose some character's txds and dffs from one of the skin.img files and named them skin1-skin41.

Posted

oh, yes their valid, they work on my Cleo mod. I changed their names but made sure to keep each pair same name like instead of bee.txd, bee.dff. I named it skin1.txd and skin1.dff. Do you think that could be the problem?

Posted

ok, I thought maybe renaming them was the problem so I let the txds and dffs originally named. Im trying out 2 skins, ones called SynysterGatess and the other is called bee. Im trying it in a folder called fav, and this is what I have so far in the meta.xml and script.lua:

This is what I have in my meta.xml:

This is what I have in my script.lua:

function replaceModel()

local skin = engineLoadTXD ( "skins/SynysterGatess.txd" )

engineImportTXD ( skin, SynysterGatess )

skin = engineLoadTXD ( "skins/bee.txd" )

engineImportTXD ( skin, bee )

end

addEventHandler ( "onClientResourceStart", getResourceRootElement(), replaceModel)

I read the earlier posts and used the working codes and just added the names of the files in, but Im not sure if I did that correctly.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...