Jump to content

Need help on custom model script!


TheSandwich

Recommended Posts

  
function replaceModel()  
        txd = engineLoadTXD("androm.txd", 592) 
    engineImportTXD(txd, 592) 
    dff = engineLoadDFF("androm.dff", 592 ) 
    engineReplaceModel(dff, 592) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel ) 
  

Link to comment
  
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! :D

Link to comment

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 ) 

Link to comment
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!

Link to comment
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> 

Link to comment
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?

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