[OLD-OUTDATED][Release] Loadout System

That shouldn’t really matter, the code should just pick a random skin (in this case, it’ll pick between the same skin).

As for the new loadout not working, I don’t know :confused:

It should work… The code below works on my test server:

LOADOUTS = {
    ["Cop"] = {
        name = "Cop",
        command = "cop",
        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" }
    },
    ["Rebel"] = {
        name = "Rebel",
        command = "rebel",
        permission_level = 0,
        weapons = { "WEAPON_AK47", "WEAPON_UZI", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN", "WEAPON_ASSAULTSMG" },
        skins = { "a_m_y_hippy_01", "a_m_m_og_boss_01" }
    },
    ["CopSgt"] = {
        name = "Cop Sgt",
        command = "copsgt",
        permission_level = 2,
        weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN", "WEAPON_ASSAULTSMG" },
        skins = { "s_m_y_cop_01", "s_m_y_cop_01" }
    },
    ["Default"] = {
        name = "Default",
        weapons = { "WEAPON_PETROLCAN" },
        skins = {"a_m_y_skater_01",
            "a_m_y_skater_02",
            "a_m_m_beach_01",
            "a_m_m_bevhills_01",
            "a_m_m_bevhills_02",
            "a_m_m_business_01",
            "a_m_m_eastsa_01",
            "a_m_m_eastsa_02",
            "a_m_m_farmer_01",
            "a_m_m_genfat_01",
            "a_m_m_golfer_01",
            "a_m_m_hillbilly_01",
            "a_m_m_indian_01",
            "a_m_m_mexcntry_01",
            "a_m_m_paparazzi_01",
            "a_m_m_tramp_01",
            "a_m_y_gay_01",
            "a_m_m_acult_01",
            "a_m_y_hiker_01",
            "a_m_y_hippy_01",
            "a_m_y_genstreet_01",
            "a_m_m_socenlat_01",
            "a_m_m_og_boss_01",
            "a_f_y_tourist_02",
            "a_f_y_tourist_01",
            "a_f_y_soucent_01",
            "a_f_y_scdressy_01",
            "a_m_y_cyclist_01",
            "a_m_y_golfer_01",
            "cs_tenniscoach"
        }
    }
}

Works nicely but is there anyway to get the skins to save with props/textures on them? I tried the /skin save command but nothing seems to register.

The loadouts are working but How do you randomize the peds everytime you choose /cop or /rebel also how to add like a flashlight mod on my pistol when you choose loadout?

@Leah_UK, the version from @Havoc has been pushed to Github: https://github.com/TGRHavoc/fivem-loadouts.
I guess it would benefit if the link was added in your description so people can get the latest community release?

2 Likes

i can not wait to use loadout but i have problem with essentialmode i got loading stuck no spawnplayer i have set essentialmode = true but still same i keep got infinity loading screen…

help me hplease to configure essential mode correctly ?

sql done
root sql data done
essentialmode = true

  • es_admin
  • loadout

whats is my mistake on this configuration ?
pls tell me what to do to get essentialmode work and pass infinity loading screen
?

i already try fix since last week but till now no solution found :3

The only thing I can think of is that you don’t have “essentialmode” in your “AutoStartResources” list in your .yml file…

If not, try to re-install the plugin following the instuctions provided in the main thread.

Installation: Extract the folder to your resources, append “essentialmode” to your AutoStartResources. Change the MySQL data in server/player/login.lua, and last do not forget to import the provided sql file.

I could be wrong but, with the information you’ve given that’s my best guess. If you still need help, I suggest you ask the creator of essentialmode @Kanersps in PMs or on his thread.

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 ?