#1

I am tryng to create a NPC using https://sampforum.blast.hk/showthread.php?tid=110195

but when I add the
PHP код:
public OnFilterScriptInit()
{
  
ConnectNPC("MyFirstNPC","mynpc");
  return 
1;

part it says :
PHP код:
"C:\Users\Remco\Desktop\SAMP Server\filterscripts\Bus2.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\Remco\Desktop\SAMP Server\filterscripts\Bus2.pwn(17) : error 017: undefined symbol "
ConnectNPC"" 
Whole script :
PHP код:
#define RECORDING "Bus" //Dit is de bestandsnaam van je opgenomen bestand, zonder extensie!
#define RECORDING_TYPE 1 //1 Voor in een voertuig en 2 voor te voet.
#include <a_npc>
main(){}
public 
OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPERECORDING);
#if RECORDING_TYPE == 1
  
public OnNPCEnterVehicle(vehicleidseatidStartRecordingPlayback(RECORDING_TYPERECORDING);
  public 
OnNPCExitVehicle() StopRecordingPlayback();
#else
  
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPERECORDING);
#endif
public OnFilterScriptInit()
{
  
ConnectNPC("MyFirstNPC","mynpc");
  return 
1;

Reply
#2

pawn Код:
public OnGameModeInit()
{
  ConnectNPC("MyFirstNPC","mynpc");
  return 1;
}
That's supposed to go in your gamemode.
Reply
#3

PHP код:
public OnFilterScriptInit()
{
  
ConnectNPC("MyFirstNPC","mynpc");
  return 
1;

I got OnFilterScriptInit
Reply
#4

the #include <a_npc> is wrong. your script is NOT a filterscript nor a gamemode, its a NPC script - that one which gets called by the ConnectNPC() callback (from within a filter/gamemode script).
it in fact requires 2 scripts to run a NPC: 1 (filter)script, and the npc "type" itself. a busdriver, a plane etc.
read that tutorial again, iam sure you missed something tricky there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)