Skip to content

CyberSys/LoadoutScript

 
 

Repository files navigation

LoadoutScript

LoadoutScript is a resource for FiveM by Albo1125 that allows players to easily equip loadouts read from a json file, rather than having to set a ped model and a bunch of components and prop options manually every time you spawn. It also allows you to specify which weapons are given when equipping a loadout. You can categorize loadouts into divisions, accessible from a NativeUI menu. Screenshots can be found at the bottom.

Installation & Usage

  1. Download the latest release.
  2. Unzip the LoadoutScript folder into your resources folder on your FiveM server.
  3. Create a loadouts.json file in the LoadoutScript folder (or rename the example if you prefer).
  4. Add the following to your server.cfg file:
start LoadoutScript
  1. Type /lo in chat to access the loadouts menu.

Customising your loadouts

Customise your loadouts in the loadouts.json file. You can add as many loadouts as you like. An example loadouts.json file is included. JSON reference is as follows.

Loadout

Every entry in the root array is a Loadout.

  • "Division" string indicating the main category of this loadout.
  • "Name" string indicating the (unique?) name of this loadout for that division.
  • "TaserOption" true or false depending on whether you want a Taser option checkbox.
  • "PedModelName" string representing the model name of the ped.
  • "WeaponHashes" array of CitizenFX.Core.WeaponHash enum values (string representation).
  • "DefaultCustomisables" array of either PedsComponent or PedsProp objects (see below).
  • "LoadoutOptions" array of LoadoutOption objects

LoadoutOption

  • "Name"string indicating the name of this option.
  • "NoneOption" true or false, if true adds a None option to the list of selectable values that doesn't change the ped's components/props.
  • "OptionNameToCustomisable" Dictionary mapping a name string (descriptive of the component or prop) to either a PedsComponent or PedsProp object (see below).

PedsComponent (must specify type in JSON)

  • "$type":"LoadoutScript.PedCustomisables.PedsComponent, LoadoutScript.net"
  • "componentId" one of the following: Head, Beard, Hair, Upper, Lower, Hands, Shoes, Acc1, Acc2, Badges, AuxTorso
  • "drawableId" the drawable ID to set this component to. For simple trainer users: first number as listed on the clothes menu, minus 1.
  • "textureId" the texture ID to set this component to. For simple trainer users: third number as listed on the clothes menu, minus 1.

PedsProp (must specify type in JSON)

  • "$type":"LoadoutScript.PedCustomisables.PedsProp, LoadoutScript.net"
  • "propId" one of the following: Hats, Glasses, Ears, Watches
  • "drawableId" the drawable ID to set this component to. For simple trainer users: first number as listed on the clothes menu, minus 1.
  • "textureId" the texture ID to set this component to. For simple trainer users: third number as listed on the clothes menu, minus 1.

Improvements & Licensing

Please view LICENSE.md. Improvements and new feature additions are very welcome, please feel free to create a pull request. Proper credit is always required if you release modified versions of my work.

Libraries used (many thanks to their authors)

Screenshots

LoadoutScript LoadoutScript LoadoutScript

About

LoadoutScript is a resource for FiveM by Albo1125 that allows players to easily equip loadouts read from a json file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 94.2%
  • Lua 5.8%