Train Bot problem.
#1

Hello !

Well I have a little problem with my Train bot.
First of all, he crash when he's connecting. That's all. That's the problem.

The thing is.... How can I fix it ?
Yes the OnGameModeInit and OnPlayerSpawn are set up, and I use AddStaticVehicleEx, not CreateVehicle.
And yes the record is OK

Thank you for helping !
Reply
#2

Usually bots don't connect because of a firewall
Reply
#3

But the others can connect.
Reply
#4

Hmm paste all your bots script, Im out in a second for 2 hours but when im back i will take a look
Reply
#5

Okat so the problem is half solved.
The bot still crash.

The train spawn, but there is 2 of them spawning.... Dunno why.

I need some help me.
Reply
#6

Post the NPC script.
Reply
#7

pawn Код:
forward createNpc();
forward create_Train(id);
pawn Код:
new VTrain01;
OnGameModeInit :
pawn Код:
VTrain01 = AddStaticVehicleEx(538, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
OnPlayerSpawn :
pawn Код:
else if(!strcmp(playername,"Train_01",true))
        { //Agent Fbi protection
            print("[Npc] Initialisation - Train 01");
            SetPlayerSkin(playerid,255);
            engineOn[1] = true;
            car_Engine(1);
            PutPlayerInVehicle(playerid, VTrain01, 0);
            GetVehicleParamsEx(538,engine,lights,alarm,doors,bonnet,boot,objective);
            SetCarChange(1,engine,1,alarm,doors,bonnet,boot,objective);
        }

createNpc :
pawn Код:
ConnectNPC("Train_01","train");
create_Train(1);

public create_Train(id) :
pawn Код:
{
    new botname[64];
    format(botname,sizeof(botname),"Train_%d",id);
    ConnectNPC(botname,"train");
    id++;
    if(id < 7)
    {
        SetTimerEx("create_Train", 124000, false, "d", id);
    }
}
Reply
#8

Little up, still need some help please.
Reply
#9

Follow this tutorial <[Tutorial] Creating a new NPC by kc. If you have registration system, return true to prevent NPC from register part, Most of the times, your antivirus/firewall request you from allowing these NPCs connect to the server, for example on localhost, so you should allow them. Last, makes sure you have moved the .rec and the miniscript to the correct folders.
Reply
#10

Exactly the SAME PROBLEM even when I use this tutorial.
The train npc crash, and the train spawned.

Even when I use
pawn Код:
if(IsPlayerNPC(playerid))
    {
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)