[OLD-OUTDATED][Release] Loadout System

Can someone please tell me why its not working?

essentialmode installed permission 4

f8 shows https://gyazo.com/b585549c386b33cc9c4c66da22855c5a

resource https://gyazo.com/ef99aa34cfd949ee8ac4526688afb237

YML https://gyazo.com/bf87f1764b8d748b34da3c1b6698019b

/skin cop, /cop, /rebal etc etc nothing works…

try /loadout (cop,rebel,etc)

Thanks I will try that but f8 console does not show it loading at all, wouldn’t I see something in console if it was loaded?

idk i never use the F8 i chk in the server windows !

ok so if someone can help me out here with this…

So when first login has message… “Use /skin to pick a skin and /skin save to save the skin to the Database!”)

Now it does start the resource cause the random spawn is working fine, just cannot use a command to change skins.
I have added the above last post script.
I have essentialmode set up and working with permission 4.
no errors
so /skin cop or /cop or /loadout cop do nothing, rebel ie or anything , no spawn.
But if type /loadout it says = /loadout to pick a loadout.

but nothing works either//

Anyone have a min to explain whats up?

Sorry for the late reply, been a little busy.

Are you using the latest version from Github?

If so, the command system has changed a bit (I really should update the documentation and in-game messages :neutral_face: ).

So, let’s say you’re using the following “loadout.lua” file:

LOADOUTS =  {
	["cop"] = {
		name = "Cop",
		permission_level = 0,
		weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN" },
		skins = { "s_m_y_swat_01", "s_m_y_swat_01" }
	}
}

The text in the first brackets ([cop]) is the argument for the command /loadout. So, if you run /loadout cop you will get this loadout.

The name (name = "Cop") is the name of the loadout, this is used in-game to tell the player which loadout they have just received (this can take in colors, see: How to change your server color).

The rest are pretty self-explanatory (at least I hope they are, if not just ask :slight_smile:).

I just dont understand, the /loadout, /loadout cop, whatever, does not work.
The random peds work fine when spawning in.

Here is what I have

https://gyazo.com/28409277a10955f500ec5dd61cceefa6

where do i put the

		name = "^4cop",

or something else !

Inside the “name” property, so

LOADOUTS = {
    ["cop"] = {
        name = "^4Cop"
    }
}
1 Like

okay ty i just post the same :stuck_out_tongue:

Hello i was wondering is their away to make this have an option to have a certain vehicle spawn in for instance cop would give you the police or police2

Hello guys, I have got a issue with the loadout system : the command /loadout cop doesn´t do anything but the players spawn with custom clothes :S
I added the loadout system from github, added it to autorestarts, I set lvl permission 4 into DB and I have installed essentialmode.

Thanks in advance

1 Like

No but, I was planning on adding this feature in future. Just a little busy at the moment with University.

It’s in the “server.lua” file, specifically lines 30 and 31. Or, if you want to know how you can do it for them… Just add more skins :stuck_out_tongue:

https://github.com/TGRHavoc/fivem-loadouts/blob/master/loadout/server.lua#L30

Have the players got permission for this command? If not, it should pop up at the bottom of the screen saying they don’t. I don’t get how “nothing” is happening. What’s the console look like when a command is executed?

how fix that plz ?

Assuming it’s the loadout system that’s in “custom_scripts” then try checking the loadouts.lua file for a missing “]”.

Hello, can someone tell me why i got this when someone is connecting ? :

2017-04-11 17:42:40.7172|ERROR|CitizenMP.Server|Error executing event handler for event loadout:doLoadout in resource fivem-loadouts: Exception has been thrown by the target of an invocation.
2017-04-11 17:42:40.7200|ERROR|CitizenMP.Server| at [U] System.Reflection.MonoMethod.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object[] parameters,CultureInfo culture)
2017-04-11 17:42:40.7200|ERROR|CitizenMP.Server| at [U] System.Reflection.MethodBase.Invoke(Object obj,Object[] parameters)
2017-04-11 17:42:40.7200|ERROR|CitizenMP.Server| at [U] System.Delegate.DynamicInvokeImpl(Object[] args)
2017-04-11 17:42:40.7200|ERROR|CitizenMP.Server| at [U] System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
2017-04-11 17:42:40.7200|ERROR|CitizenMP.Server| at [U] System.Delegate.DynamicInvoke(Object[] args)
2017-04-11 17:42:40.7200|ERROR|CitizenMP.Server| at [U] CitizenMP.Server.Resources.ScriptEnvironment.TriggerEvent(String eventName,String argsSerialized,Int32 source)
2017-04-11 17:42:40.7203|ERROR|CitizenMP.Server|Inner exception: Object is nil.
2017-04-11 17:43:32.0246|INFO|CitizenMP.Server|Client Airbourne quit.

Thanks by advance

It looks like its trying to perform “doLoadout” on a loadout that doesn’t exist. Have you modified the code in someway or the loadout file?

Edit: If you’re trying to remove the random skin when a player spawns, you can’t just remove it from the loadout.lua file. You also need to edit the server.lua file, specifically line 9.

https://github.com/TGRHavoc/fivem-loadouts/blob/master/loadout/server.lua#L9

Here is my loadout file, can you tell me how can i fix it ?

-- Edit the table below for more loadouts!
LOADOUTS =  {
	["police"] = {
		name = "Police",
		permission_level = 0,
		weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN" },
		skins = { "s_m_y_cop_01", "s_m_y_cop_01" }
	},
	["bri"] = {
		name = "BRI",
		permission_level = 2,
		weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN", "WEAPON_ASSAULTSMG" },
		skins = { "s_m_y_swat_01", "s_m_y_swat_01" }
	},
	["gendarmerie"] = {
		name = "Gendarmerie",
		weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN" },
		skins = { "s_m_y_sheriff_01", "s_m_y_sheriff_01" }
	},
    ["csi"] = {
		name = "CSI",
		weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN" },
		skins = { "s_m_y_hwaycop_01", "s_m_y_hwaycop_01" }
	},
	["bac"] = {
		name = "BAC",
		weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN", "WEAPON_ASSAULTSMG" },
		skins = { "s_m_m_ciasec_01", "s_m_m_ciasec_01" }
	},
	["infirmier"] = {
		name = "Infirmier",
		weapons = { "WEAPON_FLAREGUN" },
		skins = { "s_m_m_paramedic_01", "s_m_m_paramedic_01"}
	},
	["pompier"] = {
		name = "Pompier",
		weapons = { "WEAPON_FLAREGUN", "WEAPON_FIREEXTINGUISHER" },
		skins = { "s_m_y_fireman_01", "s_m_y_fireman_01"}
	}
}

And if u have the time can you help me to set a spawn position cause i still don’t understand how to respawn the player after selecting a loadout. There was a topic but it doesn’t work and give me a ton of errors…
Thanks by advance :slight_smile:

@Ruben27 Havoc explained exactly what the problem is. By default, when a user spawns, it sets their loadout to “random”. You removed “random” from LOADOUTS. You need to find the highlighted line that Havoc showed above and change where it says “random” to what you want the default loadout to be.

This loadout Script is AMAZING! Thank you for sharing it with the community~!

you wouldnt happen to know of any way to add a Mask to the random loadout would you?

My end goal is to hopefully add 2 or more masks to the random loadout.
Meaning, “a_m_y_skater_01” could randomly be selected with either mask 1 or mask 2 already equipped.