SA-MP Forums Archive
my npc keep moving ? WTF ? - 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: my npc keep moving ? WTF ? (/showthread.php?tid=571799)



my npc keep moving ? WTF ? - Metharon - 22.04.2015

https://www.youtube.com/watch?v=sVpHRDZQWUM

i'm simply using larp gamemode.

...

my code :


Код:
public OnPlayerConnect(playerid)
{
	if( IsPlayerNPC( playerid ) ) return 1;
}

public OnPlayerSpawn(playerid)
{
 	if(IsPlayerNPC(playerid))
	{
		gPlayerAccount[playerid] = 1;
		new nume[MAX_PLAYER_NAME];
		GetPlayerName(playerid,nume,sizeof(nume));
		if(!strcmp(nume,"[BOT]Tutorial1",false))
  		{
  		    TogglePlayerControllable(playerid, 0);
		    SetPlayerVirtualWorld(playerid, 95);
		    SetPlayerPos(playerid , 222.3193,115.0811,1010.2188);
		    SetPlayerFacingAngle( playerid, 177.3717 );
		    SetPlayerSkin(playerid,98);
		  	SetPlayerAttachedObject(playerid, 3,1210,5,0.3,0.1,0.0,0.0,270.0,0.0);
		}
		if(!strcmp(nume,"[BOT]Tutorial2",false))
		{
		    TogglePlayerControllable(playerid, 0);
		    SetPlayerVirtualWorld(playerid, 95);
		    SetPlayerPos(playerid , 221.5607,111.9919,1010.2118);
		    SetPlayerFacingAngle(playerid ,0.3366 );
		    SetPlayerSkin(playerid,281);
	    	SetPlayerAttachedObject(playerid, 1,19521,2,0.14,0,0,0,0,0,1,1.15,1.20);
		    SetPlayerAttachedObject(playerid, 3,19142,1,0.05,0.04,0,0,0,0,1.10,1.10,1.10);
		}
	    return 1;
	}
	
}

//------------------------------------------------------------------------------------------------------
public OnGameModeInit()
{


    new string[MAX_PLAYER_NAME];
    new string1[MAX_PLAYER_NAME];
	for(new c=0;c<CAR_AMOUNT;c++)
	{
		Gas[c] = GasMax;
	}
	ConnectNPC("[BOT]Tutorial1", "npcidle");
	ConnectNPC("[BOT]Tutorial2", "npcidle");
}



Re: my npc keep moving ? WTF ? - fuckingcruse - 22.04.2015

Check this tutorial on NPC
https://sampforum.blast.hk/showthread.php?tid=170545


Re: my npc keep moving ? WTF ? - Metharon - 22.04.2015

UP , Please somebody who know what he is talking not just post hunting ?


Re: my npc keep moving ? WTF ? - R0 - 22.04.2015

do you have npcidle in your npcmodes/recordings?if yes then when you are loading it,it will do the action that it was saved in that file.


Re: my npc keep moving ? WTF ? - Metharon - 22.04.2015

Well yes i do have it , and i want the npc just to keep idle ... to don't move.


Re: my npc keep moving ? WTF ? - R0 - 22.04.2015

remove the npcidle.rec file and make a file at npcmodes and name it npcidle,it should be a .pwn file and put this in it:
pawn Код:
#include <a_npc>
main(){}
and compile


Re: my npc keep moving ? WTF ? - Metharon - 22.04.2015

I've tried this .. the same ' afk effect' [ in video you can see they're rotating for a sec ]


maybe is because im hosting the server in my windows ?