Npc recordingplayback question
#1

I have a question.

CMD:npc(playerid, params[])
{
new npcid;
new name[24];
format(name, 24, "NPC_%d", 1);
npcid = FCNPC_Create(name);
new Float:PosX, Float:PosY, Float:PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
FCNPC_Spawn(npcid, random(299), PosX+1.0, PosY+1.0, PosZ);
FCNPC_StartRecordingPlayback(npcid, "mynpc");
return 1;
}

public FCNPC_OnFinishPlayback(npcid)
{
FCNPC_StartRecordingPlayback(npcid, "mynpc");
return 1;
}

This code makes "my npc" file repeat when it finishes. But for example i create 300 npc. Do i have to create 300 FCNPC_OnFinishPlayback code for every each of them?? I heard that there's an easier way to do it, with few lines.

I using this plugin https://sampforum.blast.hk/showthread.php?tid=428066
Reply
#2

You know... what you have there is pretty much... it?
pawn Код:
//Original
public FCNPC_OnFinishPlayBack(npcid)
{
    FCNPC_StartRecordingPlayback(npcid, "mynpc");
    return 1;
}
When a NPC finishes, it would jump to this code and restart the play, would it not? It would just keep the same record file name though. I don't believe there is any other way to have a continuous loop, though (excluding similar ways such as timers).
Reply
#3

Oh... Thank you anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)