TheSandwich Posted October 4, 2013 Posted October 4, 2013 Hi guys, I've been wondering if I could use custom ped models for script and not installing as a mod. Is it possible? I've seen some server loading up custom models as an AI and loading custom objects.
J.S. Posted October 4, 2013 Posted October 4, 2013 It's fairly simple actually, just use these functions engineImportTXD engineLoadDFF engineLoadTXD engineReplaceModel
mr.Extreme Posted October 4, 2013 Posted October 4, 2013 function replaceModel() txd = engineLoadTXD("androm.txd", 592) engineImportTXD(txd, 592) dff = engineLoadDFF("androm.dff", 592 ) engineReplaceModel(dff, 592) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel )
TheSandwich Posted October 4, 2013 Author Posted October 4, 2013 function replaceModel() txd = engineLoadTXD("androm.txd", 592) engineImportTXD(txd, 592) dff = engineLoadDFF("androm.dff", 592 ) engineReplaceModel(dff, 592) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel ) So Extreme123, how do I make the whole script? Do I have to place a folder with the model inside it? Also thanks!
mr.Extreme Posted October 4, 2013 Posted October 4, 2013 aha ok Create the file and name it replace put this Code function replaceModel() txd = engineLoadTXD("replace/androm.txd", 592) engineImportTXD(txd, 592) dff = engineLoadDFF("replace/androm.dff", 592 ) engineReplaceModel(dff, 592) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel )
TheSandwich Posted October 7, 2013 Author Posted October 7, 2013 aha ok Create the file and name it replace put this Code function replaceModel() txd = engineLoadTXD("replace/androm.txd", 592) engineImportTXD(txd, 592) dff = engineLoadDFF("replace/androm.dff", 592 ) engineReplaceModel(dff, 592) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel ) Sorry if it took me too long to reply once again. May I ask if this stream the models to both client and server? Thanks for your help!
Techial Posted October 7, 2013 Posted October 7, 2013 aha ok Create the file and name it replace put this Code function replaceModel() txd = engineLoadTXD("replace/androm.txd", 592) engineImportTXD(txd, 592) dff = engineLoadDFF("replace/androm.dff", 592 ) engineReplaceModel(dff, 592) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel ) Sorry if it took me too long to reply once again. May I ask if this stream the models to both client and server? Thanks for your help! That script is client-sided. It temprorarily replaces a model in the client's engine. Which means you need to download the model file to the client before launching script. After leaving the server, MTA replaces the downloaded file with a backup done BEFORE entering server. <meta> <file src="model.txd"/> <file src="model.dff"/> <script src="client.lua" type="client"/> </meta>
TheSandwich Posted October 8, 2013 Author Posted October 8, 2013 aha ok Create the file and name it replace put this Code function replaceModel() txd = engineLoadTXD("replace/androm.txd", 592) engineImportTXD(txd, 592) dff = engineLoadDFF("replace/androm.dff", 592 ) engineReplaceModel(dff, 592) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel ) Sorry if it took me too long to reply once again. May I ask if this stream the models to both client and server? Thanks for your help! That script is client-sided. It temprorarily replaces a model in the client's engine. Which means you need to download the model file to the client before launching script. After leaving the server, MTA replaces the downloaded file with a backup done BEFORE entering server. <meta> <file src="model.txd"/> <file src="model.dff"/> <script src="client.lua" type="client"/> </meta> Last question. (Thank you for the help I got it working!) How do I use this if I'm going to replace the anim/ped.ifp?
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