Jump to content

TXD Unloader?


qaisjp

Recommended Posts

  • 4 weeks later...
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.

  • Like 1
Link to comment

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"

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