SA-MP Forums Archive
standing npc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: standing npc (/showthread.php?tid=512818)



standing npc - Slicebook - 12.05.2014

hello,npc-How do I set up so that only stand still in one place?

This method does not work:
Code:
#include <a_samp>

public OnFilterScriptInit()
{
       ConnectNPC("BOT_TESZT1", "BOT_TESZT1");
       return 1;
}
public OnPlayerSpawn(playerid)
{
       if(IsPlayerNPC(playerid))
       {
            new npcname [MAX_PLAYER_NAME];
            GetPlayerName(playerid, npcname, sizeof(npcname));
            if(!strcmp(npcname, "BOT_TESZT1", true))
            {
                        SetPlayerSkin(playerid,100);
                        SetPlayerPos(playerid, 2105.4880,-1806.4983,13.5547);
            }
            return 1;
      }
       return 1;
}
Code:
#include <a_npc>

public OnRecordingPlaybackEnd()
{
}

public OnNPCSpawn()
{
}

public OnNPCExitVehicle()
{
}
I did everything as it should be, but it is not good, help!


Re: standing npc - Aerotactics - 12.05.2014

Quote:
Originally Posted by Slicebook
View Post
I did everything as it should be, but it is not good, help!
Everything?

pawn Code:
StartRecordingPlayback(2, "idle");



Re: standing npc - Vince - 12.05.2014

You don't need recording playbacks for idle NPCs. Speaking from experience. However, you will need to allow them through your registration process. Add IsPlayerNPC in places where it might get stuck.