Simulate

How to add NEW skins? (replace old)

87 posts in this topic

Hi there!

Can somebody give me the code how to replace a skins ddf/ttf?

I made one but it doesnt works, i used the car replace script and replaced car for skin but that doesnt work :)

So if somebody can give that script im really happy!

Sorry for bad english im dutch!

Greetings,

Simulate

Share this post


Link to post

you cant replace MODEL

you can replace TEXTURE

download zombie script, and check the code ;)

ddf/ttf

ddf -> dff

ttf -> txd (TTF - True Type Font xD)

Share this post


Link to post
function replaceModel()
local skin = engineLoadTXD ( "skins/13.txd" )
engineImportTXD ( skin, 13 )
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

Share this post


Link to post
function replaceModel()
local skin = engineLoadTXD ( "skins/13.txd" )
engineImportTXD ( skin, 13 )
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

THANKS :D

Share this post


Link to post
Why we can't change Model?

Not supported in mta if im right :P

Share this post


Link to post

Thats a client script right?

do I need to add a server script with a triggerClientEvent?

Share this post


Link to post
do I need to add a server script with a triggerClientEvent?

No, why would you?

You don't want to change the skin for the server, you want to change it for the client.

The replace function gets called for every player, when the resource is started for him.

Share this post


Link to post

Alright, I added this script I also changed it to look like this:

function replaceModel()
    local skin = engineLoadTXD ( "skins/80.txd" )
engineImportTXD ( skin, 80 )
 local skin = engineLoadTXD ( "skins/81.txd" )
engineImportTXD ( skin, 81 )
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

but when I start the resource then connect to the server, it downloads a file so it must be the two modded skins, I then select the team but it shows the original skins and not the modified ones?

any help much appreciated.

Share this post


Link to post
function replaceModel()
local skin = engineLoadTXD ( "skins/80.txd" )
engineImportTXD ( skin, 80 )
local skin2 = engineLoadTXD ( "skins/81.txd" )
engineImportTXD ( skin2, 81 .end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

Share this post


Link to post

Make sure that the path to the files is correct.

Share this post


Link to post

I have used the changed script posted above. The path's are correct.

The skins get downloaded they show up in the following directory, .../MTA San Andreas/mods/deathmatch/resources/skin_replacer

but the skins don't show up in game? it is still the original. Do I need to change something in the settings of basemode? or something?

Thanks!

Share this post


Link to post
Alright, I added this script I also changed it to look like this:

function replaceModel()
local[color=#FF0000] skin [/color]= engineLoadTXD ( "skins/80.txd" )
engineImportTXD ( skin, 80 )
local [color=#FF0000]skin[/color] = engineLoadTXD ( "skins/81.txd" )
engineImportTXD ( skin, 81 )
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

but when I start the resource then connect to the server, it downloads a file so it must be the two modded skins, I then select the team but it shows the original skins and not the modified ones?

any help much appreciated.

they are named same.. look at my earlyer post

Share this post


Link to post

I used the code you posted in your post. It still doesn't use the skins in game?

Share this post


Link to post
Alright, I added this script I also changed it to look like this:

function replaceModel()
local[color=#FF0000] skin [/color]= engineLoadTXD ( "skins/80.txd" )
engineImportTXD ( skin, 80 )
local [color=#FF0000]skin[/color] = engineLoadTXD ( "skins/81.txd" )
engineImportTXD ( skin, 81 )
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

but when I start the resource then connect to the server, it downloads a file so it must be the two modded skins, I then select the team but it shows the original skins and not the modified ones?

any help much appreciated.

they are named same.. look at my earlyer post

They aren't named same. They only use variables which are named the same. Second texture is loaded after the first has already been imported, so it's not the problem.

Share this post


Link to post

so do i use the one with skin and skin or skin and skin2?

both seem to be working to download the skins to the local mod folder.

BUT the skins are not working in the game? they are in the local mods folder so something to do with basemode cant be configured correctly? in the meta for basemode its set to use skin numbers 80 and 81.

Share this post


Link to post
Alright, I added this script I also changed it to look like this:

function replaceModel()
local[color=#FF0000] skin [/color]= engineLoadTXD ( "skins/80.txd" )
engineImportTXD ( skin, 80 )
local [color=#FF0000]skin[/color] = engineLoadTXD ( "skins/81.txd" )
engineImportTXD ( skin, 81 )
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

but when I start the resource then connect to the server, it downloads a file so it must be the two modded skins, I then select the team but it shows the original skins and not the modified ones?

any help much appreciated.

they are named same.. look at my earlyer post

It doesn't matter in this case...

@darkraid, the problem is the path to the files. You said,

The skins get downloaded they show up in the following directory, .../MTA San Andreas/mods/deathmatch/resources/skin_replacer

skin_replacer is the resource root folder but you try to load a file from ".../resources/skin_replacer/skins/80.txd" which is completely wrong... WHY DON'T YOU LEARN TO DEBUG?

Share this post


Link to post
@darkraid, the problem is the path to the files. You said,
The skins get downloaded they show up in the following directory, .../MTA San Andreas/mods/deathmatch/resources/skin_replacer

skin_replacer is the resource root folder but you try to load a file from ".../resources/skin_replacer/skins/80.txd" which is completely wrong... WHY DON'T YOU LEARN TO DEBUG?

-.- i'm not the one that made this script up. in that quote i was talking about the LOCAL mod folder which the resources get downloaded to. so the script must be working fine because its doing what it was designed to do which is replace the skins. BUT the custom skins DO NOT show up in basemode they are still the original. How do i make it so it uses the custom skins?

Share this post


Link to post
@darkraid, the problem is the path to the files. You said,
The skins get downloaded they show up in the following directory, .../MTA San Andreas/mods/deathmatch/resources/skin_replacer

skin_replacer is the resource root folder but you try to load a file from ".../resources/skin_replacer/skins/80.txd" which is completely wrong... WHY DON'T YOU LEARN TO DEBUG?

-.- i'm not the one that made this script up. in that quote i was talking about the LOCAL mod folder which the resources get downloaded to. so the script must be working fine because its doing what it was designed to do which is replace the skins. BUT the custom skins DO NOT show up in basemode they are still the original. How do i make it so it uses the custom skins?

And what I'm saying is that it doesn't point to the texture file. The LOCAL mod can have more folders inside... You need to learn more about MTA resources and meta.xml. Check my signature for the link to meta.xml.

Share this post


Link to post
And what I'm saying is that it doesn't point to the texture file. The LOCAL mod can have more folders inside... You need to learn more about MTA resources and meta.xml. Check my signature for the link to meta.xml.

If your talking about have the file src in the meta, its in there.

Share this post


Link to post

And what did you set for src attribute? And where is the file located (server resource)?

Share this post


Link to post
And what did you set for src attribute? And where is the file located (server resource)?

The meta is as follows:

<meta>
<info name="Skin replace" author="darkraid" version="1.0.0" type="script" />
   	<script src="Skins.lua" type="client" />
<file src="skins/80.txd" />
<file src="skins/81.txd" />
</meta>

The resource is located in the server resource correct. (server > mods > deathmatch > resources > skin_replacer)

Share this post


Link to post

Do you have skins folder in the resource?

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

  • Recently Browsing   0 members

    No registered users viewing this page.