NPC Errors
#8

Код:
new ConnectNPC;
public OnFilterScriptInit()
{
  print("scriptfiles");
  ConnectNPC("Taxi","TAXI");
  return 1;
}
new MyFirstNPCVehicle; //Global variable!
publicOnFilterScriptInit() //first here you havent a place public[place]OnFil........, second, you cant have 2Ч public OnFilterScriptInit()
{
  print("BlaBla");
  ConnectNPC("Taxi","TAXI");
  MyFirstNPCVehicle = CreateVehicle(420,1536.6427,-841.7883,64.4755,266.3878,6,1, 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, "TAXI", 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;
}
Make this:
pawn Код:
new ConnectNPC; //you dont need this, because its already defined, so delete this...

public OnFilterScriptInit()
{
 
  ConnectNPC("Taxi","TAXI");
  MyFirstNPCVehicle = CreateVehicle(420,1536.6427,-841.7883,64.4755,266.3878,6,1, 5000);
  return 1;
}

new MyFirstNPCVehicle; //Global variable!

}
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, "TAXI", 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


Messages In This Thread
NPC Errors - by Matej682 - 20.10.2009, 17:13
Re: NPC Errors - by Pawno_Master - 20.10.2009, 17:30
Re: NPC Errors - by Matej682 - 20.10.2009, 17:33
Re: NPC Errors - by Cezar - 20.10.2009, 17:35
Re: NPC Errors - by Matej682 - 20.10.2009, 17:36
Re: NPC Errors - by Pawno_Master - 20.10.2009, 17:41
Re: NPC Errors - by Matej682 - 20.10.2009, 17:45
Re: NPC Errors - by yugokoral - 20.10.2009, 17:50
Re: NPC Errors - by Matej682 - 20.10.2009, 18:09
Re: NPC Errors - by yugokoral - 20.10.2009, 18:26

Forum Jump:


Users browsing this thread: 8 Guest(s)