Jump to content

toogle for replacemodels


Recommended Posts

Posted

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) 
  

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

bad element pointer destroyelement(1)

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
  
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 
)   
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

I don't know, but I think my code should also work, I could have used a variable like you did, but I wanted to see if it was possible to make it without it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

working..!

thx kenix

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

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