[Release]Model-Menu V3 [9th Oct]


Really cool to see a menu that isn’t made with either NativeUI or WarMenu. Even though I like both of them :stuck_out_tongue:

	local _source = source
	local identifier = getID("steam",_source)
	MySQL.Async.execute("UPDATE users SET skin = @skin WHERE identifier = @identifier", {
	  ['@skin'] = tostring(json.encode(player_data)),
	  ['@identifier'] = identifier
	models[identifier] = player_data
		local xPlayer = ESX.GetPlayerFromId(source)
		local playerLoadout = {}

			for i=1, #playerLoadout, 1 do
				if playerLoadout[i].label ~= nil then
					xPlayer.addWeapon(playerLoadout[i].name, playerLoadout[i].ammo)
	-- Give weapons etc
end)`Preformatted text`

can anyone help with deleting weapons ? do i am close to make this work or thats not the way ?

	local _source = source
	local xPlayer   = ESX.GetPlayerFromId(source)
	local playerLoadout = xPlayer.getLoadout()

SaltyGrandpa could you please help with this code
i realy want to use this script but have no idea how to make that i get weapons back i am trying many difrent ways looking for some code in other scripts but cant get this to work i dont know lua that good to make this
hope you understud and can help me and others here
thank you


There is an esx:restoreLoadout client-side function. Not that this is not safe for net by default, so you cannot trigger it from the server.


so i need this function on server side so playerdata i need change to xplayer ?

	local xPlayer = ESX.GetPlayerFromId(source)
	local weaponback = xPlayer.getLoadout()

	for i=1, weaponback, 1 do
    local weaponHash = GetHashKey(weaponback[i].name)
    GiveWeaponToPed(xPlayer, weaponHash, weaponback[i].ammo, false, false)


No? Did you read my response? Lol. You just have to trigger that client event that I listed.


what i did now is
i add this function to client and add trigger from server to this function

and now when exit game and come back i got weapon back
only when change model i dont get it back

and i need to solve problem with getting female basic skin after log in
but i see its problem with skinchanger

Thank you SaltyGrandpa for help!


If you replace TriggerServerEvent("clothes:loaded") in client.lua with TriggerEvent('esx:restoreLoadout') this should work. This is on line 333 and 365.

This resource will not work with esx_skins or skinchanger or any other clothing/player model menu. They’ll constantly conflict with each other.


This isn’t really a good place for this discussion, but pulling from es_extended/client/main.lua:

-- Save loadout

  while true do


    local playerPed      = GetPlayerPed(-1)
    local loadout        = {}
    local loadoutChanged = false

    if IsPedDeadOrDying(playerPed) then
      LoadoutLoaded = false

    for i=1, #Config.Weapons, 1 do

      local weaponHash = GetHashKey(Config.Weapons[i].name)

      if HasPedGotWeapon(playerPed,  weaponHash,  false) and Config.Weapons[i].name ~= 'WEAPON_UNARMED' then

        local ammo = GetAmmoInPedWeapon(playerPed, weaponHash)

        if LastLoadout[Config.Weapons[i].name] == nil or LastLoadout[Config.Weapons[i].name] ~= ammo then
          loadoutChanged = true

        LastLoadout[Config.Weapons[i].name] = ammo

        table.insert(loadout, {
          name  = Config.Weapons[i].name,
          ammo  = ammo,
          label = Config.Weapons[i].label


        if LastLoadout[Config.Weapons[i].name] ~= nil then
          loadoutChanged = true

        LastLoadout[Config.Weapons[i].name] = nil



    if loadoutChanged and LoadoutLoaded then
      ESX.PlayerData.loadout = loadout
      TriggerServerEvent('esx:updateLoadout', loadout)


Anything further should be discussed on the ESX Base release thread.


how to install and how to add models? ty in advance ^^


It’s in the config.lua.


sorry but i don’t get anything there ><