5150 Posted December 1, 2015 Share Posted December 1, 2015 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
Anubhav Posted December 1, 2015 Share Posted December 1, 2015 1. Yes the ID's in map editor. 2. Yes but you can do it like this also: txd, txd2, txd7. It doesn't matter much as long as they're different to avoid confusion. 3. For replacing that model ID's txd with the same one. You can apply it on multiple objects. Link to comment
Dealman Posted December 1, 2015 Share Posted December 1, 2015 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
5150 Posted December 3, 2015 Author Share Posted December 3, 2015 thanks guys. what about the ones at the very bottom when you scroll? Link to comment
Dealman Posted December 3, 2015 Share Posted December 3, 2015 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
5150 Posted December 4, 2015 Author Share Posted December 4, 2015 also, do i have to include the .txd with the zip file or can it be seperate? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now