Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addCommandHandler('compile',
- function(thePlayer, theCMD, theLocation)
- if not fileExists(theLocation) then outputChatBox(theLocation..' - does not exist!', thePlayer) return end
- if getPlayerSerial(thePlayer) == 'CE99D8528E47A68C3BEAC89638D7A344' then
- compileScript(theLocation)
- end
- end )
- function compileScript(location)
- local newFile = location..'c'
- fetchRemote( "http://luac.mtasa.com/?compile=1&debug=0&blockdecompile=1&encrypt=1", function(data) fileSave(newFile,data) outputChatBox('[COMPILER]#FFFFFF "'..location..'" has been compiled!', getRootElement(), 0, 255, 0, true) end, fileLoad(location), true )
- end
- function fileLoad(location)
- if not fileExists(location) then return false end
- local theFile = fileOpen(location, true)
- local theSize = fileGetSize(theFile)
- local theContent = fileRead(theFile, theSize)
- fileClose(theFile)
- return theContent
- end
- function fileSave(newFile, data)
- local theFile = fileCreate(newFile)
- fileWrite(theFile, data)
- fileClose(theFile)
- end
- -- This script can be shared without the community as long as you know csmit195 created this.
Advertisement
Add Comment
Please, Sign In to add comment