Loadouts
So, this is a re-release of the original loadout addon. I’m doing this as I don’t have access to edit the other thread (mainly the title and original post). I also thought it would be nicer to have a clean thread (hope this is OK, mods ).
This addon allows you to give players items and change their models when you want (e.g. when they spawn).
The original idea was from @ioxo in this thread and, has come a long way since it’s inital conception.
Anyways, to the addon (that’s what you’re here for).
Current Features:
- Give players an arsenal (weapons)
- Change the player’s model
- Random variations between each player’s model (e.g. different hair colours)
- “Spawn Points”
- Saving/Loading from database
Upcoming features:
- Access via GUI
- Better notifications
Download
If you want the latest version of the plugin, download it from Github.
To download from Github, just click the “Clone or download” button and then click the “Download ZIP”.
Or, you can download the latest version directly, here
Changelog
v2.1 (22nd Apr 2017)
Added database integration
Added character randomization
v2.2 (28th Apr 2017)
Added language files
Installation
Before you install the scripts, please make sure you have EssentialMode installed and configured. This addon won’t work without it.
Usage
To use the scripts, you just have to modify the “settings.lua” file to your preference. Below you can see a rundown of how you can configure the loadouts (Note: This is only one loadout, see the default “settings.lua” file for more).
LOADOUTS = {
["cop"] = { -- The argument to the /loadout command (i.e /loadout cop)
name = "Cop", -- The name of the loadout (shown to players)
-- permission_level will default to 0
permission_level = 0, -- The essential mode permission needed to run this command
weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN" }, -- List of weapons the player will get with this loadout
skins = { "s_m_y_swat_01", "s_m_y_swat_01" }, -- List of potential skins for the player (random)
spawnPos = { -- A list of potential spawn points (player gets teleported to one of these)
{ x = 2409, y = 3079.255, z = 48.15277 },
{ x = 2409, y = 3079.255, z = 48.15277 } -- This is an example (you don't need this second location)
},
-- randomize will default to false
randomize = true -- If true, then the player's model will have random variants (e.g. hats, hair, glass, tops, shorts etc)
}
}
If you don’t want the player to spawn with a loadout then you can modify the “server.lua” file. More specifically, you can remove the lines:
RegisterServerEvent("loadout:playerSpawned")
AddEventHandler("loadout:playerSpawned", function(spawn)
TriggerEvent("loadout:doLoadout", source, "random")
end)
Commands
There are a couple of commands that have been implemented at the minute (more to come in future)
-
/loadout
- Shows the available commands -
/loadout help
- Shows the available loadouts -
/loadout <id>
- Gives the player the loadout
For a list of weapons that can go in the “weapons” see here.
For a list of skins see here.
Development
I’m slowly working on adding more features to the addon. If you want to get the latest development build (which will contain bugs and shouldn’t be used on actual servers) to test new features before they come out (or if you just want to stay up-to-date with the development of the addon), you can find it on the develop branch on Github.
Issues
If you have any issues with the addon (or want a feature adding) I suggest you create an issue on Github (or click here). Try and give as much details as you can about the issue/feature and (if possible) include screenshots.