Based on this actor:
With editdynamic object i found a formula to get the weapon position based on actor position (to put the weapon in actor hands):
For this actor it become amazing:
![[Image: Tfc0wa7.png]](https://i.imgur.com/Tfc0wa7.png)
I did think that it gonna work with all other actores, but didn't:
![[Image: igOe4f7.png]](https://i.imgur.com/igOe4f7.png)
![[Image: rA9pALX.png]](https://i.imgur.com/rA9pALX.png)
Anybody more experienced could help me to make the weapon works on all actor like the first one (24/7)?
Would be an amazing feature to all servers do in some way put a weapon on actor hands based on his position...
(i know about npc, i want fix this way to put this weapons for actors)
Code:
// 24-7
CreateDynamicActor(bizzid, 17, 142, -29.0206,-186.8182,1003.5469,1.6775);
With editdynamic object i found a formula to get the weapon position based on actor position (to put the weapon in actor hands):
Code:
// created [15:21:57] x[-29.020599] y[-186.818206] z[1003.546875] RotX[0] RotY[0] RotZ[0]
new Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
GetDynamicActorPos(actorid, x, y, z);
// moved [15:23:45] x[-28.945550] y[-186.275421] z[1003.882324] rx[0.000000] ry[-3.300002] rz[98.899940]
x += 1.0;
x -= 0.924951;
y += 0.542785;
z += 0.335449;
rx = 0.0;
ry = -3.300002;
rz = 98.899940;
DestroyDynamicObject(ActorInfo[actorid][actorGun]);
ActorInfo[actorid][actorGun] = CreateDynamicObject(GetGunObjectID(24), x, y, z, rx, ry, rz);
For this actor it become amazing:
![[Image: Tfc0wa7.png]](https://i.imgur.com/Tfc0wa7.png)
I did think that it gonna work with all other actores, but didn't:
Code:
// pizza
CreateDynamicActor(bizzid, 5, 155, 374.7394,-117.2788,1001.4922,180.5908);
![[Image: igOe4f7.png]](https://i.imgur.com/igOe4f7.png)
Code:
// alambra
CreateDynamicActor(bizzid, 17, 194, 501.6993,-20.4994,1000.6797,88.5219);
![[Image: rA9pALX.png]](https://i.imgur.com/rA9pALX.png)
Anybody more experienced could help me to make the weapon works on all actor like the first one (24/7)?
Would be an amazing feature to all servers do in some way put a weapon on actor hands based on his position...
(i know about npc, i want fix this way to put this weapons for actors)