SA-MP Forums Archive
Problema con NPC - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Problema con NPC (/showthread.php?tid=312134)



Problema con NPC - [Nikk] - 20.01.2012

Hola gente, hoy me quise poner los npc que vienen con samp, el problema es que el NPC, entra y spawnea pero no entra al vehiculo, solo spawnea y se queda ahi D:.


Nose lo que pasa, aca todo de los npc, que son 3.


pawn Код:
new AutoNPC;
new AutoNPC2;
new AutoNPC3;

public OnGameModeInit()
{
    //hostname etc,
    AutoNPC = Vehicle_AddStatic(537, 1467.0, 975.0, 11.0, 0.0, random(0), random(161), 600);
    AutoNPC2 = Vehicle_AddStatic(538, 1467.0, 975.0, 11.0, 0.0, random(0), random(161), 600); // DFT-30
    AutoNPC3 = Vehicle_AddStatic(537, 1467.0, 975.0, 11.0, 0.0, random(0), random(161), 600); // DFT-30

    ConnectNPC("MyFirstNPC","train_ls");
    ConnectNPC("MyFirstNPC2","train_sf");
    ConnectNPC("MyFirstNPC3","train_lv");
    //resto de la callback
}


public OnPlayerSpawn(playerid)
{
    // Always allow NPC's to spawn without logging in
    if (IsPlayerNPC(playerid))
        return 1;
    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, AutoNPC, 0); //Putting the NPC into the vehicle we created for it.
      return 1;
    }
    if(!strcmp(npcname, "MyFirstNPC2", true))
    {
      PutPlayerInVehicle(playerid, AutoNPC2, 0);
      return 1;
    }
     if(!strcmp(npcname, "MyFirstNPC3", true))
    {
      PutPlayerInVehicle(playerid, AutoNPC3, 0);
      return 1;
    }
    return 1;
  }
//resto de la callback

Alguien sabe por que ?, quiero poner los npc de de train_ls, train_lv, train_sf pero quedan parados en el spawn D:


Re: Problema con NPC - Geer - 20.01.2012

Si supiera te ayudaria soy nuevo en el foro y en esto de crear servers disculpa (No es de sobrador) es para que veas que alguien te intenta ayudar.


Respuesta: Problema con NPC - TiNcH010 - 20.01.2012

Por que en vez de Vehicle_AddStatic no usas AddStaticVehicle?
Proba :P

PD: Yo aъn no logro entrar NPC xD


Respuesta: Problema con NPC - Jovanny - 20.01.2012

prueba que no tenga maxnpc en 0


Respuesta: Problema con NPC - [Nikk] - 20.01.2012

Tincho, uso asi, por que tengo un sistema de gasolina, y si uso addstaticvehicle el vehiculo no tiene gasolina :/.
Y Jovanny, si no esta en 0


Respuesta: Problema con NPC - TiNcH010 - 20.01.2012

Proba poniendo lo mismo que hiciste en OnPlayerSpawn pero en OnPlayerConnect.
Yo lo tenнa en ambos y me funcaba de 10.


Respuesta: Problema con NPC - [Nikk] - 20.01.2012

Gracias tincho, ahora me anda +reep

Pero tengo otra duda, como les cambio el color qque le aparece sobre el radar ?


Respuesta: Problema con NPC - TiNcH010 - 20.01.2012

Fijate usando SetPlayerColor.
De nada.


Respuesta: Problema con NPC - [Nikk] - 20.01.2012

Joya, lo puse en el
pawn Код:
if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, AutoNPC, 0); //Putting the NPC into the vehicle we created for it.
      SetPlayerColor(playerid, 0xFFFFFF55);//aksndakdasd
      return 1;
     
    }
Gracias, todo me nada perfect


Respuesta: Problema con NPC - TiNcH010 - 20.01.2012

Listo de nada!