How to add NEW skins? (replace old)

All Lua scripting topics related to Multi Theft Auto.

Moderators: Scripting Moderators, Moderators, MTA Team

How to add NEW skins? (replace old)

Postby Simulate on Sun Jun 20, 2010 1:58 pm

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
Simulate
Civilian
 
Posts: 20
Joined: Wed Mar 31, 2010 1:34 pm
Gang: Owner @ Dawal Server

Re: How to add NEW skins? (replace old)

Postby dzek (varez) on Sun Jun 20, 2010 3:02 pm

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)
Multi theft auto tools - replace cars and peds, move your map or compile your lua files online!
programista php rzeszów
Do not ask me for help with scripting via pm!
Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
User avatar
dzek (varez)
Global Moderator
 
Posts: 4265
Joined: Sun Jan 04, 2009 1:37 pm
Location: Poland

Re: How to add NEW skins? (replace old)

Postby TheRealCow on Mon Jun 21, 2010 4:36 am

  1. function replaceModel()
  2.      local skin = engineLoadTXD ( "skins/13.txd" )
  3.    engineImportTXD ( skin, 13 )
  4. end
  5. addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)
Server Name: mR|Team Clan Race Server
Server IP: 84.82.81.225:22004

Image
TheRealCow
Snitch
 
Posts: 65
Joined: Fri Jun 04, 2010 10:16 am
Gang: mR|Team

Re: How to add NEW skins? (replace old)

Postby LonelyRoad on Mon Jun 21, 2010 6:34 am

Perfect so far as I can see. :)
LonelyRoad
Poot-butt
 
Posts: 127
Joined: Sun Jun 20, 2010 8:06 am

Re: How to add NEW skins? (replace old)

Postby Simulate on Thu Jun 24, 2010 11:22 am

TheRealCow wrote:
  1. function replaceModel()
  2.      local skin = engineLoadTXD ( "skins/13.txd" )
  3.    engineImportTXD ( skin, 13 )
  4. end
  5. addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)

THANKS :D
Simulate
Civilian
 
Posts: 20
Joined: Wed Mar 31, 2010 1:34 pm
Gang: Owner @ Dawal Server

Re: How to add NEW skins? (replace old)

Postby Piorun on Mon Jun 28, 2010 4:48 pm

Why we can't change Model?
[PL] PROJECT: INFINITY
Polish project of MTA RP/RPG server.
Piorun
Prankster
 
Posts: 323
Joined: Wed Jun 16, 2010 12:37 pm

Re: How to add NEW skins? (replace old)

Postby Solidsnake14 on Mon Jun 28, 2010 4:55 pm

Piorun wrote:Why we can't change Model?



Not supported in mta if im right :P
Check out my website: http://mtamarket.com/
SAUR Utopia RPG Owner & Developer.
Image
Education is the most powerful weapon which you can use to change the world.
User avatar
Solidsnake14
Global Moderator
 
Posts: 21709
Joined: Thu Sep 24, 2009 3:59 am
Location: Argentina
Gang: SAUR

Re: How to add NEW skins? (replace old)

Postby Piorun on Mon Jun 28, 2010 5:44 pm

:? :? :? ... okey, thanks.
[PL] PROJECT: INFINITY
Polish project of MTA RP/RPG server.
Piorun
Prankster
 
Posts: 323
Joined: Wed Jun 16, 2010 12:37 pm

Re: How to add NEW skins? (replace old)

Postby darkraid on Wed Jul 07, 2010 12:50 pm

Thats a client script right?
do I need to add a server script with a triggerClientEvent?
darkraid
Square
 
Posts: 17
Joined: Mon Jul 05, 2010 9:47 pm
Location: New Zealand

Re: How to add NEW skins? (replace old)

Postby MaddDogg on Wed Jul 07, 2010 2:42 pm

darkraid wrote: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.
Image
User avatar
MaddDogg
Mark
 
Posts: 189
Joined: Tue Dec 22, 2009 2:04 pm
Location: Germany
Gang: Grove

Re: How to add NEW skins? (replace old)

Postby darkraid on Wed Jul 07, 2010 10:38 pm

Alright, I added this script I also changed it to look like this:
  1. function replaceModel()
  2.      local skin = engineLoadTXD ( "skins/80.txd" )
  3.    engineImportTXD ( skin, 80 )
  4.     local skin = engineLoadTXD ( "skins/81.txd" )
  5.    engineImportTXD ( skin, 81 )
  6. end
  7. 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.
darkraid
Square
 
Posts: 17
Joined: Mon Jul 05, 2010 9:47 pm
Location: New Zealand

Re: How to add NEW skins? (replace old)

Postby TheRealCow on Thu Jul 08, 2010 1:31 am

  1. function replaceModel()
  2.      local skin = engineLoadTXD ( "skins/80.txd" )
  3.     engineImportTXD ( skin, 80 )
  4.     local skin2 = engineLoadTXD ( "skins/81.txd" )
  5.     engineImportTXD ( skin2, 81 .end
  6. addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)
Server Name: mR|Team Clan Race Server
Server IP: 84.82.81.225:22004

Image
TheRealCow
Snitch
 
Posts: 65
Joined: Fri Jun 04, 2010 10:16 am
Gang: mR|Team

Re: How to add NEW skins? (replace old)

Postby CrystalMV on Thu Jul 08, 2010 3:23 am

Make sure that the path to the files is correct.
Visit my MTA scripts website!
Available scripts: Drawtag, Bone attachments, Gravity gun, Lava flood, NPC high-level control, NPC traffic and more.
My scripts topic: link

Crystal RPG server topic : link
User avatar
CrystalMV
Lil' G
 
Posts: 1250
Joined: Fri Feb 15, 2008 2:03 pm
Location: Lithuania

Re: How to add NEW skins? (replace old)

Postby darkraid on Thu Jul 08, 2010 4:56 am

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!
darkraid
Square
 
Posts: 17
Joined: Mon Jul 05, 2010 9:47 pm
Location: New Zealand

Re: How to add NEW skins? (replace old)

Postby TheRealCow on Thu Jul 08, 2010 5:04 am

darkraid wrote:Alright, I added this script I also changed it to look like this:
  1. function replaceModel()
  2. local skin = engineLoadTXD ( "skins/80.txd" )
  3. engineImportTXD ( skin, 80 )
  4. local skin = engineLoadTXD ( "skins/81.txd" )
  5. engineImportTXD ( skin, 81 )
  6. end
  7. 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
Server Name: mR|Team Clan Race Server
Server IP: 84.82.81.225:22004

Image
TheRealCow
Snitch
 
Posts: 65
Joined: Fri Jun 04, 2010 10:16 am
Gang: mR|Team

Next

Return to Scripting

Who is online

Users browsing this forum: Google [Bot], mega9, XeoN- and 6 guests