Jump to content

[Resolved][Problem] Custom TXD's


Recommended Posts

Hello,

In my server we are working on some factions and we would like to change the billboards textures.

So I took exemple on "thevillage" map.

- I search the billboards in the map editor, I took their ID's (4238 and 4729).

- I search with IMG tool the textures. (billbrd01_lan and billbrd01_lan2) then I extract them to my deskop.

- I open the txd's with TXD workshop, I modify and I save.

- I make the directory "textures" in my map directory, I put the 2 TXD's in it.

- I modify my meta.xml and add these lines :

  
    <file src="textures/billbrd01_lan.txd" /> 
    <file src="textures/billbrd01_lan2.txd" /> 
    <script src="textures.lua" type="client" /> 

- I create a textures.lua in my map directory. In it there are these lines :

function replaceTXD()  
  
txd = engineLoadTXD("textures/billbrd01_lan.txd") 
  engineImportTXD(txd, 4238) 
   
txd = engineLoadTXD("textures/billbrd01_lan2.txd") 
  engineImportTXD(txd, 4729) 
  
  
  
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceTXD) 

I restart the server... But nothing is modified...

Can anyone help me ?

Thanks in advance,

dragonofdark

Edited by Guest
Link to comment

Using files in directory's can be quite tricky sometimes, try this (notice the backslashes):

meta.xml

    <file src="textures\billbrd01_lan.txd" /> 
    <file src="textures\billbrd01_lan2.txd" /> 
    <script src="textures.lua" type="client" /> 

textures.lua

function replaceTXD()  
  
txd = engineLoadTXD("textures\\billbrd01_lan.txd") 
  engineImportTXD(txd, 4238) 
   
txd = engineLoadTXD("textures\\billbrd01_lan2.txd") 
  engineImportTXD(txd, 4729) 
  
  
  
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceTXD) 

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