ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. fileCreate

Function

fileCreate

Server and clientFilesIdentical to MTA:SA

Creates a new file or empties an existing one and opens it for writing. On the client the files go to a private folder for that server on the player's computer (limit 64 MB per file and 256 MB per server).

Syntax

file fileCreate(string filePath)

Arguments

filePathstring
File path.

Returns

A file handle, or false.

Example

local file = fileCreate("settings.json")
if file then
    fileWrite(file, toJSON({ volume = 0.5, hud = true }))
    fileClose(file)
end

See also