Jump to content

toogle for replacemodels


Recommended Posts

I dont know very much how use the toogle fuction

i have this..

how i can do to enable or disable mod with f6 for example

function replaceModel()  
  txd = engineLoadTXD("models/fbi.txd", 490 ) 
  engineImportTXD(txd, 490) 
  dff = engineLoadDFF("models/fbi.dff", 490 ) 
  engineReplaceModel(dff, 490) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 
  

Link to comment
function replaceModel() 
    if (txd and dff) then 
        destroyElement(txd) 
        destroyElement(dff) 
    else 
        txd = engineLoadTXD("models/fbi.txd", 490 ) 
        engineImportTXD(txd, 490) 
        dff = engineLoadDFF("models/fbi.dff", 490 ) 
        engineReplaceModel(dff, 490) 
    end 
end 
bindKey("F6","down",replaceModel) 
addEventHandler ( "onClientResourceStart", resourceRoot, replaceModel) 

Link to comment
  
local txd, dff, state 
  
bindKey( 'F6', 'down', 
    function( ) 
        state = not state 
        if state then 
            txd = engineLoadTXD( 'models/fbi.txd', 490 ) 
            engineImportTXD( txd, 490 ) 
            dff = engineLoadDFF( 'models/fbi.dff', 490 ) 
            engineReplaceModel( dff, 490 ) 
        else 
            destroyElement( txd ) 
            destroyElement( dff ) 
        end 
    end 
)   
  

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