[RELEASE] [FREE] Newspaper Script

I did that before i posted my comment, no clue what was the issue, but i redowloaded and started from fresh, now it’s showing how i wanted, thank you !

1 Like

Can someone help me the script is not working for me :frowning:

It is setup for qb-target by default. If you want the standalone behavior, you need to comment out the qb-target section in client.lua and uncomment the standalone section.

image

What do i need to do here?

I just updated the readme file in the github with the commenting instructions. You need to switch some of the multiline commenting --[[ and ]]–

Hi I have updated to “weblocation” it finds the first page fine, but how do I get it to go the next pages?
eg.
<img src=“https://i.imgur.com/dsfa.jpg” id=“img” alt=“image not found” onerror=this.src=“https://i.imgur.com/dsfa.jpg” onclick=“changePage(this);”>

Example of what I put in index.html, is there anything else I need to do?

See this note in config.lua:

--[[ You can change the image storage location to a web address. Images must be named "page1.jpg", "page2.jpg", "page3.jpg", etc.

Unfortunately, this limits it’s use since you don’t always have control on the filename in some web gallery services

Ah ok np, thought that might have been the issue.

Great work! Does this include the newspaper prop and holding animation shown in the example pic?

Yes - it is an existing prop and the animation is included

1 Like

Can the header be changed to a different name through configs? so instead of Los Santos Daily Rag it could be a custom name of whatever custom news company name you use in the server?

I’m trying to use this on the RedM version of QBcore. I can get the locations to change and even open the newspaper but, I can’t close with esc and there are no error’s showing in the console. Any advice?

With ‘SetNuiFocus(true, true)’ in the client script, it should work. Either the Nui is not getting focus or somehow not getting the Esc key press. You can try changing the ‘case 27: // ESC’ in script.js to other keys (search javascript keycodes) to see if that works. If it does not, then either the NUI does not have focus, or there is an error causing the javascript to stop.

This script only displays an image file and is not generating any text.

There must be some error, i’ve done both of what you recommended and I have the same issue. Being able to open the newspaper but, not close it.

I think I know what it is - the client script is calling a fivem animation and object that redm does not have. Try commenting out these lines in client.lua:

--[[
newspaper = CreateObject(GetHashKey("prop_cliff_paper"), 0, 0, 0, true, true, true)
RequestAnimDict("missfam4")
while not HasAnimDictLoaded("missfam4") do Citizen.Wait(5) end
TaskPlayAnim(PlayerPedId(), "missfam4", "base", 3.0, 2.0, -1, 33, 0.0, false, false, false)
AttachEntityToEntity(newspaper, PlayerPedId(), GetPedBoneIndex(GetPlayerPed(-1), 18905), 0.26, 0.06, 0.16, 320.0, 310.0, 0.0, true, true, false, true, 1, true)
]]--

Yep, that was it. Works now. Much appreciated.