Problema con NPC
#1

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:
Reply
#2

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.
Reply
#3

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

PD: Yo aъn no logro entrar NPC xD
Reply
#4

prueba que no tenga maxnpc en 0
Reply
#5

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
Reply
#6

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

Gracias tincho, ahora me anda +reep

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

Fijate usando SetPlayerColor.
De nada.
Reply
#9

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
Reply
#10

Listo de nada!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)