SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 01/11/2009, 03:34 PM   #1
Raul_Ro
Big Clucker
 
Join Date: Oct 2009
Location: Romania
Posts: 80
Reputation: 3
Default Bots problem !!!

We created a BOT, but ... does not work.
I did it:
I registered and then I put everything into place and then I wrote the following in GM:
Code:
public OnPlayerSpawn(playerid)
{
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, "aa", true)) //Checking if the NPC's name is Correct
    {
      SetPlayerSkin(playerid, 264);
    }
    return 1;
  }
	return 1;
}
Code:
public OnGameModeInit()
{
  ConnectNPC("aaaa","aa");
  return 1;
}
I gave compile and entered the server.
NPC's and it's connected but .... not do what made me do. why is it?
case is that I and this:
Code:
public OnPlayerSpawn(playerid)
{
SetPlayerRandomSpawn(playerid);
return 1;
}
?
Is it for me the player spawn-booking to start in several places, and the bot can not get where they start working?
If so .... can resolve to go to my server and bots?
Raul_Ro is offline  
Old 01/11/2009, 03:53 PM   #2
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,621
Reputation: 11
Default Re: Bots problem !!!

Read the Creating a NPC tutorial again.
You did not create a vehicle for bot, so you have to CreateVehicle(Ex) / AddStaticVehicle(Ex) and put NPC in that vehicle.
Luka P. is offline  
Old 01/11/2009, 04:11 PM   #3
Raul_Ro
Big Clucker
 
Join Date: Oct 2009
Location: Romania
Posts: 80
Reputation: 3
Default Re: Bots problem !!!

Quote:
Originally Posted by LukaÖ
Read the Creating a NPC tutorial again.
You did not create a vehicle for bot, so you have to CreateVehicle(Ex) / AddStaticVehicle(Ex) and put NPC in that vehicle.
What Car? I put no car. ie I used /ofrecord not /vrecord !
Another solution?
Raul_Ro is offline  
Old 01/11/2009, 11:12 PM   #4
Jefff
High-roller
 
Join Date: Dec 2007
Posts: 1,748
Reputation: 138
Default Re: Bots problem !!!

ConnectNPC("aaaa","aa");
bot name
if(!strcmp(npcname, "aa", true)) //Checking if the NPC's name is Correct
{
SetPlayerSkin(playerid, 264);
}
should be "aaaa"

Jefff is online now  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I've got a problem with bots please help!!! :( stieben Help Archive 3 19/01/2010 06:01 PM
Problem With my bots GforceNL Help Archive 4 03/12/2009 09:27 AM
Bots spawn problem wormy Help Archive 4 22/10/2009 12:36 PM
If I use BOTS in a Godfather server I must create an account to all bots? CTCCoco Help Archive 9 02/09/2009 07:53 PM
IRC problem, bots repeating... Outbreak Help Archive 3 04/08/2009 05:47 AM


All times are GMT. The time now is 03:02 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.