Advertisement
kristroscoe

Untitled

Mar 29th, 2020
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. addEventHandler('onClientResourceStart', resourceRoot,  
  2.     function()
  3.     local buffer   
  4.     local hFile = fileOpen("model.dff")             -- attempt to open the file
  5.     if hFile then                                  -- check if it was successfully opened  
  6.         while not fileIsEOF(hFile) do              -- as long as we're not at the end of the file...
  7.             buffer = buffer..fileRead(hFile, 500)          -- ... read the next 500 bytes...
  8.                               -- ... and output them to the console
  9.         end
  10.         fileClose(hFile)                            -- close the file once we're done with it
  11.     else
  12.         outputConsole("Unable to open the model file")
  13.     end
  14.     local enBuffer = teaEncode( base64Encode( buffer ), "xTN5#Gqm=sKn**dF" )   
  15.     local deBuffer = base64Decode( teaDecode( enBuffer, "xTN5#Gqm=sKn**dF" ) )
  16.     local txd = engineLoadTXD('tex.txd',true)
  17.     engineImportTXD(txd, 596)
  18.     local dff = engineLoadDFF(deBuffer)  
  19.     engineReplaceModel(dff, 596)
  20.     end  
  21. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement