Bots problem !!!
#1

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:
Код:
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;
}
Код:
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:
Код:
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?
Reply
#2

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.
Reply
#3

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?
Reply
#4

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

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)