SA-MP Forums Archive
npc help... - 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 help... (/showthread.php?tid=235059)



npc help... - tanush - 05.03.2011

help... script
pawn Код:
#define RECORDING "spawn" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //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

public OnFilterScriptInit()
{
  ConnectNPC("Tanush","spawn");
  return 1;
}
well i got this error and one warning
pawn Код:
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(17) : error 017: undefined symbol "ConnectNPC"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: npc help... - Stigg - 05.03.2011

Код:
#include <a_samp>
Perhaps ?

Forget that i was'nt thinking. lol


Re: npc help... - tanush - 05.03.2011

i did that and got 3error -.-, otherwise this topic wouldnt be here
pawn Код:
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(6) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(6) : error 017: undefined symbol "StartRecordingPlayback"
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(9) : warning 235: public function lacks forward declaration (symbol "OnNPCEnterVehicle")
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(9) : error 017: undefined symbol "StartRecordingPlayback"
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(10) : warning 235: public function lacks forward declaration (symbol "OnNPCExitVehicle")
D:\Users\Tanush\Desktop\SA-MP\filterscripts\NPC.pwn(10) : error 017: undefined symbol "StopRecordingPlayback"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.



Re: npc help... - Stigg - 05.03.2011

Its was just a suggestion.


Re: npc help... - tanush - 05.03.2011

can u help me please


Re: npc help... - antonio112 - 05.03.2011

Ok, so you did it completly wrong. First, you need to make a pawno file, with this one:

pawn Код:
#define RECORDING "spawn" //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
Compile it ...

Then, later on, you have to connect the NPC in your gamemode, or filterscript, using "ConnectNPC"

Better yet, read this tutorial please.

https://sampforum.blast.hk/showthread.php?tid=95034