SA-MP Forums Archive
[AJUDA] NPC nгo spawna!!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [AJUDA] NPC nгo spawna!!! (/showthread.php?tid=284475)



[AJUDA] NPC nгo spawna!!! - ldsgui - 19.09.2011

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;
  }



Re: [AJUDA] NPC nгo spawna!!! - Davz*|*Criss - 19.09.2011

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;
}



Re: [AJUDA] NPC nгo spawna!!! - =WoR=G4M3Ov3r - 19.09.2011

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


Re: [AJUDA] NPC nгo spawna!!! - Davz*|*Criss - 19.09.2011

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


Re: [AJUDA] NPC nгo spawna!!! - ldsgui - 19.09.2011

Sorry my friends.