[Release][ES] Loadouts (v2.2)

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 :slight_smile: ).

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”.

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.

4 Likes

I have a suggestion can you make loadouts available by going to the marker with gui if thats possible and thanks for the release :slight_smile:

2 Likes

Thanks for the script, maybe add screens ?

What do you mean by “screens”? Do you mean a UI (like a menu of sorts)?

If you are, it’s already being planned :wink:

Hm… I’ll have a think about this. I don’t know if it’s a feature all servers would want. I can see it being a real
problem with the players as well, having to travel to certain points just to get a loadout :confused:

Sorry my english is not very good,
I’m talking about pictures for see the GUI and others options if the script have

I mean think about it wouldnt be more sense if a player wanted to become a cop by going to a police station and getting the loadout? aswell like the hospital or anywhere else it brings much more roleplay in the server in my opinion and if u want to u can a seperate release just using markers.

Hi Havoc, here I am to inform you that the spawnPos does not work on my side I do not know why. I hope you will be able to solve the worry in the day: D Thank you!

What does your loadout look like? And can you screenshot the console output when you run the command for it?

Hello,

Can you add top right hud with the name of the loadouts exemple :
Cop [Recruit]

1 Like

Have you a release for the next update ?
Can you add a function to have different text when i take the job ?

Sure, I won’t be able to add the “[Recruit]” bit but, I can add the “Cop”.

I’m still working on the next update (testing and making sure stuff doesn’t break). If you want to test what I have so far, you can find it here. At the minute it only has SQL functionality (still adding stuff).

2 Likes

I have this error :


Can you help me ?

Looks like you’re missing a bracket or comma in the loadout file. Send me a PM with what you have and I can tell you where the mistake is :slight_smile:

Ok, so I’ve updated the plugin and I’m fairly certain it doesn’t break anything.

Changes
- Database integration
  - You can now enable loadouts to be saved and loaded from a database (don't worry, you don't need to have this enabled)
- Language files
 - Not everyone speaks English so, instead of making you trawl though the code. You can just change a single file to change the language (yey).

With these changes, I’ve also moved some stuff around. The main difference is that the server-side code and the client-side code are now in their own folders.

Hopefully, the new “settings.lua” file is self-explanatory if not, just ask :slight_smile:

There shouldn’t be any issues with the old loadouts file (you can copy over the “LOADOUTS” from the previous version).

If you want to enable the database feature, make sure you import the “loadouts.sql” file into the table of your choice and you change the “settings.lua” file.

If you want to change the text that’s shown to the player (e.g. when they get their loadout), you can edit the new “language.lua” file located in the client folder (just make sure you only change the text in the quotes (") ;)).

You can download it from the same link. Enjoy :stuck_out_tongue:

2 Likes

now i can give a script only for a job ? thx for this maj :smiley:

Thx for that, nice for DB :slight_smile: , just one question i cant enter command “/loadout cop = no action after update :/” (Sorry i’m french baguette)

 chat_colour = { 255, 255, 255 } -- RGB Format
}

-- Edit the table below for more loadouts!
LOADOUTS =  {
    
	--- BASE POLICE ---
	
	["cop"] = { -- This is the command that is used to get the loadout (i.e. /loadout cop)
        name = "Cop", -- The name of the loadout (shown to the player)
        permission_level = 2, -- The player must hhave this permission to get the loadout
        -- Below is a list of weapons the player gets with the loadout (see https://www.se7ensins.com/forums/threads/weapon-and-explosion-hashes-list.1045035/)
        weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN", "WEAPON_FLARE", "WEAPON_ADVANCEDRIFLE", "GADGET_PARACHUTE", "WEAPON_FIREEXTINGUISHER" },
        --Below is a list of skins (randomly picked) the player can become with this loadout (see http://www.nextgenupdate.com/forums/gta-5-mods/725735-full-npcs-ped-models-characters-list-case-you-need-p-3.html)
        skins = { "s_m_y_hwaycop_01" },
        spawnPos = { -- A list of potential spawn points for this loadout (randomly picked)
            {
                x = 425.130,
                y = -979.558,
                z = 30.711
            },
            {
                x = 425.130,
                y = -979.558,
                z = 30.711
            }
        },
        randomize = true -- Randomise the character based on the player's identifier
    },

    ["cpt"] = {
        name = "cpt",
        permission_level = 16,
        weapons = { "WEAPON_PISTOL50", "WEAPON_STUNGUN", "WEAPON_NIGHTSTICK", "WEAPON_PUMPSHOTGUN", "WEAPON_FLAREGUN", "WEAPON_ASSAULTSMG", "GADGET_PARACHUTE", "WEAPON_FIREEXTINGUISHER" },
        skins = { "s_m_y_hwaycop_01"},
        spawnPos = { -- A list of potential spawn points for this loadout (randomly picked)
           {
                x = 425.130,
                y = -979.558,
                z = 30.711
            },
            {
                x = 425.130,
                y = -979.558,
                z = 30.711
            }
        },
        randomize = true -- Randomise the character based on the player's identifier
    },
    ["test2"] = {
        name = "Test Loadout 2",
        skins = { "player_two" }, -- trevor
        randomize = true -- Randomise the character based on the player's identifier
    },
    ["random"] = {
        name = "Random",
        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_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",
			"u_m_y_pogo_01",
			"u_m_y_rsranger_01",
			"a_m_o_acult_01",
			"u_m_m_jesus_01",
			"s_m_y_clown_01",
			"ig_priest",
			"U_M_Y_BABYD",
			"s_m_m_movspace_01",
			"a_c_chimp",
			"a_m_y_hiker_01",
			"u_m_y_staggrm_01",
			"a_f_m_bodybuild_01",
			"a_f_m_fatcult_01",
			"u_f_y_juggalo_01",
			"a_m_m_acult_01",
			"a_m_y_motox_01",
			"u_m_y_sbike",
			"a_m_y_cyclist_01",
			"u_m_y_party_01",
			"a_m_m_og_boss_01",
			"a_f_m_beach_01",
			"ig_kerrymcintosh",
			"a_f_m_bevhills_01",
			"ig_claypain",
			"a_f_y_bevhills_01",
			"a_f_y_bevhills_02",
			"a_f_y_bevhills_03",
			"a_f_y_bevhills_04",
			"a_f_y_golfer_01",
			"a_f_y_skater_01",
			"a_f_y_indian_01",
			"a_f_y_tennis_01",
			"a_f_y_tourist_01",
			"s_m_m_doctor_01",
			"s_m_y_barman_01",
			"u_f_y_princess",
			"g_m_y_korean_01",
			"g_m_y_korean_02"
        }
    }
}

u should have permission = 2 or more, :joy:

there are a lot of french baguette in the forum ahah, good game bro

Same problem, nothing happen after /loadout commands.

And one error in game ( maybe the problem ? )

And same for me (with permission set to 0) /loadout cop won’t work…
At least, /loadout & /loadout help won’t work too …