Jump to content

Im looking for working vehicle replace script!


SanZoR

Recommended Posts

Hello,

I been searching now there forums for a few mins, and i fount a lot of posts, where were people asking a model replacing script.

It seems they never get working one.

So, now im asking can someone make one. It should be just clientside script, so the new model is possible to download from my resource site. (I setted it to do so in server confing file) So it should work like this:

txd = engineLoadTXD ( "phoenix.txd" ) 
engineImportTXD ( txd, 603 ) 
dff = engineLoadDFF ( "phoenix.dff", 603 ) 
engineReplaceModel ( dff, 603 ) 

These new models are located in /resources/phoenix_mod/phoenix.txd & .dff aswell as the script.

It should replace all models instantly, i mean there is no /replace or another stuff, and downloads the mods instantly when player joins.

Im sure this is easy to make, but there is a lot of not-so-good lua scripters around, like me :)

Anyway, thanks in advance :D

Link to comment

function resourceStart ( thisResource ) 
  txd = engineLoadTXD ( "phoenix.txd" ) 
  engineImportTXD ( txd, 603 ) 
  dff = engineLoadDFF ( "phoenix.dff", 603 ) 
  engineReplaceModel ( dff, 603 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(), resourceStart ) 

<script src="replace.lua" type="client"/> 

use tags for phoenix.txd and phoenix.dff and that might just work (i'm not 100% confident, never dont it before :P)

Link to comment

function resourceStart ( thisResource ) 
  txd = engineLoadTXD ( "car.txd", 402 ) 
  engineImportTXD ( txd, 402 ) 
  dff = engineLoadDFF ( "car.dff", 402 ) 
  engineReplaceModel ( dff, 402 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(), resourceStart ) 

Change car.txd & car.dff to car that you would like to replace. Also the "402" number to the ID of the vehicle. See all ID:s in http://www.vces.net/info/index.php

And:

<meta> 
<info author="SanZoR" name="car_mod" version="1" type="script" /> 
<script src="car.lua" type="client" /> 
<file src="car.dff" /> 
<file src="car.txd" /> 
</meta>  

...

I think you know this long what to do :D

Link to comment
Yes i know, my code is ok, but it just doesn't replace the models, i got the same script as you, it downloads the files and when i replace it it does nothing, even no error in the log..

are you then actually creating a vehicle?

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