NPC Wont Move :(
#1

I Created My First NPC And IT Wont Move
And I Add The REC File In (ROOT FOLDER/npcmodes/recording)
pawn Код:
#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
pawn Код:
public OnGameModeInit()
{
ConnectNPC("Bell","Dancer");
return 1;
}
Reply
#2

Hmm.... a onfoot NPC ?
if yes then use this
pawn Код:
#include <a_npc>

//------------------------------------------

main(){}

//------------------------------------------

NextPlayback()
{
  StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT,"your npc recording  name");
}

//------------------------------------------

public OnRecordingPlaybackEnd()
{
  NextPlayback();
}

//------------------------------------------

public OnNPCSpawn()
{
  NextPlayback();
}

//------------------------------------------

public OnNPCExitVehicle()
{
  StopRecordingPlayback();
}
and on your gamemode >>
pawn Код:
// under ongamemodeint()
ConnectNPC("NPC's name","recorded file name");
Reply
#3

Show your ConnectNPC line(s). Make sure you don't include the file extension '.rec' in ConnectNPC.
Reply
#4

what is the connect npc line?
Reply
#5

How do you record your NPC?

> You start recording
> type a command like: /dance
> then stop recording?

I don't think it will record your dance like that.

Just use ApplyAnimation in OnPlayerSpawn, if IsPlayerNPC, if strcmp Name "Bell"....
Reply
#6

I Did It And IT Wont Move
pawn Код:
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;
}
Reply
#7

Quote:
Originally Posted by misho1
Посмотреть сообщение
what is the connect npc line?
Use Ctrl+F and search the script for ConnectNPC. Post them ALL; not just the first you find.
Reply
#8

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.
Reply
#9

I Did That And It Wont Dance And He Is Frozen In The SpawnPoint
pawn Код:
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;
}
Reply
#10

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
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.
i have a NPC with chat annimation !
i just applied animation and start recording and after 2-4 seconds i stopped it
it is working well !!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)