altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

taskSynchronizedScene not synced for other Players

Open its4l3x opened this issue 3 years ago • 3 comments

Description of the problem

taskSynchronizedScene Native isnt synced.

See the follow Videos of the two Sites

https://www.youtube.com/watch?v=IkhLyxkTxZ0 https://www.youtube.com/watch?v=iLEitqkVAi0

Reproduction steps

Execute Following-Script Block. Or use simply native taskSynchronizedScene.


this.scene2 = game.createSynchronizedScene(
			goToVector.x,
			goToVector.y,
			goToVector.z,
			rot.x,
			rot.y,
			rot.z,
			2
		);

		game.taskSynchronizedScene(
			this.localPlayer.scriptID,
			this.scene2,
			'anim_casino_b@amb@casino@games@shared@player@',
			'idle_cardgames',
			2.0,
			-2.0,
			13,
			16,
			1148846080,
			0
		);

          game.setSynchronizedScenePhase(this.scene2, 0.0);

Expected behaviour

Native should be synced and other players sees for example the animation

Additional context

No response

Operating system

Windows 10

Version

release/8.6

its4l3x avatar Jan 04 '22 19:01 its4l3x

That's a major feature which is missing! Need that asap

GVMP avatar Jan 05 '22 14:01 GVMP

I don't like the idea of natives being synced, if something should be synced it should be handled inside the alt API.

ZackaryH8 avatar Jan 08 '22 10:01 ZackaryH8

This is what will make scripting much easier if gets synced, no more will need for a workaround. Hopefully in version 13.

LightSrc avatar Oct 13 '22 18:10 LightSrc

Fixed in dev/15.0-dev407

C0kkie avatar Jul 26 '23 09:07 C0kkie

MedalTVGrandTheftAutoV20230803022922.webm I've tryed on 15.0 DEV447 with this code :

const coord = native.getOffsetFromEntityInWorldCoords(cabins[i].Entity, 0, 0, 0)
    let uLocal_376 = native.createSynchronizedScene(coord.x, coord.y, coord.z, 0, 0, 0, 2)
    native.taskSynchronizedScene(player, uLocal_376, "anim@mp_ferris_wheel", "enter_player_one", 8, -8, 131072, 0, 1148846080, 0)
    native.setSynchronizedScenePhase(uLocal_376, 0.0)

And as you see in the video the animation seem to not be synced unless I made it wrongly...

xenicle avatar Aug 03 '23 00:08 xenicle

MedalTVGrandTheftAutoV20230803022922.webm I've tryed on 15.0 DEV447 with this code :

const coord = native.getOffsetFromEntityInWorldCoords(cabins[i].Entity, 0, 0, 0)
    let uLocal_376 = native.createSynchronizedScene(coord.x, coord.y, coord.z, 0, 0, 0, 2)
    native.taskSynchronizedScene(player, uLocal_376, "anim@mp_ferris_wheel", "enter_player_one", 8, -8, 131072, 0, 1148846080, 0)
    native.setSynchronizedScenePhase(uLocal_376, 0.0)

And as you see in the video the animation seem to not be synced unless I made it wrongly...

I've tried with multiple animations flags like "2, 16" or "514, 16" without better results

xenicle avatar Aug 05 '23 13:08 xenicle

As you can see in the typings, you need to return true in all the events

https://github.com/altmp/altv-types/blob/master/server/index.d.ts#L331

C0kkie avatar Aug 05 '23 13:08 C0kkie

As you can see in the typings, you need to return true in all the events

https://github.com/altmp/altv-types/blob/master/server/index.d.ts#L331

Thanks @C0kkie but I'm making certainly something wrong ! I've tried with (on 15-RC2 or DEV457):

Server side:

alt.on('requestSyncedScene', (player, sceneId) => {
    alt.log('requestSyncedScene', player.name, sceneId)
    return true
})

alt.on('startSyncedScene', (player, sceneId, startPos, startRot, animDictHash, entityAnimPairs, ) => {
    alt.log('startSyncedScene', player.name, sceneId)
    return true
})

alt.on('stopSyncedScene', (player, sceneId) => {
    return true
})

alt.on('updateSyncedScene', (player, startRate, sceneId) => {
    return true
})

And the code above client side. And It's not working : I doesn't even get the log when the scene start or is request...

xenicle avatar Aug 05 '23 14:08 xenicle

As you can see in the typings, you need to return true in all the events https://github.com/altmp/altv-types/blob/master/server/index.d.ts#L331

Thanks @C0kkie but I'm making certainly something wrong ! I've tried with (on 15-RC2 or DEV457):

Server side:

alt.on('requestSyncedScene', (player, sceneId) => {
    alt.log('requestSyncedScene', player.name, sceneId)
    return true
})

alt.on('startSyncedScene', (player, sceneId, startPos, startRot, animDictHash, entityAnimPairs, ) => {
    alt.log('startSyncedScene', player.name, sceneId)
    return true
})

alt.on('stopSyncedScene', (player, sceneId) => {
    return true
})

alt.on('updateSyncedScene', (player, startRate, sceneId) => {
    return true
})

And the code above client side. And It's not working : I doesn't even get the log when the scene start or is request...

I've tried another approach with networkCreateSynchronisedScene native on 15.0-DEV463 and it's working with one player.

xenicle avatar Aug 07 '23 10:08 xenicle

With to player I get

As you can see in the typings, you need to return true in all the events https://github.com/altmp/altv-types/blob/master/server/index.d.ts#L331

Thanks @C0kkie but I'm making certainly something wrong ! I've tried with (on 15-RC2 or DEV457): Server side:

alt.on('requestSyncedScene', (player, sceneId) => {
    alt.log('requestSyncedScene', player.name, sceneId)
    return true
})

alt.on('startSyncedScene', (player, sceneId, startPos, startRot, animDictHash, entityAnimPairs, ) => {
    alt.log('startSyncedScene', player.name, sceneId)
    return true
})

alt.on('stopSyncedScene', (player, sceneId) => {
    return true
})

alt.on('updateSyncedScene', (player, startRate, sceneId) => {
    return true
})

And the code above client side. And It's not working : I doesn't even get the log when the scene start or is request...

I've tried another approach with networkCreateSynchronisedScene native on 15.0-DEV463 and it's working with one player.

With to player I've got this results :

MedalTVGrandTheftAutoV20230807224525.webm

xenicle avatar Aug 07 '23 20:08 xenicle

With to player I get

As you can see in the typings, you need to return true in all the events https://github.com/altmp/altv-types/blob/master/server/index.d.ts#L331

Thanks @C0kkie but I'm making certainly something wrong ! I've tried with (on 15-RC2 or DEV457): Server side:

alt.on('requestSyncedScene', (player, sceneId) => {
    alt.log('requestSyncedScene', player.name, sceneId)
    return true
})

alt.on('startSyncedScene', (player, sceneId, startPos, startRot, animDictHash, entityAnimPairs, ) => {
    alt.log('startSyncedScene', player.name, sceneId)
    return true
})

alt.on('stopSyncedScene', (player, sceneId) => {
    return true
})

alt.on('updateSyncedScene', (player, startRate, sceneId) => {
    return true
})

And the code above client side. And It's not working : I doesn't even get the log when the scene start or is request...

I've tried another approach with networkCreateSynchronisedScene native on 15.0-DEV463 and it's working with one player.

With to player I've got this results :

MedalTVGrandTheftAutoV20230807224525.webm

Does it's because I have disabled netowner on the objects that I get this ?

xenicle avatar Aug 08 '23 08:08 xenicle