[Release] Kit/Loadout Menu

Z-Loadout by Zua

Now with Warmenu GUI by @Warxander

z-loadout is a resource that allows players to select player classes as ‘kits’ with no advanced configuration.

Features (Guns with attachments too)

  • City Cop: Carbine Rifle (scope, flash, grip), Combat Pistol (flash), Pump Shotgun (flash), Flares, Flashlight, and a tazer.
  • Sheriff Cop: Carbine Rifle (ext. mag), Pistol 50, Pump Shotgun (flashlight), Flares, Flashlight, and a tazer.
  • EMS: Tazer, flashlight, and switchblade
  • SWAT: Combat Pistol (flash), Carbine Rifle (scope, flash, grip), Special Rifle (scope, flash, grip, drum mag), Assault Shotgun (drum mag, flash, grip), flares, Pump Shotgun (Flash), Flashlight, Full Armour
  • Firefighter: Fire Extinguisher, Hatchet, Flashlight, Flashlight, Flare, Crowbar
  • Secret Agent: Combat Pistol (all attachments), Heavy Pistol (all attachments), Marksman Rifle (all attachments)
  • Security: Pisol .50 (ext. mag, skin mod), Pump Shotgun, Flashlight
  • Bouncer: Pistol .50 (ext. mag, skin mod), Micro SMG, Flashlight`
  • Street Thug: Pistol and Micro SMG.
  • Prisoner: Pistol (9 rounds only) and Melee weapons.
  • Mechanic: Pistol, Flashlight, Hammer, Crowbar.

Installation

  1. Download Here.
  2. Put the z-loadout folder into your resources folder
  3. Download warmenu by @Warxander
  4. put the warmenu folder into your resources folder
  5. Add start warmenu and start z-loadout into your server.cfg

Menu Controls

Function Usage
Open Menu L
Down Nav
Up Nav
Right Nav
Left Nav
Select ENTER
Close BACKSPACE

Chat Commands

Class Usage
City Cop /cop
Sheriff /sheriff
EMS /ems
SWAT /swat
Secret Agent /agent
Street Thug /thug
Bouncer /bouncer
Mechanic /mechanic
Security /security
Firefighter /fire

Extra Chat Commands

Class Usage
Remove All Weapons /removeall
Resets Ped /clear

Support

If you have any questions, ask here.

6 Likes

I don’t think I know a cop that has a standard .50 caliber pistol. Nice work tho.

They are going to make you remove the discord link. Not allowed to post that (read TOS). However, nice resource.

Hey dude there gonna make you remove the Discord link because of the new terms. PSA on Advertising in Releases Either way nice script.

Nice resource, although as others have pointed out you are not allowed your discord in your post :frowning:

The discord link is gone now

you should add a way to add attachments to the weapons. I have no-clue how to do this and have made my script as folllows.

My Zua.lua

– Made by Zua @ https://github.com/thatziv

local myPed = PlayerPedId()
local localPed = PlayerId()

function notify(string) 
    SetNotificationTextEntry("STRING")
    AddTextComponentString(string)
    DrawNotification(true, false)
end 

function loadModel(modelHash)
    local model = GetHashKey(modelHash)
    RequestModel(model)
    while not HasModelLoaded(model) do
        RequestModel(model)
        Citizen.Wait(0)
    end
    SetPlayerModel(localPed, model)
    SetModelAsNoLongerNeeded(model)
end

function giveWeapon(weaponHash) 
    GiveWeaponToPed(GetPlayerPed(-1), GetHashKey(weaponHash), 999, false)
end
RegisterCommand('bcso', function()
    --Loads Player model
    loadModel("s_m_y_sheriff_01")
    --Gives the player weapons
    giveWeapon("weapon_combatpistol")
    giveWeapon("weapon_tazer")
    giveWeapon("weapon_carbinerifle")
    giveWeapon("weapon_flare")
    giveWeapon("weapon_pumpshotgun")
    giveWeapon("weapon_stungun")
    --Native Notification function usage
    notify("~b~~h~Sheriff~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/bcso', 'Loads the Sheriffs loadout')

RegisterCommand('lspd', function()
    --Loads Player model
    loadModel("s_m_y_cop_01")
    --Gives the player weapons
    giveWeapon("WEAPON_COMBATPISTOL")
	giveWeapon("WEAPON_NIGHTSTICK")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_CARBINERIFLE")
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_PUMPSHOTGUN")
    giveWeapon("WEAPON_STUNGUN")
    --Native Notification
    notify("~b~~h~Police~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/lspd', 'Loads the City Police loadout')

    RegisterCommand('sahp', function()
    --Loads Player model
    loadModel("s_m_y_hwaycop_01")
    --Gives the player weapons
    giveWeapon("WEAPON_COMBATPISTOL")
	giveWeapon("WEAPON_NIGHTSTICK")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_CARBINERIFLE")
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_PUMPSHOTGUN")
    giveWeapon("WEAPON_STUNGUN")
    --Native Notification function usage
    notify("~b~~h~Trooper~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/sahp', 'Loads the Highway Patrol loadout')

    RegisterCommand('safd', function()
    --Loads Player model
    loadModel("s_m_y_fireman_01")
    --Gives the player weapons
    giveWeapon("WEAPON_CROWBAR")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_STUNGUN")
	giveWeapon("WEAPON_HATCHET")
    --Native Notification function usage
    notify("~b~~h~Firefighter~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/safd', 'Loads the Firefighter loadout')


RegisterCommand('removeall', function() -- Terbium's Idea
    RemoveAllPedWeapons(myPed, true)
    notify("~g~All Guns Removed")
end, false)
TriggerEvent('chat:addSuggestion', '/removeall', 'Removes all weapons')

--  Clears the model and weapons here 
RegisterCommand('clear', function() 
    loadModel("A_M_M_BevHills_02")
    RemoveAllPedWeapons(myPed, true)
    notify("~g~Cleared.")
end, false)
TriggerEvent('chat:addSuggestion', '/clear', 'Cleares Player Model and Weapons')

for all of the police weapons i need attachments from this list

https://wiki.fivem.net/wiki/Weapon_Components

Please help

1 Like

If you look on the wiki you can see that the function that gives the client a component.
Just use the code from the wiki

if HasPedGotWeapon(PlayerPedId(), GetHashKey("weapon_pistol"), false) then
   GiveWeaponComponentToPed(PlayerPedId(), GetHashKey("weapon_pistol"), GetHashKey("component_at_pi_supp_02"))
end

You can just use that if u want to achive what you’ve wanted

Would this be right?

RegisterCommand(‘bcso’, function()
–Loads Player model
loadModel(“s_m_y_sheriff_01”)
–Gives the player weapons
giveWeapon(“WEAPON_COMBATPISTOL”)
if HasPedGotWeapon(PlayerPedId(), GetHashKey(“WEAPON_COMBATPISTOL”), false) then
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(“WEAPON_COMBATPISTOL”), GetHashKey(“COMPONENT_AT_PI_FLSH”))
end
giveWeapon(“WEAPON_NIGHTSTICK”)
giveWeapon(“WEAPON_FIREEXTINGUISHER”)
giveWeapon(“WEAPON_CARBINERIFLE”)
if HasPedGotWeapon(PlayerId(), GetHashKey(“WEAPON_CARBINERIFLE”), false) then
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(“WEAPON_CARBINERIFLE”), GetHashKey(“COMPONENT_CARBINERIFLE_CLIP_03”))
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(“WEAPON_CARBINERIFLE”), GetHashKey(“COMPONENT_AT_AR_FLSH”))
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(“WEAPON_CARBINERIFLE”), GetHashKey(“COMPONENT_AT_AR_AFGRIP”))
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(“WEAPON_CARBINERIFLE”), GetHashKey(“COMPONENT_AT_SCOPE_MEDIUM”))
end
giveWeapon(“WEAPON_FLARE”)
giveWeapon(“WEAPON_PUMPSHOTGUN”)
if HasPedGotWeapon(PlayerId(), GetHashKey(“WEAPON_PUMPSHOTGUN”), false) then
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(“WEAPON_PUMPSHOTGUN”), GetHashKey(“COMPONENT_AT_AR_FLSH”))
end
giveWeapon(“WEAPON_STUNGUN”)
–Native Notification function usage
notify("~bh~Sheriff~hw~ Loadout Loaded.")
end, false)
TriggerEvent(‘chat:addSuggestion’, ‘/bcso’, ‘Loads the Sheriffs loadout’)

It should. I’ll commit weapon components into this release. Do you mind if I use your idea of having a firefighter, I thinks its a neat idea worth being in here

Yes idc, I just added it as a part of all my dept. in my server :stuck_out_tongue:

Is it possible to chansge the names of loadouts to British?
Like traffic or Area ?

Yes, i made it really simple to configure. In the registercommand the text after in the quotes is what you want to change.

1 Like

this is excellent cheers

Very nice man :))
Keep the work going

Update of My Version, I just removed the civ stuff and changed the weapons up, can someone see if all of this works????

local myPed = PlayerPedId()
local localPed = PlayerId()

function notify(string) 
    SetNotificationTextEntry("STRING")
    AddTextComponentString(string)
    DrawNotification(true, false)
end 

function loadModel(modelHash)                   
    local model = GetHashKey(modelHash)
    RequestModel(model)
    while not HasModelLoaded(model) do
        RequestModel(model)
        Citizen.Wait(0)
    end
    SetPlayerModel(localPed, model)
    SetModelAsNoLongerNeeded(model)
end

function giveWeapon(weaponHash) 
    GiveWeaponToPed(GetPlayerPed(-1), GetHashKey(weaponHash), 999, false)
end

function weaponComponent(weaponHash, component)
    if HasPedGotWeapon(PlayerPedId(), GetHashKey(weaponHash), false) then
        GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(weaponHash), GetHashKey(component))
     end
end

RegisterCommand('bcso', function()
    --Loads Player model
    loadModel("s_m_y_sheriff_01")
    --Gives the player weapons
    giveWeapon("WEAPON_COMBATPISTOL")
	    weaponComponent("", "", )
	giveWeapon("WEAPON_NIGHTSTICK")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_CARBINERIFLE")
	    weaponComponent("", "", )
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_PUMPSHOTGUN")
	    weaponComponent("", "", )
    giveWeapon("WEAPON_STUNGUN")
    --Native Notification function usage
    notify("~b~~h~Sheriff~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/bcso', 'Loads the Sheriffs loadout')

RegisterCommand('swat', function()
    --Loads Player model
    loadModel("s_m_y_sheriff_01")
    --Gives the player weapons
    giveWeapon("WEAPON_COMBATPISTOL")
	    weaponComponent("COMPONENT_AT_PI_FLSH")
	giveWeapon("WEAPON_NIGHTSTICK")
    giveWeapon("WEAPON_WEAPON_SPECIALCARBINE")
	    weaponComponent("COMPONENT_SPECIALCARBINE_CLIP_03", "COMPONENT_AT_AR_FLSH", "OMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
    giveWeapon("WEAPON_FLARE")
    giveWeapon ("WEAPON_ASSAULTSHOTGUN")
	    weaponComponent ("COMPONENT_AT_AR_FLSH", "COMPONENT_AT_AR_AFGRIP", "COMPONENT_ASSAULTSHOTGUN_CLIP_02")
	giveWeapon ("WEAPON_HEAVYSNIPER")
        weaponComponent ("COMPONENT_AT_SCOPE_MAX")		
    giveWeapon("WEAPON_STUNGUN")
    --Native Notification function usage
    notify("~b~~h~SRU Team~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/swat', 'Loads the Swat loadout')

RegisterCommand('lspd', function()
    --Loads Player model
    loadModel("s_m_y_cop_01")
    --Gives the player weapons
    giveWeapon("WEAPON_COMBATPISTOL")
	    weaponComponent("COMPONENT_AT_PI_FLSH")
	giveWeapon("WEAPON_NIGHTSTICK")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_CARBINERIFLE")
	    weaponComponent("COMPONENT_CARBINERIFLE_CLIP_03", "COMPONENT_AT_AR_FLSH", "COMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_PUMPSHOTGUN")
	    weaponComponent("COMPONENT_AT_AR_FLSH")
    giveWeapon("WEAPON_STUNGUN")
    --Native Notification
    notify("~b~~h~Police~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/lspd', 'Loads the City Police loadout')

    RegisterCommand('sahp', function()
    --Loads Player model
    loadModel("s_m_y_hwaycop_01")
    --Gives the player weapons
    giveWeapon("WEAPON_COMBATPISTOL")
	    weaponComponent("COMPONENT_AT_PI_FLSH")
	giveWeapon("WEAPON_NIGHTSTICK")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_CARBINERIFLE")
	    weaponComponent("COMPONENT_CARBINERIFLE_CLIP_03", "COMPONENT_AT_AR_FLSH", "COMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_PUMPSHOTGUN")
	    weaponComponent("COMPONENT_AT_AR_FLSH")
    giveWeapon("WEAPON_STUNGUN")
    --Native Notification function usage
    notify("~b~~h~Trooper~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/sahp', 'Loads the Highway Patrol loadout')

RegisterCommand('agent', function()
    loadModel('S_M_M_HighSec_02')
    giveWeapon("WEAPON_COMBATPISTOL")
	    weaponComponent("COMPONENT_AT_PI_FLSH")
	giveWeapon("WEAPON_NIGHTSTICK")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_CARBINERIFLE")
	    weaponComponent("COMPONENT_CARBINERIFLE_CLIP_03", "COMPONENT_AT_AR_FLSH", "COMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_PUMPSHOTGUN")
	    weaponComponent("COMPONENT_AT_AR_FLSH")
    giveWeapon("WEAPON_STUNGUN")
        notify("~p~~h~Agent~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/agent', 'Loads the Secret Agent loadout')

    RegisterCommand('safd', function()
    --Loads Player model
    loadModel("s_m_y_fireman_01")
    --Gives the player weapons
    giveWeapon("WEAPON_CROWBAR")
    giveWeapon("WEAPON_FIREEXTINGUISHER")
    giveWeapon("WEAPON_FLARE")
    giveWeapon("WEAPON_STUNGUN")
	giveWeapon("WEAPON_HATCHET")
    --Native Notification function usage
    notify("~b~~h~Firefighter~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/safd', 'Loads the Firefighter loadout')

RegisterCommand('removeall', function() -- Terbium's Idea
    RemoveAllPedWeapons(myPed, true)
    notify("~g~All Guns Removed")
end, false)
TriggerEvent('chat:addSuggestion', '/removeall', 'Removes all weapons')

--  Clears the model and weapons here 
RegisterCommand('clear', function() 
    loadModel("A_M_M_BevHills_02")
    RemoveAllPedWeapons(myPed, true)
    notify("~g~Cleared.")
end, false)
TriggerEvent('chat:addSuggestion', '/clear', 'Cleares Player Model and Weapons')

If you followed the format and the syntax of the functions, you should be good. Removing ‘civ stuff’ should be all good too if you only removed them

Am I able to set perms on this script?

You are able to do anything you want with it :slight_smile:

Couldn’t seem to open the menu using the L key, but otherwise nice script using the commands and easy to figure out how to edit/add our own. Thanks!