BorderLine Posted March 5, 2012 Posted March 5, 2012 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
Castillo Posted March 5, 2012 Posted March 5, 2012 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. Education is the most powerful weapon which you can use to change the world.
BorderLine Posted March 5, 2012 Author Posted March 5, 2012 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
Kenix Posted March 5, 2012 Posted March 5, 2012 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.
Castillo Posted March 5, 2012 Posted March 5, 2012 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. Education is the most powerful weapon which you can use to change the world.
BorderLine Posted March 6, 2012 Author Posted March 6, 2012 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
Kenix Posted March 6, 2012 Posted March 6, 2012 No problem. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now