[Solved] Bots Randomly Leaves Vehicle..
#1

Hey,
I got some problems with my bots.. When I start server bots work perfectly.. But after 10-15 minutes all bots leaves their vehicles and just stands on vehicle.. I have no idea what's wrong, so I have this timer to check if bots are not in vehicle:
pawn Код:
//OnGameModeInit
SetTimer("CheckNPCs",6000,1);
//

forward CheckNPCs();
public CheckNPCs()
{
    new bname[24];
    foreach(Bot,i)
    {
        GetPlayerName(i,bname,sizeof(bname));
        if(!IsPlayerInAnyVehicle(i))
        {
            if(!strcmp(bname,"Jenifer"))
            {
                PutPlayerInVehicle(i,TrainSF,0);
            }
            if(!strcmp(bname,"Mike"))
            {
                PutPlayerInVehicle(i,TrainSF2,0);
            }
            if(!strcmp(bname,"Dima"))
            {
                PutPlayerInVehicle(i,TrainSF3,0);
            }
            if(!strcmp(bname,"Vince"))
            {
                PutPlayerInVehicle(i,TrainSF4,0);
            }
            if(!strcmp(bname,"Jonas"))
            {
                PutPlayerInVehicle(i,BusAP,0);
            }
            if(!strcmp(bname,"Malcolm"))
            {
                PutPlayerInVehicle(i,BusAP2,0);
            }
            if(!strcmp(bname,"Phillip"))
            {
                PutPlayerInVehicle(i,BusAP3,0);
            }
            if(!strcmp(bname,"Patrick"))
            {
                PutPlayerInVehicle(i,RacetrackBoat,0);
            }
        }
    }
}
But when I tried playing in my server, with this code working, bots still stopped working after 10-15 minutes.. And they didn't got back to their vehicle...
Here's an example of one NPC script:
pawn Код:
#define RECORDING "TrainFromSFw" //Train which is in SF at start
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd()
{
    StartRecordingPlayback(RECORDING_TYPE, RECORDING);
}
public OnNPCEnterVehicle(vehicleid, seatid)
{
    StartRecordingPlayback(RECORDING_TYPE, RECORDING);
}
public OnNPCExitVehicle()
{
    StartRecordingPlayback(RECORDING_TYPE, RECORDING);
}
Reply
#2

bump..
4th page, no replies and this is a little.. urgent..
Reply
#3

Did you make createvehicle for them or addstaticvehicle ?
Reply
#4

Quote:
Originally Posted by boelie
Did you make createvehicle for them or addstaticvehicle ?
AddStaticVehicle.. But I don't think something is wrong with vehicles, cause they work for like 10-20mins.. :P
Reply
#5

I got the same problem ...

...does anyone knows how to fix this?
Reply
#6

Now we're two having the same problem.. But if somebody didn't understood, I'm asking why that function (posted in 1st post) doesn't work?
Reply
#7

First your identation...:S
Try CreateVehicle Instead of AddStaticVehicle
Reply
#8

Quote:
Originally Posted by Oxside
First your identation...:S
Try CreateVehicle Instead of AddStaticVehicle
Ok.. I will try if you think it helps me..

It didn't helped, but I just started my server without any FS.. Everything works.. So that means ther is a problem with my FSs.. I'll find solution myself.. Thanks for help..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)