aLLeN92 Posted June 4, 2020 Posted June 4, 2020 (edited) Hi, I try to add in server side to player an object, but really I don't know how, I spawn the object, but I don't know how to attach to player. I use this line to spawn the object: NAPI.Object.CreateObject(1868096318, PlayerPos, objPos, (255), (0)); native don't works on rage no? like Hash.ATTACH_ENTITY_TO_ENTITY_PHYSICALLY or that is deprecated? NAPI.Entity.AttachEntityToEntity(model, client, "IK_R_Hand", new Vector3(), new Vector3()); thanks, I appreciate! Edited June 4, 2020 by aLLeN92
Xabi Posted June 4, 2020 Posted June 4, 2020 You have to do it clientside, serverside attachment function isn't implemented. 1
Лорд Posted June 4, 2020 Posted June 4, 2020 1 час назад, Xabi сказал: You have to do it clientside, serverside attachment function isn't implemented. thanks))
aLLeN92 Posted June 5, 2020 Author Posted June 5, 2020 (edited) 16 hours ago, Xabi said: You have to do it clientside, serverside attachment function isn't implemented. Thanks Xabi. Edited June 5, 2020 by aLLeN92
aLLeN92 Posted June 5, 2020 Author Posted June 5, 2020 (edited) So, I suppose i need to use: Entity.attachTo on client side, that's equivalent to AttachEntityToEntity? thanks! EDIT: obj.attachTo is not a function... any idea? Edited June 5, 2020 by aLLeN92
Лорд Posted June 5, 2020 Posted June 5, 2020 4 часа назад, aLLeN92 сказал: So, I suppose i need to use: Entity.attachTo on client side, that's equivalent to AttachEntityToEntity? thanks! EDIT: obj.attachTo is not a function... any idea? I tired it RAGE.Game.Entity.AttachEntityToEntity(PlayerObject.Id, player.Id, RAGE.Game.Ped.GetPedBoneIndex(player.Id, 6286), 0, 0, 0, 0, 0, 0, false, false, false, true, 0, false); But it's not working... RAGE.Game.Entity.IsEntityAttachedToEntity(PlayerObject.Id, player.Id) This code return false... wtf..
aLLeN92 Posted June 5, 2020 Author Posted June 5, 2020 3 hours ago, Лорд said: I tired it RAGE.Game.Entity.AttachEntityToEntity(PlayerObject.Id, player.Id, RAGE.Game.Ped.GetPedBoneIndex(player.Id, 6286), 0, 0, 0, 0, 0, 0, false, false, false, true, 0, false); But it's not working... RAGE.Game.Entity.IsEntityAttachedToEntity(PlayerObject.Id, player.Id) This code return false... wtf.. I don't know really, I try to much forms, but at last the error as the same -> obj.attachTo is not a function. First I create the object: let obj = mp.objects.new(226364574, { position: new mp.Vector3(playCords), rotation: new mp.Vector3(0, 0, 0), alpha: 255, dimension: mp.players.local.dimension }); // And here I use the attach: obj.attachTo(myId, bone, posicion.x, position.y, position.z, rotacion.x, rotacion.y, rotacion.z, false, false, false, false, 2, true);
aLLeN92 Posted June 7, 2020 Author Posted June 7, 2020 SOLVED: Well, really is not solved, I just learn the lesson, here is the code to attach object to your entity in client side: let bone = mp.players.local.getBoneIndex = 24818; position = new mp.Vector3(-0.1, -0.15, 0.11); rotation = new mp.Vector3(-180.0, 0.0, 0.0); let obj = mp.objects.new(242383520, mp.players.local.position, { rotation: new mp.Vector3(0, 0, 0), alpha: 255, dimension: mp.players.local.dimension }); obj.attachTo(mp.players.local.handle, bone, position.x, position.y, position.z, rotation.x, rotation.y, rotation.z, true, false, false, false, 2, false);
M4ybe Posted June 17, 2020 Posted June 17, 2020 this does not work for me, the first time the client is launched, a visible object is always created that is not attached to anything, but after repeated attachment, attach works and attaches to the bone, how can I overcome this error?
aLLeN92 Posted June 18, 2020 Author Posted June 18, 2020 10 hours ago, M4ybe said: this does not work for me, the first time the client is launched, a visible object is always created that is not attached to anything, but after repeated attachment, attach works and attaches to the bone, how can I overcome this error? Hi Friend, post your code and I try to help you!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now