SmokingJoePot Posted November 21, 2011 Share Posted November 21, 2011 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? Link to comment
Castillo Posted November 21, 2011 Share Posted November 21, 2011 You want to replace EVERY single skin with a custom one? You must add EACH skin file to the meta.xml, TXD and DFF. And then use the Engine functions to replace them: https://wiki.multitheftauto.com/wiki/Cli ... _functions Link to comment
SmokingJoePot Posted November 21, 2011 Author Share Posted November 21, 2011 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. Link to comment
Castillo Posted November 21, 2011 Share Posted November 21, 2011 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: 1 Link to comment
SmokingJoePot Posted November 21, 2011 Author Share Posted November 21, 2011 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? Link to comment
Castillo Posted November 21, 2011 Share Posted November 21, 2011 I don't know if there's a limit of replacement. Link to comment
SmokingJoePot Posted November 21, 2011 Author Share Posted November 21, 2011 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. Link to comment
Castillo Posted November 21, 2011 Share Posted November 21, 2011 Well, I supposed you had some experience about MTA resource system, seems like I was wrong, read this tutorial to learn how to create resources: https://wiki.multitheftauto.com/wiki/Resources Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now