whats wrong with this npc fs
#1

I'm trying to follow the npc tutorial.. Ive made 2 npcs using it before a few months ago,since then ive frogotton how it works. Ive recorded the npc,done the first part of the tut no problem.When it comes to the connecting part,i can't get it to compile. Here's what ive got.

Код:
public OnFilterScriptInit()
{
  print("my filterscript");
  ConnectNPC("MyFirstNPC","hello");
  return 1;
}
new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
  print("my filterscript");
  ConnectNPC("MyFirstNPC","hello");
  MyFirstNPCVehicle = CreateVehicle(400, 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, "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;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)