API
No exports, no events and no server code: how players control the gun and what it shows.
More Speedgun has no exports, no server events and nothing you have to call from your own code. Everything happens on the client of the player who holds the gun. The sections below describe what a player can do with the gun, which controls it uses and what a measurement contains, so you can brief your players or build your own rules around it.
The only things you can change are the settings on the Configuration page. If only certain players should have the gun, control that with the weapon item in your inventory or job system: the resource itself does not check jobs or permissions.
Power command and key
The gun starts switched off. A command and a key mapping switch it on and off while the gun is held. Drawing the gun or putting it away always switches it off again, and switching it off clears the current reading.
speedgun_powercommandrequiredSwitches the gun on or off. The name can be changed with the command option in the config.
GkeyrequiredDefault key of the command. Players can rebind it in the FiveM key bindings under the label Speed gun: power on / off.
Aiming and measuring
With the gun switched on, the player holds the aim control (right mouse button by default) and clicks (left mouse button by default). In a vehicle the vehicle aim and attack controls are used, so the gun also works from inside a vehicle. The gun checks along the line of sight of the gameplay camera, up to the configured range, and only hits vehicles. The player's own vehicle is skipped. A hit locks the vehicle, and as long as aim stays held and the crosshair stays on it the reading keeps updating live. Releasing aim, moving the crosshair off the vehicle or switching the gun off clears the lock. A click that hits nothing shows three dashes. The gun itself never fires: shooting is disabled while it is held.
The reading
Every measurement shows these values on the screen of the gun and on the overlay at the bottom right of the screen. The overlay is hidden automatically while the pause menu is open.
speednumberrequiredSpeed over ground of the vehicle in the configured unit (kmh or mph), rounded and capped at 999.
platestringrequiredLicence plate of the vehicle.
modelstringdefault —Display name of the vehicle model.
overbooleandefault falseTrue when the speed is above the configured limit. The reading is red then and green otherwise.
The weapon
The gun is the weapon WEAPON_MORESCRIPTS_SPEEDGUN (config option weapon). It has no ammo, deals no damage and cannot fire. Combat roll and stealth are disabled while it is held. If your inventory lists weapons as items, add it as a weapon item. The model, textures and weapon files are streamed by the resource, and the weapon wheel icon comes from stream/hud.gfx.
Screen on the model
With the screen option on, the reading is also drawn onto the screen of the gun model, and the power button and the sight light up. This applies to every speed gun your client renders while you hold one yourself, so other players' guns in your view show your own reading. With the option off the model stays dark and only the overlay shows the reading.
No synchronisation
The resource has no server logic. A measurement is made and shown on the client of the player who holds the gun. It is not sent to other players or to the server and nothing is stored.
Update check
On start the server registers more_speedgun with more_lib, which runs the update check for the More Scripts resources. You do not have to configure anything for it.
Last updated