I can stream EUP outfits/uniform pieces but I can't add the numbers to any esx_jobs

Hello all,

I’ve recently setup EUP on my server and the files I’ve installed do stream. I can use my vMenu trainer to access them and setup my multiplayer ped. I’ve taken the numbers for these specific clothing items from vMenu to make up the outfit and then entered them into my locker room code in esx_policejob, however, whenever I click to put on the police outfit it just puts me in loads of random clothes instead.

It’s like the locker room menu is pulling clothes from the clothing store but not my EUP clothes

does anyone know why?

Not a tech support topic…

sorry, thanks for moving it

you need to load the ped model then apply the custom numbers to them should show a wait while loading the character will change into the right cloths

Right okay, I’ll look into this, for the time being I just disabled the locker room on ESX_policejob and activate the EUP menu in there instead.

1 Like

Yeah you look at the code for EUP_UI it calls the model, then loads the out to that, you will need to do the same as the EUP_UI just not a NativeUI script

Ohh, I knew I was missing something. Another quick question, is there a way to add permissions to each category on the eup-ui menu? For example, if you’re whitelisted policejob you can see the police uniforms but nothing else, if you’re whitelisted on ambulance you can see paramedic uniforms and nothing else, so on and so forth?

You will need to create tables with each job in esx_police and for paramedic, you can also keep it more organize but create your resource, call it something like esx_mysupercooloutfitchanger, then in resource reference both jobs so can access there functions ( don’t need to redo what’s been done ) then in your client/server lua, do checks for player.job == ‘police’ and for any other

I’m create something similar as you, I will share once I can get my working ( getting close ) but, above should point you in the right direction

Oh that would be awesome to see how you’ve made it work when you’re finished. I’ll get working on it myself after the massive amount of other chores i’m working on for my server :stuck_out_tongue: It’ll definitely be a great release If it’s as you explained.

Okay finished, I’ll try my best to explain

Instead of making a whole new resource, I edited the code within esx_police

I created a locker room function example:

function OpenLockerMenu()

	local playerPed = PlayerPedId()
	local grade = PlayerData.job.grade_name
	local elements = {}

	for name, list in pairs(categoryOutfits) do
	
		for id, outfit in pairs(list) do
			print('Outfit: ', outfit) 
			table.insert(elements, {
				label      = (id),
				label_real = outfit
				
			})
		end
	end


	ESX.UI.Menu.CloseAll()
	ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'locker', {
		title    = _U('locker'),
		align    = 'top-right',
		elements = elements
	}, function(data, menu)
		ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'locker_confirm', {
			title    = _U('locker_confirm', data.id),
			align    = 'top-right',
			elements = {
				{label = _U('confirm_no'),  value = 'confirm_no'},
				{label = _U('confirm_yes'), value = 'confirm_yes'}
			}
		}, function(data2, menu2)
			if data2.current.value == 'confirm_yes' then	
				setEupOutfit(data.current.label_real)
			end

			menu2.close()
		end, function(data2, menu2)
			menu2.close()
		end)
	end, function(data, menu)
		menu.close()

		CurrentAction     = 'locker_menu'
		CurrentActionMsg  = _U('open_locker')
		CurrentActionData = {}
	end)
end
  1. Local playerPed and local grade are there cause I will be adding a check for job to make sure only police can access this

  2. as you see the “for - do” loop checks all available categoryOutfits and puts them table.

then it’s simply confirming select outfit and calling this next function,

function setEupOutfit(outfit)
	local ped = PlayerPedId()
	RequestModel(outfit.ped)

	while not HasModelLoaded(outfit.ped) do
		Wait(0)
	end

	if GetEntityModel(ped) ~= GetHashKey(outfit.ped) then
		SetPlayerModel(PlayerId(), outfit.ped)
	end

	ped = PlayerPedId()

	for _, comp in ipairs(outfit.components) do
		SetPedComponentVariation(ped, comp[1], comp[2] - 1, comp[3] - 1, 0)
	 end
 
	 for _, comp in ipairs(outfit.props) do
		 if comp[2] == 0 then
			 ClearPedProp(ped, comp[1])
		 else
			 SetPedPropIndex(ped, comp[1], comp[2] - 1, comp[3] - 1, true)
		 end
	 end
end

this function is copied from EUP_UI

just grabs the selected model and apply it to the player ped

inside the police config lua I added our server custom EUP outfits in this format

['Title of clothing'] = {
        category = 'Category',
        ped = 'mp_f_freemode_01',  <-- import this is the ped
        props = {
            { 0, 0, 0 },
            { 1, 0, 0 },
            { 2, 0, 0 },
            { 3, 0, 0 },
        },
        components = {
            { 1, 1, 1 },
            { 3, 15, 1 },
            { 4, 42, 3 },
            { 5, 49, 1 },
            { 6, 53, 1 },
            { 7, 9, 1 },
            { 8, 32, 2 },
            { 9, 1, 1 },
            { 10, 1, 1 },
            { 11, 26, 1 },
        },
    },

As you can see this format is different then the actual default one in the Police Config, which is why your code wasn’t working. I hope this helps

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.