#define RECORDING "Dancer"
#define RECORDING_TYPE 2
#include <a_npc>
main() {}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#if RECORDING_TYPE == 1
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();
#else
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
public OnGameModeInit()
{
ConnectNPC("Bell","Dancer");
return 1;
}
#include <a_npc>
//------------------------------------------
main(){}
//------------------------------------------
NextPlayback()
{
StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT,"your npc recording name");
}
//------------------------------------------
public OnRecordingPlaybackEnd()
{
NextPlayback();
}
//------------------------------------------
public OnNPCSpawn()
{
NextPlayback();
}
//------------------------------------------
public OnNPCExitVehicle()
{
StopRecordingPlayback();
}
// under ongamemodeint()
ConnectNPC("NPC's name","recorded file name");
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(name,"Bell",false))
{
SetPlayerSkin(playerid,7);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
SetPlayerPos(playerid,2102.6191,-2638.7517,13.5469);
}
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(name,"Bell",false))
{
SetPlayerSkin(playerid,7);
ApplyAnimation(playerid,"DANCING","dnce_M_a",10.0,1,1,1,1,1);
SetPlayerPos(playerid,2102.6191,-2638.7517,13.5469);
}
return 1;
}
return 1;
}
Special actions would require triggering I suppose. (Correct me if I'm wrong).
Like when you are smoking (special action), You need to press the Fire button to use it. NPCs won't automatically do that. That's why i said, you need to Apply an Animation (twice) to see it dance. Try it. |