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=246483)



NPC help - Jack_Rocker - 04.04.2011

Код:
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;
}



Re: NPC help - Amel_PAtomAXx - 04.04.2011

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


Re: NPC help - Jack_Rocker - 04.04.2011

Still Didn't help... all the same errors


Re: NPC help - Amel_PAtomAXx - 04.04.2011

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