Jump to content

[HELP] Change Car


warlitsh

Recommended Posts

Hi , I need help.

I can replace the car with:

function Model() 
      txd = engineLoadTXD("name.txd", 411 ) 
      engineImportTXD(txd, 411) 
      dff = engineLoadDFF("name.dff", 411 ) 
      engineReplaceModel(dff, 411) 
    end 
    addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), Model) 

But I try to have the original car + Change car.

how to do this?

(Sorry for my bad english...)

Thx for help. :)

Link to comment
function newcar()  
  txd = engineLoadTXD("name.txd", 411 ) 
  engineImportTXD(dff, 411) 
  dff = engineLoadDFF("name.dff", 411 ) 
  engineReplaceModel(dff, 411) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), newcar) 
  
addCommandHandler ( "newcar", newcar ) 

Edited by Guest
Link to comment

You can try this, but i havn't tested it.

local isCarModEnabled = false 
function newcar ( )  
    if not isCarModEnabled then 
       local txd = engineLoadTXD("name.txd", id ) 
       engineImportTXD(dff, id) 
       local dff = engineLoadDFF("name.dff", id ) 
        engineReplaceModel(dff, id) 
        isCarModEnabled = true 
    else 
        engineRestoreModel ( id ) 
        isCarModEnabled = false 
    end 
end 
addCommandHandler ( "newcar", newcar ) 

Link to comment
You can try this, but i havn't tested it.
local isCarModEnabled = false 
function newcar ( )  
    if not isCarModEnabled then 
       local txd = engineLoadTXD("name.txd", id ) 
       engineImportTXD(dff, id) 
       local dff = engineLoadDFF("name.dff", id ) 
        engineReplaceModel(dff, id) 
        isCarModEnabled = true 
    else 
        engineRestoreModel ( id ) 
        isCarModEnabled = false 
    end 
end 
addCommandHandler ( "newcar", newcar ) 

Both are working. x)

Link to comment
You can try this, but i havn't tested it.
local isCarModEnabled = false 
function newcar ( )  
    if not isCarModEnabled then 
       local txd = engineLoadTXD("name.txd", id ) 
       engineImportTXD(dff, id) 
       local dff = engineLoadDFF("name.dff", id ) 
        engineReplaceModel(dff, id) 
        isCarModEnabled = true 
    else 
        engineRestoreModel ( id ) 
        isCarModEnabled = false 
    end 
end 
addCommandHandler ( "newcar", newcar ) 

Both are working. x)

lolz, then why not post the correct one? :wink:

Link to comment
You can try this, but i havn't tested it.
local isCarModEnabled = false 
function newcar ( )  
    if not isCarModEnabled then 
       local txd = engineLoadTXD("name.txd", id ) 
       engineImportTXD(dff, id) 
       local dff = engineLoadDFF("name.dff", id ) 
        engineReplaceModel(dff, id) 
        isCarModEnabled = true 
    else 
        engineRestoreModel ( id ) 
        isCarModEnabled = false 
    end 
end 
addCommandHandler ( "newcar", newcar ) 

Thanks you ! Is perfect for my server ! Sorry I debuted in script :)

I'll add you to the credit of my server!

Link to comment
You can try this, but i havn't tested it.
local isCarModEnabled = false 
function newcar ( )  
    if not isCarModEnabled then 
       local txd = engineLoadTXD("name.txd", id ) 
       engineImportTXD(dff, id) 
       local dff = engineLoadDFF("name.dff", id ) 
        engineReplaceModel(dff, id) 
        isCarModEnabled = true 
    else 
        engineRestoreModel ( id ) 
        isCarModEnabled = false 
    end 
end 
addCommandHandler ( "newcar", newcar ) 

Thanks you ! Is perfect for my server ! Sorry I debuted in script :)

I'll add you to the credit of my server!

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