SA-MP Forums Archive
[Ajuda] NPC nao conecta - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] NPC nao conecta (/showthread.php?tid=448964)



NPC nao conecta - TheKoDaK - 06.07.2013

Bom galera eu criei um npc pro meu server mais pois ele nao quer conectar.

eu nao sei se eu fiz algo de errado olhe so os codigos:

pawn Код:
#define RECORDING "teste"
#define RECORDING_TYPE 1

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();
#else
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
pawn Код:
public OnGameModeInit()
{
    ConnectNPC("teste", "teste");
    return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) PutPlayerInVehicle(playerid, vehiclebot, 0);
    return 1;
}
sera que voces poderiam me ajudar ?


Re: NPC nao conecta - [THs]ShadoW - 06.07.2013

Quote:
Originally Posted by TheKoDaK
Посмотреть сообщение
Bom galera eu criei um npc pro meu server mais pois ele nao quer conectar.

eu nao sei se eu fiz algo de errado olhe so os codigos:

pawn Код:
#define RECORDING "teste"
#define RECORDING_TYPE 1

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();
#else
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
pawn Код:
public OnGameModeInit()
{
    ConnectNPC("teste", "teste");
    return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) PutPlayerInVehicle(playerid, vehiclebot, 0);
    return 1;
}
sera que voces poderiam me ajudar ?
Tente assim:

pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) SpawnPlayer(playerid);
    return 1;
}
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) PutPlayerInVehicle(playerid, vehiclebot, 0);
    return 1;
}



Re: NPC nao conecta - TheKoDaK - 06.07.2013

Ainda nao conectou


Re: NPC nao conecta - [THs]ShadoW - 06.07.2013

Quote:
Originally Posted by TheKoDaK
Посмотреть сообщение
Ainda nao conectou
Mas aparece o "Incoming Conection" no Console ?


Re: NPC nao conecta - TheKoDaK - 06.07.2013

Sim aparece mais o NPC nao aparece


Re: NPC nao conecta - [THs]ShadoW - 06.07.2013

Quote:
Originally Posted by TheKoDaK
Посмотреть сообщение
Sim aparece mais o NPC nao aparece
Tem certeza ? Vocк tem um comando /ir no seu GM ? Quando vocк loga, qual й o SEU ID ?

O certo seria aparecer isso aqui no Console:

Код:
[HH:MM:SS] Incoming connection: IP
[HH:MM:SS] [npc:join] Teste has joined the server (IP)
Й isso que aparece ?


Re: NPC nao conecta - TheKoDaK - 06.07.2013

Nao isso ae n aparece so aparece
Код:
Incoming Connection: ip
e o comando /ir eu tenho sim


Re: NPC nao conecta - [THs]ShadoW - 06.07.2013

Quote:
Originally Posted by TheKoDaK
Посмотреть сообщение
Nao isso ae n aparece so aparece
Код:
Incoming Connection: ip
e o comando /ir eu tenho sim
Tente:

Код:
public OnPlayerConnect(playerid)
{
	if(IsPlayerNPC(playerid))
	{
	    SpawnPlayer(playerid);
 		new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "teste", true))
        {
		    SpawnPlayer(playerid);
		    PutPlayerInVehicle(playerid, vehiclebot, 0);
                    return 1;
	}
        return 1;
}
Se nгo der eu realmente nгo sei, mas deve ser algo que estб impedindo ele de logar, como um sistema de Login, etc.

Tente colocar "if(IsPlayerNPC(playerid)) return 1;" no inнcio de todas as Publics que usam "playerid", se mesmo assim nгo der eu nгo sei como te ajudar :/


Re: NPC nao conecta - FelipeAMC - 06.07.2013

Ve se no server.cfg o maxnpc estб 0, se tiver ponha 1 ou mais.


Re: NPC nao conecta - TheKoDaK - 07.07.2013

Quote:
Originally Posted by FelipeAMC
Посмотреть сообщение
Ve se no server.cfg o maxnpc estб 0, se tiver ponha 1 ou mais.
era isso ae mesmo valeu mano