NPC's Not playing Animations.
#1

Alright so I have been having problems with NPC's for the last week now, this is my current code

pawn Код:
public OnGameModeInit()
{
    loadnpcs();
}

forward loadnpcs();
public loadnpcs()
{

    ConnectNPC("Hobo","Hobo");
    return 1;

}


forward Hobo();
public Hobo()
{

    ApplyAnimation(0, "CRACK", "crckidle2", 4.0, 0, 0, 0, 0, 1);
    return 1;

}
pawn Код:
public OnPlayerSpawn(playerid)
{
    ApplyAnimation(playerid, "CRACK", "Null", 4.0, 0, 0, 0, 0, 1);
    ApplyAnimation(playerid, "CRACK", "Null", 4.0, 0, 0, 0, 0, 1)

    if(IsPlayerNPC(playerid))
    {
        new name[24];GetPlayerName(playerid,name,24);
        if(strcmp(name,"Hobo",true) )
        {
            SetPlayerSkin(playerid,230);
            SetTimer("Hobo",1000,0);
            return 1;
        }
       
        if(strcmp(name,"Hobo2",true)!=0)
        {
            SetPlayerSkin(playerid, 230);
            return 1;
        }
    }
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    if(playerid == 0)
    {
   
        ApplyAnimation(0, "CRACK", "crckidle2", 4,0,0,0,0,1);
        return 1;
    }
    return 1;
}
I have tried if(forplayerid == 0) too, no luck.

pawn Код:
#include <a_npc>

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

main()
{

}

public OnNPCSpawn()
{
    //SetMyPos(-580.7319,2612.1948,53.9348);
    StartRecordingPlayback(2,"Hobo");
    PauseRecordingPlayback();
    return 1;

}
//------------------------------------------
NPC MiniScript.

All help is appreciated
Reply
#2

I think you need to play the animation while your recording for the NPC.
Reply
#3

Quote:
Originally Posted by Soumi
Посмотреть сообщение
I think you need to play the animation while your recording for the NPC.
Thank you so much rep++, I spent a week on this thing, I wrote some unbelievably complicated code, and you come along like a godsend, I think I am used to the old system or something, Before I didn't even need a playback I could just SetMyPos and apply the animation.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)