Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weapon objects poor sync #2249

Closed
ivanzaida opened this issue Oct 20, 2023 · 1 comment
Closed

Weapon objects poor sync #2249

ivanzaida opened this issue Oct 20, 2023 · 1 comment

Comments

@ivanzaida
Copy link
Contributor

ivanzaida commented Oct 20, 2023

When I create a weapon object based on a weapon, I attach it to the back of the player
It seems like weapon objects attachment is poorly streamed
I use this function to create a weapon object
export const createWeaponObject = ( weaponType: number, amountOfAmmo: number, newCoorsX: number, newCoorsY: number, newCoorsZ: number, createDefaultComponents: boolean, scale: number = 1, customModel: number = 0, registerAsNetworkObject: boolean = false, scriptHostObject: boolean = true, ): number => { return Citizen.invokeNative<number>( '0x9541D3CF0D398F36', weaponType, amountOfAmmo, newCoorsX, newCoorsY, newCoorsZ, createDefaultComponents, scale, customModel, registerAsNetworkObject, scriptHostObject, ); };

createWeaponObject(currentWeapon.Hash, currentWeapon.Ammo, x, y, z, true, 1, 0, true, true)

then I use this code to attach the created prop to a player

AttachEntityToEntity(prop, playerPed, GetPedBoneIndex(GetPlayerPed(-1), x, y, z, rx, ry, rz, false, false, false, false, 1, true);

And on the client's I executed this code side it works just fine, but for other clients weapon components do not sync and the attached weapon object position gets updated only every 5 secods (roughly)

server version is 6798 (windows)
game version is 2944

video: https://www.youtube.com/watch?v=EZyMeSWU4tM&ab_channel=RebusOID

@gottfriedleibniz
Copy link
Contributor

The game prevents objects created by CREATE_WEAPON_OBJECT from synchronizing its attachment data when attached to a Ped (for reference: 0x1410C63BC/1604). Reference CREATE_OBJECT* instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants