Advertisement
kristroscoe

Untitled

Mar 29th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 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..base64Encode(fileRead(hFile, 500))-- ... read the next 500 bytes...
  8.         end
  9.         fileClose(hFile)                                      -- close the file once we're done with it
  10.     else
  11.         outputConsole("Unable to open the model file")
  12.     end
  13.     local enBuffer = teaEncode(buffer, "xTN5#Gqm=sKn**dF") 
  14.     local deBuffer = base64Decode(teaDecode(enBuffer, "xTN5#Gqm=sKn**dF"))
  15.     engineImportTXD(engineLoadTXD('tex.txd',true) , 596)
  16.     engineReplaceModel(engineLoadDFF(deBuffer)  , 596)
  17.     end  
  18. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement