[AJUDA] NPC nгo spawna!!!
#1

Entгo, estou tentando criar um NPC de taxi, mais o NPC nгo da spawn no inicio da gravaзгo, conecta e tals, tudo normal, mais fica no spawn do servidor, os arquivos de gravaзгo, estгo tudo corretamente nas pastas ._. se puderem me dar um help, eu agradeзo, vlw XD.

Code ae:
pawn Код:
new SpawnVeiculoTaxista;
pawn Код:
public OnGameModeInit()
{
    print("meu gamemode");
    ConnectNPC("Taxista","taxista");
    SpawnVeiculoTaxista = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "taxista", true))
    {
      PutPlayerInVehicle(playerid, SpawnVeiculoTaxista, 0);
    }
    return 1;
  }
Reply
#2

pawn Код:
public OnGameModeInit()
{
    print("meu gamemode");
    ConnectNPC("Taxista","taxista");
    SpawnVeiculoTaxista = AddStaticVehicle(420, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    return 1;
}
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, "taxista", true)) //Checking if the NPC's name is taxista
        {
            PutPlayerInVehicle(playerid, SpawnVeiculoTaxista, 0); //Putting the NPC into the vehicle we created for it.
            return 1;
        }
    }
    return 1;
}
Reply
#3

next time, use this http://forum.sa-mp.com/forumdisplay.php?f=33
Reply
#4

Quote:
Originally Posted by =WoR=G4M3Ov3r
Посмотреть сообщение
Haha yeah lol, I did not understood his Language, But i just understood that his code is wrong.
Reply
#5

Sorry my friends.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)