npc problems
#2

First of all you have the same NPC 2 times
pawn Код:
public OnGameModeInit()
{
  ConnectNPC("MyFirstNPC","area51tank1");
  ConnectNPC("MySecondNPC","area51tank2"); //If you want 2nd npc
  return 1;
}
Then if the npc are on vehicl you should kreate one for them
pawn Код:
new MyFirstNPCVehicle; //MyFirstNPC replace the NPC's name if you want to change it
If the NPC is on foot skip this
pawn Код:
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


Messages In This Thread
npc problems - by manchestera - 16.10.2011, 15:27
Re: npc problems - by Kostas' - 16.10.2011, 15:34
Re: npc problems - by manchestera - 16.10.2011, 16:41
Re: npc problems - by Kostas' - 16.10.2011, 16:51
Re: npc problems - by manchestera - 16.10.2011, 17:03
Re: npc problems - by Kostas' - 16.10.2011, 17:08
Re: npc problems - by manchestera - 16.10.2011, 17:18
Re: npc problems - by Kostas' - 16.10.2011, 17:40
Re: npc problems - by manchestera - 16.10.2011, 18:22
Re: npc problems - by Kostas' - 16.10.2011, 18:33

Forum Jump:


Users browsing this thread: 1 Guest(s)