I've got a problem with bots please help!!! :( - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I've got a problem with bots please help!!! :( (
/showthread.php?tid=121971)
I've got a problem with bots please help!!! :( -
stieben - 19.01.2010
Hello,
I have 2 bots on my server. The first bot shows up and works fine. The second bot doesn't. What these bots do is they drive around San Fierro in a bus. When I connect to my server I spawn inside the second bus at the farm of blueberry
I really don't know how to fix this so I am posting the commandlines here:
On Top
Код:
new Text3D:BusLine1;
new Text3D:BusLine2;
new MyFirstNPCVehicle;
new MySecondNPCVehicle;
OnGameModeInIt
Код:
ConnectNPC("SanFierroBus1","SanFierroBus1");
ConnectNPC("SanFierroBus2","SanFierroBus2");
MyFirstNPCVehicle = CreateVehicle(437, 0.0, 0.0, 5.0, 0.0, 16, 83, 5000);
MySecondNPCVehicle = CreateVehicle(437, 0.0, 0.0, 5.0, 0.0, 16, 83, 5000);
OnPlayerConnect
Код:
BusLine1 = Create3DTextLabel("[BUS] Line 1",0xFFFFFFFF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToVehicle(Text3D:BusLine1, MyFirstNPCVehicle, 0.0, 0.0, 1.0);
BusLine2 = Create3DTextLabel("[BUS] Line 2",0xFFFFFFFF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToVehicle(Text3D:BusLine2, MySecondNPCVehicle, 0.0, 0.0, 1.0);
OnPlayerDisconnect
Код:
Delete3DTextLabel(BusLine1);
Delete3DTextLabel(BusLine2);
OnPlayerSpawn
Код:
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, "SanFierroBus1", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
new npcname[MAX_PLAYER_NAME];
if(!strcmp(npcname, "SanFierroBus2", true))
{
PutPlayerInVehicle(playerid, MySecondNPCVehicle, 0);
return 1;
}
SetPlayerPos(playerid, -2069.225,-88.073,35.647);
Please Someone help me

I am really stuck here
Thank you
Re: I've got a problem with bots please help!!! :( -
GTAguillaume - 19.01.2010
Код:
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, "SanFierroBus1", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
if(!strcmp(npcname, "SanFierroBus2", true))
{
PutPlayerInVehicle(playerid, MySecondNPCVehicle, 0);
return 1;
}
return 1;
}
Re: I've got a problem with bots please help!!! :( -
actiwe - 19.01.2010
pawn Код:
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, "SanFierroBus1", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
if(!strcmp(npcname, "SanFierroBus2", true))
{
PutPlayerInVehicle(playerid, MySecondNPCVehicle, 0);
return 1;
}
This should do it
Re: I've got a problem with bots please help!!! :( -
stieben - 19.01.2010
THANKS!!