[Tutorial] [TUT]How to force a NPC to do an Animation
#1

I have made this Tutorial to help in the future people that might have the same problem that i had, here's how you do it.
First add a animation command in your game mode.
Like this:
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmd, "/Owned", true) == 0)
  {
     ApplyAnimation(playerid,"ped","KO_shot_front",1,0,1,0,1,0);
     return 1;
  }
}
Now make sure you have your npc connected to your server and then you can add this line to your NPC file that is in the npcmodes folder.
Code:
#define RECORDING "YourNPCname" 
#define RECORDING_TYPE 2

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
--------------------------------------
public OnPlayerStreamIn(playerid)  
{                        
	SendCommand("/Owned");        <---------------- YOU'LL HAVE TO ADD THIS PUBLIC WITH THE REST
                                           UNDER THE OnNPCSpawn()
	return 1;               
}                        
--------------------------------------
And that's all!
Easy enough

Thank Boelie, not me for teaching me this so i could share with others.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)