MTA Team qaisjp Posted March 30, 2011 MTA Team Posted March 30, 2011 Is there a way to "unload" a TXD from a script. For example i have a vehicle mod. But I want to disable it only for the client using "/noinfernus". What mta function would i need to unload it
MTA Team qaisjp Posted March 30, 2011 Author MTA Team Posted March 30, 2011 Yes, that is what I need, but I DONT want to reupload the default TXD
MTA Team qaisjp Posted April 22, 2011 Author MTA Team Posted April 22, 2011 I just tested it now, and it turns out it when i do destroyElement on the txd/dff/col element it always returns false/nil. anyhelp?
diegofkda Posted April 23, 2011 Posted April 23, 2011 I just tested it now, and it turns out it when i do destroyElement on the txd/dff/col element it always returns false/nil. anyhelp? hmm... maybe server-side script: function warptheped(player) vehicle = getPedOccupiedVehicle(player) triggerClientEvent ("onDefaultInf", player) warpPedIntoVehicle ( player, vehicle) end addCommandHandler ("noinfernus", warptheped) client side script: addEvent ( "onDefaultInf", true ) function destroymodels() engineRestoreModel ( 411 ) end addEventHandler ("onDefaultInf", getLocalPlayer(), destroymodels) Its a client and server side event, because when you replace infernus DFF, and player is in it, player will get out, so this script makes the player get out and in. This will just restore old DFF, for destroy TXD do destroyElement ( TXD Element ) for example: txd_floors = engineLoadTXD ( "models/office_floors.txd" ) engineImportTXD ( txd_floors, 3781 ) for restore that, I don't have to put destroyElement ( 3781 ) obviously, not. Wrong: function floor() txd_floors = engineLoadTXD ( "models/office_floors.txd" ) engineImportTXD ( txd_floors, 3781 ) end addEventHandler ("onClientResourceStart", resourceRoot, floor) function destroyfloor() destroyElement ( 3781 ) end addCommandHandler ("nofloor", destroyfloor) Good: function floor() txd_floors = engineLoadTXD ( "models/office_floors.txd" ) engineImportTXD ( txd_floors, 3781 ) end addEventHandler ("onClientResourceStart", resourceRoot, floor) function destroyfloor() destroyElement ( txd_floors ) end addCommandHandler ("nofloor", destroyfloor) This destroy function is not destroying an ID, its destroying the TXD element. Btw, the real infernus TXD is just 300 kb. 1
MTA Team qaisjp Posted April 23, 2011 Author MTA Team Posted April 23, 2011 When I am talking about only the infernus, I have 50 other dff/col/txd. So I won't be reuploading 'em all. I don't care about the player warping out when replacing txd/dff/col but the problem is when I use destroyElement on the TXD element it returns false for some reason, I know the element exists 'cos getElementType(txdElement) == "txd"
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