#8

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;
}
I copied it from Kye's post regarding NPC creation. If it's a vehicle NPC then leave it as is, if it's a walking NPC then use SetSpawnInfo on it.
Reply


Messages In This Thread
Npcs - by Eirikm - 20.06.2011, 17:32
Re: Npcs - by [BP]Tony - 20.06.2011, 17:48
Re: Npcs - by Eirikm - 21.06.2011, 13:25
Re: Npcs - by PCheriyan007 - 21.06.2011, 13:42
Re: Npcs - by Eirikm - 22.06.2011, 09:44
Respuesta: Re: Npcs - by CTCCoco - 22.06.2011, 09:48
Re: Npcs - by Eirikm - 22.06.2011, 13:42
Re: Npcs - by PCheriyan007 - 22.06.2011, 16:16

Forum Jump:


Users browsing this thread: 3 Guest(s)