Features
Camera
The Camera app, the Photos gallery, uploads and the lens tuning panel.
The Camera app takes photos and videos with the phone's rear lens or its front (selfie) lens. The picture is the game itself, seen from where the phone is, so filters, zoom and the flash all show in the shot. Every shot is uploaded to your upload provider and saved in the Photos app.
| Part | What it is |
|---|---|
| Camera | Four modes, two lenses, zoom, flash, filters, a grid, upright or landscape. Walking and turning while you aim |
| Photos | The gallery: albums, favourites, a search by place, wallpapers, sharing |
| Uploads | Where the files are stored. Set once in config_server.lua |
#How it works for the player
#Modes
The strip above the shutter switches between four modes.
| Mode | What it takes |
|---|---|
| Video | A video, up to Config.Limits.VideoSeconds seconds. Recording stops by itself at the limit |
| Photo | A photo of the whole viewfinder: what is on the phone's screen is what is saved |
| Portrait | A photo with the background blurred by the game's depth of field: the subject (a person from head to foot, an object, a car) stays sharp. Needs the player's Post FX setting at High or above. The badge on top says Natural Light |
| Square | A 1:1 photo, framed between two light bands |
#Landscape
The rotate button in the camera's top bar turns the phone on its side (its label reads Landscape, and Portrait to turn it back). The viewfinder is then laid out wide, so it takes in much more of the scene to the left and right. Photos become 4:3 instead of 3:4, the dark bands move to the left and right, and the controls move to the sides. Videos are recorded wide. The button cannot be used while a video is recording.
#Lenses and zoom
| Lens | Buttons | With the mouse wheel |
|---|---|---|
| Rear | 0.5x, 1x, 2x, 3x, 5x, 8x | Anywhere from 0.5x to 8x |
| Front | 0.5x, 1x | Anywhere from 0.5x to 2x |
0.5x is the ultra-wide lens and 3x the telephoto. The wheel zooms in tenths, between and past the buttons, and it works over the viewfinder and over the game screen beside the phone. Switch Camera flips to the other lens, which always starts on 1x.
#Flash
The flash button cycles Flash Auto, Flash On and Flash Off. The choice is remembered on the player's game.
- Auto fires between 20:00 and 06:00 on the game clock, and at any hour indoors.
- With the rear lens the flash is a real light: a short, bright burst in front of the phone. Players within 60 metres see it light up the scene.
- With the front lens the screen turns white for a moment before the photo is taken.
- In Video mode, Flash On keeps the light on like a torch while the camera is open.
#Turning and walking
The lens turns in two ways: drag on the viewfinder, or hold Left Alt and move the mouse (as when looking around with the phone open). While Left Alt is held, the wheel zooms. A tap without a drag only shows the focus square. For the first five seconds the viewfinder shows a hint: Drag to turn, WASD to walk, Wheel to zoom.
How turning and walking behave depends on the lens and on where the character is:
| Situation | Turning | Walking |
|---|---|---|
| Rear lens, on foot | Turns the character. Up and down tilts the lens (60 degrees each way) | W walks where the lens looks, A and D step sideways, like a first-person view |
| Front lens, on foot | The lens swings round the face: 45 degrees left and right, 20 up and down. The character looks into the lens | W walks forward, A and D turn the character, S does nothing |
| In a vehicle | The rear lens can turn all the way round. The front lens swings round the face as on foot | The vehicle drives as usual |
Details that follow from this:
- On foot the character walks, it does not run (
Config.Camera.WalkOnly = true). Sprint is switched off while the camera is open. In a vehicle this does not apply. - On foot with the rear lens, the game is put in first-person view mode while the camera is open, and set back when it closes. The lens follows the character's heading smoothly, so the sway of a walk does not shake the picture.
- With
Config.Camera.HideSelf = true, the player's own character is left out of the picture on foot with the rear lens, as a real rear camera cannot see the person holding it. Only on their own screen: other players still see them. In a vehicle the character stays in the picture. The shipped value isfalse: the character is drawn. - In a vehicle the rear lens can be turned all the way back to the player. Once it is turned past the shoulder it draws from as close as the front lens, so the face shows instead of being cut away.
- The phone, its case and its accessories are never drawn in the player's own camera, with either lens. Other players see them in the hand.
#Filters
The filter button opens a strip of the filters in Config.Camera.Filters, each with a live thumbnail. A filter changes how the game itself is drawn while the camera is open, so it is in the photo or the video. It is switched off when the camera closes.
#Taking a photo or a video
- The shutter plays a sound. With 3D Sounds on in Settings, and fx-sound or xsound on the server, nearby players hear it too.
- With the reaching arm switched on (
Config.Camera.Arm.Enabled = true), the hand dips for a moment, like a thumb pressing the button (Config.Camera.Arm.Press). - The shot shrinks into the last-photo button, which shows a progress ring while it uploads. Tapping it opens the shot in Photos.
- A video is recorded as WebM, at about 1.5 Mbit/s. A still from its first frame is uploaded as its thumbnail.
#The sound of a video
A video is recorded with the player's microphone, cleaned the same way as a voice message (noise out, level set right). If the player has no microphone, or the game is not allowed to use it, the video is silent.
Music playing through fx-sound (the music app, car radios and speakers built on it) is mixed in behind the voice, quietly: its level is steered to about 14 dB under the voice whatever the volume in the game, and its top is taken off, so it sounds like a radio in the background and never covers the speaker. This needs fx-sound from this package (its page hands the sound over; an older fx-sound simply gives no music).
Nothing else of the game can be recorded: the engine, the world, weapons and other players' voices never reach a page. That is a limit of FiveM, not a setting.
#What other players see
The character holds the phone in the camera pose (Config.Camera.Pose), and the phone stays in the hand.
By default the arm keeps that pose (Config.Camera.Arm.Enabled = false). Set it to true and the arm reaches for the lens instead: turn the camera and the hand goes with it. It is off by default because the game moves the hand but not the phone in it, so to other players the phone could hang in the air away from the hand. With the arm on:
Arm.Sync = truelets other players within 40 metres see the arm move too.- With the front lens the arm stays straight ahead while the lens swings round the face, unless
Arm.SelfieFollows = true. Following the front lens looked jumpy to other players, who only get the hand's position a few times a second.
#When the camera closes by itself
When the phone is put away, when the player dies or goes down, and when the resource stops.
#Photos
Every photo and video the camera takes lands in Photos. Photos received by AirDrop and saved by scripts land there too.
- Library with every item, grouped by day, month and year.
- Albums: the player's own albums (at most
Config.Media.MaxAlbums), plus Recently Saved, Favorites and Videos. - Search by place, album or month. Each shot remembers the district (or the street) it was taken in.
- Use as Wallpaper for the lock screen, the home screen or both.
- Share opens AirDrop (below).
- Delete removes the item from the library and every album.
A player keeps at most Config.Media.MaxItems photos and videos. When the gallery is full, new shots are refused with "Your gallery is full. Delete some photos or videos and try again."
The View Options filters Shared With You, Taken by Me and Not in an Album use where each item came from.
#AirDrop
Share sends a photo to a player standing nearby. Only players within Config.Airdrop.Range metres who allow AirDrop from you appear in the list. They get an offer with Accept and Decline; an accepted photo is saved to their Photos. An offer nobody answers is withdrawn after Config.Airdrop.OfferSeconds seconds. AirDrop also shares contacts and locations.
#Setting it up
The camera works with nothing installed. To save and send shots you need an upload provider: photos, videos, voice messages and profile pictures are stored there, never in the database.
- Pick a provider and set your key in
config_server.lua, underServerConfig.Upload.Provideris one of'fivemanage','fmapi','relay','custom'or'none'. Every provider is explained in Upload integration. - If players or scripts use images from another host, add it to
ServerConfig.Upload.AllowedHosts. Links from hosts that are not allowed, and from hosts inServerConfig.Upload.BlockedHosts, are refused. - Restart the resource after changing
config_server.lua.
How a file travels:
- fivemanage, fmapi, relay: the server signs a one-time upload link, and the player's game sends the file straight to the provider. Files up to
Config.Limits.UploadByteswork. - custom (unless you made it presign): the file goes through the game server in small parts, and is limited to 1 MB. Photos are shrunk to fit; the player sees "Slow upload: this server sends photos through the game connection." A video over 1 MB cannot be sent this way.
- none: the camera still opens, but nothing can be saved or sent.
#When the live preview cannot start (Config.Screenshot)
On some game clients the viewfinder cannot show the game. The camera then shows Camera Not Available with a Try Again button. The shutter still works: the photo is taken with screenshot-basic or utk_render instead.
| Value | Result |
|---|---|
'auto' (default) |
Uses screenshot-basic if it is installed, otherwise utk_render, otherwise none |
'screenshot-basic' |
Uses screenshot-basic |
'utk_render' |
Uses utk_render |
Without either resource the shutter cannot take a photo in this state. Videos cannot be recorded in this state at all. The same resource also carries the picture of a video call when the in-phone capture stops working (see Calls).
#Options
#Config.Camera
| Option | Default | What it changes |
|---|---|---|
Filters |
Original, Vivid, Warm, Cool, Noir, Neon | The filters offered. See the fields below |
Pose.Rear |
'photo' |
Pose held with the rear lens. 'photo': the phone raised in front of the face with one hand. 'selfie': the phone held out at arm's length |
Pose.Front |
'photo' |
Pose held with the front lens, same values |
HideSelf |
false |
true: on foot with the rear lens, the player's own character is not drawn on their own screen. false: it is drawn, and its arms swing through the picture while walking. It ships off because anticheats with an invisible-player check can flag the hiding |
WalkOnly |
true |
With the camera open the character walks and cannot sprint. false: it moves at any pace |
SelfieDistance.Photo |
0.45 |
Metres between the front lens and the face in the Camera app |
SelfieDistance.Video |
0.46 |
The same in a video call (only used with Config.Video.TakeOverView = true, see Calls). Further out than the hand holding the phone (about 0.4) the hand gets in the picture |
SelfieFlashPower |
1.0 |
The front camera's flash: the screen turns white and its glow softly lights the face in the game. 0.5 half as bright, 2.0 twice, 0.0 no light (the screen still turns white); up to 3.0 |
SelfieNearClip |
0.17 |
Front lens: nothing closer to the lens than this many metres is drawn. This keeps the hand holding the phone out of selfies and video calls. Never more than 40 % of SelfieDistance, and never more than 0.3 |
TuneCommand |
'phonecam' |
The command that shows the lens tuning panel (see Tuning the lens in game below). false removes it |
TuneRole |
'god' |
Who may use the panel: 'god', 'admin' or 'moderator' (the phone's admin roles, see Admin tablet). false: nobody |
Arm.Enabled |
false |
true: the arm reaches for the lens and follows it. false: the arm keeps the pose and the phone stays in the hand |
Arm.Sync |
true |
Other players see the arm move. false: only the player holding the camera does |
Arm.Selfie |
Back = 0.10, Drop = 0.18, Side = 0.08 |
Where the hand sits for the front lens, in metres from the lens: behind it, below it, towards the phone hand's shoulder |
Arm.SelfieFollows |
false |
Front lens: false keeps the arm straight ahead while the lens swings round the face. true: the arm follows the lens |
Arm.Rear |
Back = 0.04, Drop = 0.13, Side = 0.05 |
The same for the rear lens |
Arm.Follow |
12.0 |
How quickly the hand catches up with the lens. Higher is tighter, lower is softer |
Arm.Press |
0.025 |
Metres the hand dips when a photo is taken. 0 turns it off |
Every Arm option other than Enabled only matters while Arm.Enabled = true.
Each filter is { id, label, timecycle, screeneffect, strength }:
| Field | What it does |
|---|---|
id |
Unique id. The name shown comes from the locale (camera.filters.<id>), label is used when there is none |
timecycle |
A timecycle modifier name |
screeneffect |
An animpostfx name, used instead of or on top of timecycle |
strength |
Strength of the timecycle modifier, 0.0 to 1.0 |
Keep the original entry: it is the "no filter" choice.
SelfieDistance values are kept between 0.25 and 0.8. Pose values other than 'photo' and 'selfie' fall back to 'photo'. In a vehicle the in-car phone clip is used, whatever Pose says. With Config.Animation.Style = 'custom', the clips in Config.Animation.Custom.camera (rear) and Config.Animation.Custom.selfie (front) replace the poses.
#Tuning the lens in game
Where the lens stands decides how a selfie, a video call or a live stream is framed, and a seat in a car frames a face very differently from a character standing in the street. Instead of guessing numbers in config.lua, an admin can move the lens while looking at the picture:
- Type
/phonecam(in chat, orphonecamin the F8 console). A panel appears beside the phone. - Open the phone's camera: the Camera app, a video call or a live stream.
- Move the sliders (or use − and +, Shift for ten steps). The picture follows at once, on your screen only.
- Save applies the set to every player immediately. Undo drops what was not saved, Default removes the saved set so the built-in values apply again.
/phonecamagain, or the ×, puts the panel away.
A set belongs to four things, and the panel always shows the one in use (its title names it, and it swaps by itself when any of them changes):
| What | Values |
|---|---|
| Lens | front, rear |
| Place | on foot, in a vehicle, on a motorbike / bicycle |
| How the phone is held | upright, on its side (the camera's turn button) |
| Zoom stop | 0.5x, 1x, 2x, 3x, 5x, 8x (the lens buttons; the front lens has 0.5x, 1x and 2x) |
So "rear camera, in a vehicle, upright, 0.5x" is one set and "rear camera, in a vehicle, upright, 1x" another: what is right for the wide lens is rarely right for the next one. To tune a stop, press its lens button and move the sliders; between two stops the panel edits the nearer one.
A stop that has no set of its own is not empty. It uses, in this order: the set of that way of holding without a stop, the upright set of the same stop, the plain set of the lens and place (what was saved before stops existed), and last the built-in values. The panel says which one the numbers come from. Tune the plain cases first and only the stops that look wrong after that.
While playing, the lens glides from one stop's set to the next as the wheel zooms, so nothing jumps. With the panel open it stands exactly as the set being edited says, at any zoom, so what you see is what you save.
In camera_lens.json the keys read rear_vehicle (plain), rear_vehicle@0.5 (a stop), rear_vehicle_land (on its side) and rear_vehicle_land@2 (both).
| Slider | What it moves |
|---|---|
| Distance | Front lens: metres from the head. Rear lens: metres in front of the eyes |
| Height, Left / right | The lens up, down and sideways from there |
| Aim height | Front lens: the height on the head it looks at |
| Field of view | The 1x lens's angle in degrees. The zoom levels follow from it |
| Near clip | Nothing closer to the lens than this is drawn (a roof lining, hair, the hand) |
| Yaw, Pitch | Where the lens starts: round the head (front) or turned from straight ahead (rear) |
The panel's second tab, Phone hold, does the same for the phone in the hand: three offsets and three turns, kept apart for on foot, in a vehicle and on a motorbike / bicycle. It needs no camera, only the phone in the hand. The clip used in a seat is a car passenger's; on a bike it left the screen turned away from the rider, so the built-in bike setting turns the phone half round (Turn Z 180). If a bike or a custom animation still holds it wrong, this is where to fix it.
Saved sets are kept in camera_lens.json in the resource folder, one line per set, and win over SelfieDistance and SelfieNearClip for that lens and place. Copy the file to move the tuning to another server; delete it (or a line in it) and restart to go back to the built-in values.
#Other options
| Option | Default | What it changes |
|---|---|---|
Config.Limits.VideoSeconds |
30 |
Longest video |
Config.Limits.UploadBytes |
6 1024 1024 |
Largest file a player can upload |
Config.Media.MaxItems |
1000 |
Photos and videos per player |
Config.Media.MaxAlbums |
50 |
Albums per player |
Config.Screenshot |
'auto' |
The fallback capture resource, see above |
Config.Sound.Enable3D |
true |
Nearby players can hear the shutter (and ringtones) |
Config.Airdrop.Enabled |
true |
AirDrop on or off |
Config.Airdrop.Range |
12.0 |
Metres within which players show up in AirDrop |
Config.Airdrop.OfferSeconds |
30 |
Seconds before an unanswered offer is withdrawn |
#For developers
- Open the camera from your own script and get the URL of the shot:
OpenCamera, see Client exports: camera. The same page hasIsCameraOpenandSaveToGallery. - Add a photo to a player's gallery from the server, or read their photos:
AddGalleryPhoto,GetPhotosandAirSharein Server exports: media. - The client event
fx-phone:cameraToggledfires withtruewhen the camera view opens andfalsewhen it closes.
#Good to know
- The hand shows at the bottom of a photo (with
Arm.Enabled = true). RaiseArm.Rear.Drop(orArm.Selfie.Dropfor the front lens). - Players cannot run with the camera open. That is
WalkOnly = true. Set it tofalseto allow sprinting. - The selfie shows too much head sway or too little face. Change
SelfieDistance. The wheel still zooms from there. - The picture is wrong only in a car (too close, the roof in the way, hair cut off). Tune that lens with
/phonecamwhile sitting in the car: the in-vehicle sets are separate from the on-foot ones. - Fingers show in a selfie or a video call, or the tip of the nose is cut off. Change
SelfieNearClip: raise it if fingers still show, lower it if the nose is cut off. - Photos are taken but never appear. No upload provider, a wrong key, or a misspelt provider name. The server console says which: for example
uploads are off: ServerConfig.Upload.Provider "x" is not available. - Longer videos. A video uses about 11 MB a minute. A 30 second video is about 5.6 MB, just under the default
Config.Limits.UploadBytes. If you raiseVideoSeconds, raiseUploadByteswith it, and check the file limit of your provider. - Discord image links do not work. Discord's CDN is in
BlockedHostsby default, because its links expire within a day. - A player can upload at most 20 files a minute. More are refused until the minute has passed.
- Other players do not hear the shutter. It needs fx-sound or xsound,
Config.Sound.Enable3D = true, and 3D Sounds switched on in the player's own Settings. Silent Mode mutes it. - Filters in your own list do nothing. The
timecycleorscreeneffectname must exist in the game. A wrong name gives no error, just no effect. The small thumbnails in the filter strip only imitate the shipped filters; for an id of your own the thumbnail shows the plain picture, while the viewfinder shows the real effect.