[RELEASE] Enhanced HUD

It works fine here using that script :

So I replaced this in client.lua

TriggerEvent('esx_skin:openSaveableMenu')

with

TriggerEvent('hud:loadMenu')

Next I added the saving function in the server.lua :

-- Register the player
ESX.RegisterServerCallback('jsfour-register:register', function(source, cb, data)
  local identifier = GetPlayerIdentifiers(source)[1]
  local lastdigits = math.random(9) .. math.random(9) .. math.random(9) .. math.random(9)
  MySQL.Async.execute("UPDATE `users` SET `firstname` = @firstname, `lastname` = @lastname, `dateofbirth` = @dateofbirth, `sex` = @sex, `height` = @height, `lastdigits` = @lastdigits WHERE identifier = @identifier",
  {
    ['@identifier']   = identifier,
    ['@firstname']    = data.firstname,
    ['@lastname']     = data.lastname,
    ['@dateofbirth']  = data.dateofbirth,
    ['@sex']          = data.sex,
    ['@height']       = data.height,
    ['@lastdigits']   = lastdigits
  },
  function( result )
    MySQL.Async.execute('INSERT INTO characters (identifier, firstname, lastname, dateofbirth, sex, height, lastdigits) VALUES (@identifier, @firstname, @lastname, @dateofbirth, @sex, @height, @lastdigits)',
    {
      ['@identifier']   = identifier,
      ['@firstname']    = data.firstname,
      ['@lastname']     = data.lastname,
      ['@dateofbirth']  = data.dateofbirth,
      ['@sex']          = data.sex,
      ['@height']       = data.height,
      ['@lastdigits']   = lastdigits
    },
	function (result )
	  MySQL.Async.execute('INSERT INTO outfits (idSteam) VALUES (@identifier)', 
	  {
	    ['@identifier']	 = identifier
	  },
	  function( result )
		-- Done
		cb(true)
	  end)
    end)
  end)
end)

That is all. Now you can enjoy your register and this skincreator. Make sure you use (if you want of course) my files from the github. They have the working finish button.

Oh and one thing for all those who struggle with this menu, Make sure that you load the character as a spawnpoint 'mp_m_freemode_01' { x = -1352.43, y = -1542.75, z = 4.42268 }

If you spawn random skate guys example : a_m_y_skater_01, most of the skin options will not work.
I also hope that people understand that for all the different identity scripts there are, your code and lines you need to add can be different. I focus mainly on the basic ESX scripts.

8 Likes