Jump to content

[help] enable files and the script is not working


d7ici

Recommended Posts

hello i want active txd and dff Without bearing the file on the other party

 

-- Server 

addCommandHandler ( "LoadCar" , function ( player ) 
local txd1,dff1 = fileOpen ( ":car/576.txd" ) , fileOpen ( ":car/576.dff" ) 
if ( txd1 and dff1 ) then 
local txd,dff = fileRead ( txd1 , fileGetSize ( txd1 ) ) , fileRead ( dff1 , fileGetSize ( dff1 ) )
triggerLatentClientEvent ( player , "acceptCar" , 5000,false,player,txd,dff)
print(tostring(fileGetSize ( txd1 )))
print(tostring(fileGetSize ( dff1 )))
fileClose ( txd1 )
fileClose ( dff1 )
end
end ) 

-- Client 

addEvent ( "acceptCar" , true )
addEventHandler ( "acceptCar" , root , function ( t1 , d1 )
print("done1")
txd1 = engineLoadTXD ( t1 )
dff1 = engineLoadDFF ( d1,576 )
engineImportTXD ( txd1, 576 )
engineReplaceModel ( dff1, 576 )
end )

 sorry for bad language 

Link to comment

hello, after a long effort, I finally managed to run your code. I think the problem is about entering a low value for the bandwith parameter, but if you enter a high amount here, the problem will be solved, I'll send you the code I tried.

server:

addCommandHandler ("LoadCar",function(player) 
txd1 = fileOpen("sultan.txd")
dff1 = fileOpen("sultan.dff") 

local txd = fileRead (txd1, 100*1024*1024)
local dff = fileRead(dff1, 100*1024*1024)
triggerLatentClientEvent(player,"acceptCar",100*1024*1024,false,player,txd,dff)
fileClose (txd1)
fileClose (dff1)

end) 

client:

addEvent ("acceptCar", true)
addEventHandler ("acceptCar",root,function(t1 ,d1)
outputDebugString("test")
txd1 = engineLoadTXD ( t1 )
dff1 = engineLoadDFF ( d1,576 )
engineImportTXD ( txd1, 576 )
engineReplaceModel ( dff1, 576 )

end)

 

triggerLatentClientEvent(player,"acceptCar",100*1024*1024,false,player,txd,dff) -- max bandwidth : 100 MB

When you type LoadCar it will load your model with a little delay.

Edited by Burak5312
  • Like 1
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...