Actors bug
#1

When i create actors they are created like in the picture,but when i i use the command which re create them it works fine

Reply
#2

Can I please see the code where you create the actors? I can't know what's wrong without seeing the code..
Reply
#3

pawn Код:
SetPlayerVirtualWorld(playerid,3);
               
                Robber1 = CreateActor(227,1887.2599,-2364.5789,13.5391,215.3990);
               
                Robber2 = CreateActor(61,1888.8770,-2366.2468,13.5391,50.2707);
               
                ApplyActorAnimation(Robber1, "PED", "IDLE_CHAT", 1.800001, 1, 1, 1, 1, 13000);
               
                ApplyActorAnimation(Robber2, "PED", "IDLE_CHAT", 1.800001, 1, 1, 1, 1, 13000);
               
                RobberPlane = CreateVehicle(519,1881.2903,-2364.6726,14.4760,231.6925,1,1,1000);
               
                HeistCar = CreateVehicle(411,2488.4846,-1682.3033,13.0745,87.3089,0,0,1000);
               
                HeistCP = SetPlayerRaceCheckpoint(playerid, 2,1961.3497,-2175.5864,13.5223, 0.0,0.0,0.0, 5.0);
               
                SetVehicleVirtualWorld(RobberPlane,3);
               
                SetVehicleVirtualWorld(HeistCar,3);
               
                SetActorVirtualWorld(Robber1, 3);
               
                SetActorVirtualWorld(Robber2, 3);
               
                SetActorInvulnerable(Robber1, false);
               
                SetActorInvulnerable(Robber2, false);
               
                SetActorHealth(Robber1,50);
               
                SetActorHealth(Robber2,50);
               
                gokill[playerid] =1;
Reply
#4

Which actors are having those problems? Robber2 and robber1?
Reply
#5

as you see in the picture both are spawned flying and upon each others.
Reply
#6

Okay I don't know where the problem is , but I can tell you some possibilities

1.The two actors are close to each other so increase the distance between them

2. there is a problem in the animation of the actors so try to change this:

pawn Код:
ApplyActorAnimation(Robber1, "PED", "IDLE_CHAT", 1.800001, 1, 1, 1, 1, 13000);
               
ApplyActorAnimation(Robber2, "PED", "IDLE_CHAT", 1.800001, 1, 1, 1, 1, 13000);
to this:
pawn Код:
ApplyActorAnimation(Robber1, "PED", "IDLE_CHAT", 1.800001, 1, 0, 0, 1, 13000);
               
ApplyActorAnimation(Robber2, "PED", "IDLE_CHAT", 1.800001, 1, 0, 0, 1, 13000);
Reply
#7

As i said that when i make the command again,they get in their right positions.
Reply
#8

Then try to change the applyanimation variable as I told you above and see if it works out without making the command again
Reply
#9

same problem
Reply
#10

Quote:
Originally Posted by Eth
Посмотреть сообщение
Then try to change the applyanimation variable as I told you above and see if it works out without making the command again
No that wouldn't make a difference, it has to do with the synchronization of the actors on distance, that issue only appears when you spawn far away from the actors and you go toward their area, you'll see them like that. But if you spawn near them, they'll work fine.

I have the same issue with my actors system and I have to resync them & from there they work fine, I am still looking for a solution for the same issue.

I recommend using http://forum.sa-mp.com/showthread.ph...ghlight=Emmet_ for the resync actor function.
Reply
#11

Same,how can be the problem in animation and it works when i use the command again and again,only the first time it get fucked,how ?

@carrot I'm already using Emmet's include but when shall i Resync the actors ?
Reply
#12

Check the distance between the player and the actor OnPlayerUpdate, for example:
pawn Код:
public OnPlayerUpdate(playerid)
{
  new Float:X,Float:Y,Float:Z;

  for(new i = 0; i < MAX_ACTORS; i ++)
  {
    GetActorPos(i,X,Y,Z);
    if(IsPlayerInRangeOfPoint(playerid,5.0,X,Y,Z))
    {
    ResyncActor(i);
    }
  }
  return 1;
}
this should work.
Reply
#13

this kept syncing lol,but the idea helped me and i fixed it,Thanks
Reply
#14

Quote:
Originally Posted by zamaleksc
Посмотреть сообщение
this kept syncing lol,but the idea helped me and i fixed it,Thanks
Lol My bad didn't notice that it will keep resyncing xD glad you fixed it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)