Jump to content

How to add NEW skins? (replace old)


Simulate

Recommended Posts

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

Link to comment
  • Replies 86
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
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.

Link to comment

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.

Link to comment
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)

Link to comment

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!

Link to comment
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

Link to comment
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.

Link to comment

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.

Link to comment
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?

Link to comment
@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?

Link to comment
@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.

Link to comment
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.

Link to comment
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)

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