Need Huge Help With Actors.
#1

Hello Guys This Is My First Post And Sorry If I Had Placed It In A Wrong Section.Here Is Script Below.
Код:
CMD:test(playerid)
{
    new
        actors[5]
    ;

    actors[0] = CreateActor(45, -1511.1079,761.8273,7.1875, 0);//Animination Don't Work
    actors[1] = CreateActor(246, -1522.5654,750.2553,-10.9301, 0);
    actors[2] = CreateActor(246, -1519.9024,750.2504,-10.9301, 0);
    actors[3] = CreateActor(246, -1523.4891,750.2548,-10.9301, 0);
    actors[4] = CreateActor(246, -1518.8878,750.2539,-10.9301, 0);
    

    ApplyActorAnimation(actors[0], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);//Animination Don't Work
    ApplyActorAnimation(actors[1], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
    ApplyActorAnimation(actors[2], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
    ApplyActorAnimation(actors[3], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
    ApplyActorAnimation(actors[4], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
    
    SetPlayerPos(playerid, -1523.1636,736.6088,7.1875);
    return 1;
}
My Problem Is That When Ever A Person Type /test Command It Loads The Actor Again.I Mean A Person Type The /Test Command And Get Teleported To a Club And At That Same Time Actors get Loaded but when i again type the /test command again i got teleported to club but again the actors load again Actors Are Their But When A Person Type /test command the actors get loaded again .You Can Easily Understand My Error By Seeing This Video
Video Url =)https://*********/rmeYCVwSYiQ

Please Help Me.
Reply
#2

The actors will be created every time you type the /test command,that is what you told the command to do.You will need to place the CreateActor lines outside the command.Put them under OnGameModeInit function like this:

Код:
public OnGameModeInit{}
{
    new
        actors[5]
    ;

    actors[0] = CreateActor(45, -1511.1079,761.8273,7.1875, 0);//Animination Don't Work
    actors[1] = CreateActor(246, -1522.5654,750.2553,-10.9301, 0);
    actors[2] = CreateActor(246, -1519.9024,750.2504,-10.9301, 0);
    actors[3] = CreateActor(246, -1523.4891,750.2548,-10.9301, 0);
    actors[4] = CreateActor(246, -1518.8878,750.2539,-10.9301, 0);
    

    ApplyActorAnimation(actors[0], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);//Animination Don't Work
    ApplyActorAnimation(actors[1], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
    ApplyActorAnimation(actors[2], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
    ApplyActorAnimation(actors[3], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
    ApplyActorAnimation(actors[4], "STRIP", "strip_E", 4.1, 1, 0, 0, 0, 0);
}
Then use the command /test only for teleport,so it will not create actors(they will be already there...):
Код:
CMD:test(playerid)
{
   SetPlayerPos(playerid, -1523.1636,736.6088,7.1875);
   return 1;
}
This should work.
Reply
#3

you need preload animation before used, look like

Quote:

public OnGameModeInit{}
{
new actors[5];

actors[0] = CreateActor(45, -1511.1079,761.8273,7.1875, 0);//Animination Don't Work
actors[1] = CreateActor(246, -1522.5654,750.2553,-10.9301, 0);
actors[2] = CreateActor(246, -1519.9024,750.2504,-10.9301, 0);
actors[3] = CreateActor(246, -1523.4891,750.2548,-10.9301, 0);
actors[4] = CreateActor(246, -1518.8878,750.2539,-10.9301, 0);

for(new i; i < sizeof(actors); i++)
{
ApplyActorAnimation(actors[i], "STRIP", "null", 4.1, 1, 0, 0, 0, 0);
}
}

then you can use any animation from STRIP.
Reply
#4

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)