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

Function

fileWrite

Server and clientFilesIdentical to MTA:SA

Writes strings from the current position (each argument one after another) and moves the position. Supports binary data.

Syntax

int fileWrite(file theFile, string string1 [, string ...])

Arguments

theFilefile
A file handle.
string1string
The first string.
...string, optional
More strings.

Returns

Number of bytes written, or false (e.g. a read-only file).

Example

local file = fileCreate("scores.csv")
fileWrite(file, "gracz;punkty\n", "Jan;150\n", "Ola;210\n")
fileClose(file)

See also