NPC help
#1

Код:
C:\Users\Jack\Desktop\samp\filterscripts\npc.pwn(7) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
C:\Users\Jack\Desktop\samp\filterscripts\npc.pwn(7) : error 017: undefined symbol "StartRecordingPlayback"
C:\Users\Jack\Desktop\samp\filterscripts\npc.pwn(10) : warning 235: public function lacks forward declaration (symbol "OnNPCEnterVehicle")
C:\Users\Jack\Desktop\samp\filterscripts\npc.pwn(10) : error 017: undefined symbol "StartRecordingPlayback"
C:\Users\Jack\Desktop\samp\filterscripts\npc.pwn(11) : warning 235: public function lacks forward declaration (symbol "OnNPCExitVehicle")
C:\Users\Jack\Desktop\samp\filterscripts\npc.pwn(11) : error 017: undefined symbol "StopRecordingPlayback"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
heres FS

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

new MyFirstNPCVehicle;
public OnFilterScriptInit()
{
  print("my gamemode");
  ConnectNPC("James_Keyworth","mynpc");
  MyFirstNPCVehicle = CreateVehicle(545, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  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, "James_Keyworth", 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;
}
Reply
#2

your NPC .pwn and .amx must be in npc folder(npcmodes)
Reply
#3

Still Didn't help... all the same errors
Reply
#4

look you need to do like this

open pawno and paste this :
Quote:

#include <a_samp>
#include <a_npc>
#define RECORDING "mynpc" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1
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

then compile that and give it name "mynpc1"
then go to your gamemode
and find public OnFilterScriptInit()
type above public OnFilterScriptInit()
Quote:

new MyFirstNPCVehicle;

then type in public OnFilterScriptInit()
Quote:

MyFirstNPCVehicle = CreateVehicle(545, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);

Quote:

ConnectNPC("James_Keyworth","mynpc1");

then find OnPlayerSpawn
and add this:
Quote:

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, "James_Keyworth", 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;
}

it gonna work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)