Try the new CitizenFX C# templates for FiveM

We’ve recently published the CitizenFX.Templates package on NuGet, which includes a nice template for making a fully C#-based resource using the latest recommendations. The docs will be updated whenever more people confirm this works and report some feedback as to this, but for now here’s the steps to set it up: You’ll find helpful instructions […]

Using the new console key bindings

In future versions of FiveM (currently a partial implementation is on canary), you’ll be able to define keyboard bindings in a new way, as originally detailed in the 2018 design document “Configuration & Input – Redesigned“. Here’s a sample snippet of a simple ‘hands up’ binding: These bindings will be editable by the user in […]

Optimizing resource downloads using a caching proxy

Server builds starting at pipeline ID 1679 added the ability to configure the fileServer field used for resource downloading using a set of commands: There’s currently no cache invalidation logic based on hashes (this’ll need yet another server update due to the file server not ignoring query strings + a client update), so make sure […]

OneSync: intercepting game events (such as explosions)

The latest version of the server (1543+) added support for parsing and preventing routing of game events. This currently only supports parsing CExplosionEvent, but this might be a fairly useful one to prevent routing of ‘excessive’ explosions, or explosions that are ‘too close’ to a player and not of the correct weapon type. Here’s an […]

Two new experimental OneSync variables

In the latest Windows server release (1504 or higher), two experimental variables have been added to help troubleshooting problematic behavior and offer a ‘workaround’ for common problems. onesync_distanceCullVehicles true This console variable (set it in your config, or in the console at runtime) will lead to player-occupied vehicles also being subject to distance culling – […]

Useful snippet: getting the top left of the minimap in screen coordinates

This could be useful if you want to align things to NUI or other screen-space draws, and works on pretty much any aspect ratio. The magic numbers here are the minimap position from common:/data/ui/frontend.xml, as seen below: This will likely also work for aligning to other positions, assuming you set the right sizes.

GET_ACTIVE_PLAYERS: the replacement for player loops

Just a quick hint: when writing new client-side scripts in Lua/JS (C# already has the Players list doing exactly this), you can loop through players by using the GET_ACTIVE_PLAYERS native. See below for an example of before/after: Before… After… This should be a bit more performant than 256 native invocations, even if no player slot […]