[Release] After Hours : poster world animation/scene

Hello, simple release of a scene from GTA:Online that I reproduced.

Preview video

Link to the video

local animDict = "anim@amb@nightclub@poster@"
local posterModel = "ba_prop_battle_poster_skin_01"
Citizen.CreateThread(function()
	local ped = GetPlayerPed(-1)

	RequestAnimDict(animDict)
	RequestModel(posterModel)

	while not HasAnimDictLoaded(animDict) or not HasModelLoaded(posterModel) do
		Citizen.Wait(100)
	end

	local targetPosition, targetRotation = vec3(-1063.016, -2543.65, 20.62), vec3(0.0, 0.0, 60.0)

	local animPos, targetHeading = GetAnimInitialOffsetPosition(animDict, "poster_placement", targetPosition, targetRotation, 0, 2), 52.8159
	TaskGoStraightToCoord(ped, animPos, 0.025, 5000, targetHeading, 0.05)

	Citizen.Wait(1000)

	FreezeEntityPosition(ped, true)

	local netScene = NetworkCreateSynchronisedScene(targetPosition, targetRotation, 2, false, false, 1065353216, 0, 1.3)
	NetworkAddPedToSynchronisedScene(ped, netScene, animDict, "poster_placement", 1.5, -4.0, 1, 16, 1148846080, 0)

	local poster = CreateObjectNoOffset(GetHashKey(posterModel), targetPosition, 1, 1, 0)
	NetworkAddEntityToSynchronisedScene(poster, netScene, animDict, "poster_poster_placement", 4.0, -8.0, 1)
	NetworkStartSynchronisedScene(netScene)

	FreezeEntityPosition(ped, false)
end)
14 Likes

well i mean this seems kinda cool but like once its a resource how is it getting used? :thinking:

Thats for the user to decide, dont use it if you dont have a use for it, simple as.

1 Like

thats not what i meant:joy::joy:
i mean i made this a running resource now.
what do i do in order to actually trigger the animation on the server?

Unfortunately the current code is meant to be used only at this location :smiley:

ah oki :smiley:

You can modify it though to add your own locations though of course

Really nice! Got some ideas already with what I can do with this

This is a nice idea m8! I’m starting to think what we can use this, my plan is to change the textures on the poster so it is propaganda. And then make an esx job where you go and hang up propaganda posters.


This is a small and nice script you did a good job on it

1 Like

I believe you can use runtime textures
Poster’s textures look like this:

1 Like

Ah synchronized scenes, @PichotM have you managed to get these working with multiple players?

yes I did, this one works fine btw

Could you DM me an example? Or in Discord? I have had mixed issues getting scenes to work with multiple players :stuck_out_tongue:

Send me what you did I may be able to tell you what is wrong
But I tested all my network scenes, from this above and scenes with ped/objects and camera it worked fine with others.

I’ve had objects and other peds work fine, just not players, wanted it for cuffing and some other scenes. But yeah will do :+1:

Register it as a command.

Thank God in a way you can grafetii the walls been waiting for something like this, great release.

Also @PichotM

image

saucy

1 Like

yep edited to targetHeading

managed to make synced scenes work with peds at any location so enjoy

local animDict = "switch@trevor@bridge"
	local ped = GetPlayerPed(-1)
	local throw = "ig_orleans"
	local x,y,z = table.unpack(GetEntityCoords(ped))
	
	coords = GetEntityCoords(ped)

	RequestAnimDict(animDict)
	RequestModel(throw)

	while not HasAnimDictLoaded(animDict) or not HasModelLoaded(throw) do
		Citizen.Wait(100)
	end

	local targetPosition, targetRotation = vec3(coords), vec3(0.0, 0.0, 20.0)

	local animPos, targetHeading = GetAnimInitialOffsetPosition(animDict, "throw_exit_trevor", targetPosition, targetRotation, 0, 2), 52.8159
	TaskGoStraightToCoord(ped, animPos, 0.025, 5000, targetHeading, 0.05)

	Citizen.Wait(1000)

	FreezeEntityPosition(ped, true)

	local netScene = NetworkCreateSynchronisedScene(targetPosition, targetRotation, 2, false, false, 1065353216, 0, 1065353216)
	local thrown = CreatePed(26, GetHashKey(throw), targetPosition, false, true)
	NetworkAddPedToSynchronisedScene(ped, netScene, animDict, "throw_exit_trevor", 1.0, -4.0, 157, 92, 1148846080, 0)
	NetworkAddPedToSynchronisedScene(thrown, netScene, animDict, "throw_exit_victim", 1.0, -4.0, 157, 92, 1148846080, 0)
	--NetworkForceLocalUseOfSyncedSceneCamera(netScene, "switch@trevor@bridge", "throw_exit_cam")
	NetworkStartSynchronisedScene(netScene)
	Citizen.Wait(7000)
	NetworkStopSynchronisedScene(netScene)
	FreezeEntityPosition(ped, false)
	RemoveAnimDict(animDict)

synced camera works as well

3 Likes