Jump to content

How to add NEW skins? (replace old)


Simulate

Recommended Posts

  • Replies 86
  • Created
  • Last Reply

Top Posters In This Topic

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?

Link to comment

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 '}'

Link to comment

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) 

Link to comment

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?

Link to comment

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)

Link to comment

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.

Link to comment

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...