Sign in to follow this  
SmokingJoePot

Custom skin replacement

Recommended Posts

Hi, I want to replace some skins with some custom skin in my server but what I need to know is, can I can replace alot of them using one meta.xml and main.lua? And what structure would it look like or do I have to do each skin seperately? I downloaded the Cleo skin selection mod and it uses skin.img but I heard I can't install Cleo mods so thats why Im asking. Im trying to replace all skins to custom skins. I read the scripting tutorial in the wiki mtasa page so I kinda get the just of it. So do I have to make a zip file with all the txds, dffs, the meta.xml and the main.lua? If its possible how do I set it to server and client for each skin in one meta.xml so everyone sees them?

Share this post


Link to post

Does that seem like alot of work? So do I use the engineReplaceModel example like a vehicle correct? and then add all the txds and dffs for all the character skins in the zip along with the meta.xml? Then I have to find out their model IDs in the game or atleast find out how many skins are available to be replaced and then add them in the xml. What I don't know how to do is the format to add mutiple entries of replace skins. I have the example but it doesn't show an exaple for mutiple entries.

Share this post


Link to post

In the meta.xml you have to add EACH file, else the script won't load them.

I suggest you using a table to load all the skins in just some lines.

Example:

-- script.lua:

local skins = {{fileName="skin1", skinID=46}, {fileName="skin2", skinID=53}} 
      
function load() 
        for index, skin in pairs(skins) do 
            txd = engineLoadTXD ( skin.fileName .. ".txd" ) 
            engineImportTXD ( txd, skin.skinID ) 
            dff = engineLoadDFF ( skin.fileName .. ".dff", 0 ) 
            engineReplaceModel ( dff, 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) 

-- meta.xml:

    

  • Like 1

Share this post


Link to post

Thanks thats alot of help. Im gonna try it. Do you happen to know how many skins come in a server, that way I can know how many txds and dffs to stick in the zip file and so I can know what number skin # to stop at?

Share this post


Link to post

Theres 153 skins in the skin.img so Im only going to try to do only one first. Its my first time. I was following the tutorial but I can't find the script.lua. I checked in the server/mods/deathmatch/resources/ but its not in there, am I suppose to make a file called script.lua? Do you know of any good tutorials for doing this and is possible to install mods in a server with SAMI? Its my first time and I really don't know what Im doing, Im familiar with file types and opening, and editing txds and dffs but I've never replaced a skin in MTA before.

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.