ERRORS WITH NPC!
#1

Hey,

trying to add NPC's into my game but i get errors:

pawn Код:
#define RECORDING "Cop1" //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

public OnFilterScriptInit()
{
  print("my filterscript");
  ConnectNPC("MyFirstNPC","Cop1");
  if(IsPlayerNPC(playerid)) return 1;
  return 1;
}
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
    if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
Код:
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(18) : error 017: undefined symbol "ConnectNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(19) : error 017: undefined symbol "IsPlayerNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(22) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(24) : error 017: undefined symbol "IsPlayerNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\npc.pwn(30) : error 017: undefined symbol "PutPlayerInVehicle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
its proberly summit simple but im to tired to find out what so please help
Reply
#2

Move

pawn Код:
public OnFilterScriptInit()
{
  print("my filterscript");
  ConnectNPC("MyFirstNPC","Cop1");
  if(IsPlayerNPC(playerid)) return 1;
  return 1;
}
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
    if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
to your gamemode or a filterscript and remove
pawn Код:
main() {}
NPC scripts are different from regular filterscripts and gamemodes.
Reply
#3

Код:
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(15) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(18) : error 017: undefined symbol "ConnectNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(21) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn")
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(23) : error 017: undefined symbol "IsPlayerNPC"
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\npcmodes\npc.pwn(29) : error 017: undefined symbol "PutPlayerInVehicle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#4

nvm all working fine now
Reply
#5

okay now my NPC is timing out ? why would this be
Reply
#6

RequestClass check return 1 for them?(bots)
Reply
#7

i tell you in msn
Reply
#8

when you coming on MSN ?
Reply
#9

You don't have
PHP код:
#include <a_samp> 
So simple....
Reply
#10

you dont need it i dont think with bots i have never used it and never had any issues
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)