SA-MP Forums Archive
NPC's hate me - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC's hate me (/showthread.php?tid=245730)



NPC's hate me - WillyP - 01.04.2011

Well, I've followed kc's tutorial for NPC's, yet they won't connect, and ConnectNPC is undefined even though it's obviously included with <a_npc>? WTF is up with this? I can never understand NPC's. :L


Re: NPC's hate me - GoldenM4 - 01.04.2011

try doing it ni a filter scipt but put the define for the filterscript or it will be a gamemode


Re: NPC's hate me - WillyP - 01.04.2011

Quote:
Originally Posted by GoldenM4
Посмотреть сообщение
try doing it ni a filter scipt but put the define for the filterscript or it will be a gamemode
I've already tried it in a blank GM/blank FS


Re: NPC's hate me - -Rebel Son- - 01.04.2011

Yeah NPCS are difficult to learn.
first, is your NPC on foot? or in a vehicle?

If on foot. Heres my "mynpc.pwn"
pawn Код:
#define RECORDING "mynpc" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.
#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
And in your mode.
Under ModeInIt
pawn Код:
ConnectNPC("MyFirstNPC","mynpc");
And under Request class, spawn, and such.
pawn Код:
if(IsPlayerNPC(playerid)) return 1;



Re: NPC's hate me - WillyP - 01.04.2011

Quote:
Originally Posted by -Rebel Son-
Посмотреть сообщение
Yeah NPCS are difficult to learn.
first, is your NPC on foot? or in a vehicle?

If on foot. Heres my "mynpc.pwn"
pawn Код:
#define RECORDING "mynpc" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.
#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
And in your mode.
Under ModeInIt
pawn Код:
ConnectNPC("MyFirstNPC","mynpc");
And under Request class, spawn, and such.
pawn Код:
if(IsPlayerNPC(playerid)) return 1;
I shall try now :P Thanks


Re: NPC's hate me - -Rebel Son- - 01.04.2011

Yes sir, Reply either here or PM, If you cant get it working.


Re: NPC's hate me - WillyP - 01.04.2011

Quote:
Originally Posted by -Rebel Son-
Посмотреть сообщение
Yes sir, Reply either here or PM, If you cant get it working.
I can't get it working, I'm terrible at NPC's


Re: NPC's hate me - -Rebel Son- - 01.04.2011

PM'd