[Solved] [NUI Help] To display more than 1 image

Hi all, This is something I’ve been working on all day and can’t seem to get my head around it. So I’m trying to make it so I could run /help and /rules in the same resource with it displaying a picture. The orginal resource is disclaimer. When ever I try and combine it, it says it has no NUI.

FILE REMOVED

there is only one picture in there but how could I make it so It could display both at each command?

Thanks,

1 Like

so in the end I could do /help. it would display the picture for help and do /rules, does the same and /cmds etc.

Would be a lot easier if I could have multiple html files. idk how I would load them seperatly

strange im using the same thing

RegisterCommand("help", function(source, args, rawCommand)
  Citizen.CreateThread(function()
    local display = true
    local startTime = GetGameTimer()
    local delay = 60000 -- ms

    TriggerEvent('disclaimer:display', true)

    while display do
      Citizen.Wait(1)
      if (GetTimeDifference(GetGameTimer(), startTime) > delay) then
        display = false
        TriggerEvent('disclaimer:display', false)
      end
      if (IsControlJustPressed(1, 51)) then
        display = false
        TriggerEvent('disclaimer:display', false)
      end
    end
  end)
end)

RegisterNetEvent('disclaimer:display')
AddEventHandler('disclaimer:display', function(value)
  SendNUIMessage({
    type = "disclaimer",
    display = value
  })
end)

function ShowInfo(text, state)
  SetTextComponentFormat("STRING")
  AddTextComponentString(text)
  DisplayHelpTextFromStringLabel(0, state, 0, -1)
end

try this ^^

also u didnt save the image as png lol its a photoshop file

there should be both there. the ps file is so I can edit it

Yeah I can display 1 but no more in the same resource

That’s funny we have a simular thing lol.

you cant display both because they use the same functions
Just copy the folder and change it in there

Yeah I guess that’s the only thing then. Would of loved to have as 1 resource :frowning_face:

If only we did not need html and could display them from the lua uhhh

you can do it …
do you have skype ? / discord ?

dicord yeah FAXES#8655

Did you add the new files to the resource.lua?

yeah we tried. It fails to load the resource, any suggestions

I’m confused by exactly what you are asking. You want to be able to show different things, but just keep it in a single resource?

That’s easy. Just add a new div with a different id. Have different messages that get sent to the javascript, and show/hide each div based on whatever the values are.

how would I make that fuction in js

Just add in another if statement.

			if (item !== undefined && item.type === "disclaimer") {

				if (item.display === true) {
					$('#disclaimer').delay(100).fadeIn( "slow" );
				} else if (item.display === false) {
					$('#disclaimer').fadeOut( "slow" );
				}
			}

			if (item !== undefined && item.type === "whateverelse") {

				if (item.display === true) {
					$('#whateverelse').delay(100).fadeIn( "slow" );
				} else if (item.display === false) {
					$('#whateverelse').fadeOut( "slow" );
				}
			}
1 Like

This is what I’ve got at the moment. It displays help (#disclaimer) but not rules (#rules

FILE REMOVED

Edit: Forgot to load it in the resource.lua

lmao… I’ve done that so many times.

yep. it works now. ill probs release it me and Kvetz were stuck on it last night. Thanks for all your help :slight_smile:

1 Like

I am trying with this script Join Logo / Image [1.1] create the blue alert command to activate or deactivate the image, but I cannot get any results, can you help me ? Thanks in advance.