Jump to content

help me understand this a little bit


5150

Recommended Posts

so im not new to scripting, i just honestly suck lol. ive always used modloaders to load my skins/weps/vehs into my server, but i figured its time to learn it the old fashioned way. can someone just answer the questions i noted in this script?

function replaceTXD()  
  
txd = engineLoadTXD("txd name.txd") 
  engineImportTXD(txd, 11245) -- <- ID number as you would find in map editor? 
-------------------------------------------------------------------- 
txd2 = engineLoadTXD("txd name.txd")-- <----- if i do more than one texture in one script, do i have to label them txd, txd1, txd2..... etc? 
  engineImportTXD(txd2, 10381) -- <----- why is there more than one engineImportTXD for the same txd file? 
  engineImportTXD(txd2, 10378) 
  engineImportTXD(txd2, 10379) 
  engineImportTXD(txd2, 10377) 
  
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceTXD) 
  
-- is this client or serverside? 
-- also, will this work with any txd file? or only certain ones? i know they dont work with different paintjobs 

Link to comment

Yes, you can use the map editor to find Model IDs for objects, vehicles and ped skins.

engineLoadTXD returns a TXD file, meaning it will store a pointer inside the given variable for later reference. If you were to do this once, and then a second time - it would replace the first one. So to answer your question, yes, you would either need to use different variables or a table.

The variable will contain the pointer to the TXD file so long as you don't clear the variable or overwrite it. Thus, you can apply it to multiple objects if you need to.

Link to comment

Well, first of all you're using the event "onClientResourceStart". So that should be rather obvious. Also, when you use the [lua] tags on these forums, functions will be highlighted in a certain colour. Red means it's client-side only, Orange means it's server-side only and blue means it's available both for client and server.

As for the TXDs working, I'm not quite sure what you're asking. So long as the TXD is set up properly, then yes, it should work.

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