[Ajuda] NPC nгo Loga
#1

Olб a todos,
Desde jб agradeзo a todos por tentar ajudar.

O meu problema й o BOT que nгo entra no servidor, nгo chega nem a logar.
Eu coloquei ele em FilterScript em vez de colocar no GM

FilterScript:

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <a_npc>
#if defined FILTERSCRIPT

new OnFilterScriptInit; //Variavel globalpublic OnFilterScriptInit()
{
    print("Bot Onibus");
    ConnectNPC("BotOnibusNPC","botonibus");
    MeuPrimeiroNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    ConnectNPC("Cesar_Xavier","botonibus"
    return 1;
}
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
}
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Verifica se o jogador й um NPC.
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname)); //Obtendo o nome do(s) NPC(s).
        if(!strcmp(npcname, "BotOnibusNPC", true)) //Checando se o nome do NPC й MeuPrimeiroNPC
        {
            PutPlayerInVehicle(playerid, BotOnibusNPCVehicle, 0); //Colocar o NPC dentro do veнculo que criamos para isso.
        }    return 1;
    }  //Outras coisas para os jogadores normais vai aqui!
    return 1;
}
#endif
FilterScript em NPCMode:

pawn Код:
#define RECORDING "botonibus" //Este й o nome do seu arquivo de gravaзгo, sem a extenзгo(.rec).
#define RECORDING_TYPE 1 //1 para gravaзхes em veнculo e 2 para gravaзхes apй.
#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

Pronto, tenho o botonibus.rec claro

Obrigado desde jб.
Reply
#2

Coloque no server.cfg maxnpcs para a quantidade de npcs que vocк utiliza.

e tire
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
}
Reply
#3

Olб Victor'
Obrigado desde jб, mas infelizmente continua igual.
Reply
#4

Arrumei o seu FS :


pawn Код:
#include <a_samp>


public BotOnibusNPCVehicle;


public OnFilterScriptInit()
{
    print("Bot Onibus");
    BotOnibusNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
    ConnectNPC("BotOnibusNPC", "botonibus");
    return 1;
}


public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "BotOnibusNPC"))
        {
            PutPlayerInVehicle(playerid, BotOnibusNPCVehicle, 0);
        }
    }
    return 1;
}


Espero ter ajudado .
Reply
#5

Obrigado desde jб rjjj
Mas ainda nгo funciona
Obrigado mesmo assim.
Reply
#6

pawn Код:
#define RECORDING_TYPE 2
e compile na pasta npcmodes e o fs tente carregar depois do servidor iniciar
Reply
#7

Quote:
Originally Posted by Victor'
Посмотреть сообщение
pawn Код:
#define RECORDING_TYPE 2
e compile na pasta npcmodes e o fs tente carregar depois do servidor iniciar
Victor mas meu BOT й com um Уnibus se puser #define RECORDING_TYPE 2 estou a definir se ele fosse apй.
Reply
#8

Compilou o cуdigo do .rec, correto?


@Aconselho a usar em seu prуprio GM...
Reply
#9

vc tem registro ou login no seu gm?
poe
pawn Код:
if(IsPlayerNPC(playerid) return 1;
no comeco do OnPlayerConnect do seu gm e nao do fs .
Reply
#10

Obrigado a todos pela ajuda
Jб esta funcionando

Atй б prуxima e obrigado novamente
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)