• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Actor weapon
#1
Based on this actor:
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]



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]

Code:
// alambra
CreateDynamicActor(bizzid, 17, 194, 501.6993,-20.4994,1000.6797,88.5219);

[Image: 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)
  Reply


Messages In This Thread
Actor weapon - by annety - 2021-03-07, 02:30 PM
RE: Actor weapon - by Virsenas - 2021-03-07, 02:34 PM
RE: Actor weapon - by Y_Less - 2021-03-07, 04:28 PM
RE: Actor weapon - by annety - 2021-03-08, 01:16 AM
RE: Actor weapon - by Y_Less - 2021-03-10, 02:06 AM
RE: Actor weapon - by Radical - 2021-03-10, 10:38 AM
RE: Actor weapon - by annety - 2021-03-21, 06:47 PM
RE: Actor weapon - by annety - 2021-04-20, 06:22 AM
RE: Actor weapon - by AbyssMorgan - 2021-04-20, 02:53 PM
RE: Actor weapon - by annety - 2021-04-21, 07:19 AM
RE: Actor weapon - by annety - 2021-04-26, 08:30 AM
RE: Actor weapon - by AbyssMorgan - 2021-04-27, 03:05 PM

Forum Jump: