08.11.2016, 02:29
Basically what you need to do is create a variable that you assign to an actor once you create it. Then you need to link the position of the actor to the position of the cp. Then once you create an actor you apply the animation to the created actor. If we use IceBilizard's code it will be something like this
Hope this helps.
PHP код:
new Actor[MAX_PLAYERS];
enum CPInfo
{
Float:CPX,
Float:CPY,
Float:CPZ,
Float:ActorX,
Float:ActorY,
Float:ActorZ,
ActorSkin,
ActorVW
};
new Float:CheckPoint[][CPInfo] =
{
{CPX, CPY, CPZ, ActorX, ActorY, ActorZ, ActorSkin, ActorVW}//You can add more
};
CMD:test(playerid, params[])
{
new CPPos[3], ActorPos[4], actorskin;
new randomcp = random(sizeof(Checkpoint));
CPPos[0] = CheckPoint[randomcp][CPX];
CPPos[1] = CheckPoint[randomcp][CPY];
CPPos[2] = CheckPoint[randomcp][CPZ];
//Actor
actorskin = CheckPoint[randomcp][ActorSkin];
ActorPos[0] = CheckPoint[randomcp][ActorX];
ActorPos[1] = CheckPoint[randomcp][ActorY];
ActorPos[2] = CheckPoint[randomcp][ActorZ];
ActorPos[3] = CheckPoint[randomcp][ActorVW];
CreatePlayerCheckpoint(playerid, CPPos[0], CPPos[1], CPPos[2], 5.0);
Actor[playerid] = CreateActor(actorskin, ActorPos[0], ActorPos[1], ActorPos[2], 0.0);
ApplyActorAnimation(Actor[playerid], "FOOD", "FF_Sit_Eat3", 4.0, 1, 0, 0, 0, 0, 1);
SetActorVirtualWorld(Actor[playerid], ActorPos[3]);
return 1;
}