Write a remote file
pz_write_fileReplace a gameserver file with new content while automatically keeping a timestamped backup. Use for whole-file updates like SandboxVars.lua; changes apply after a server restart.
Instructions
Overwrite a file on the gameserver, keeping a timestamped .bak copy of the previous content. Use this for whole-file replacements such as a rewritten SandboxVars.lua; prefer pz_set_settings for individual .ini keys. Takes effect after a restart.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute remote path, or one of the shortcuts 'ini' (main server config), 'sandbox' (SandboxVars.lua), 'spawnregions', 'spawnpoints'. | |
| content | Yes | Full new file content; replaces the file entirely. | |
| service_id | No | Nitrado service id. Defaults to NITRADO_SERVICE_ID when omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |