How can I set up bots inside any interior?
#1

Hey! I got a few problems, hope you can help me :
1) - How can i set a virtual world for a specific bot?
2) - How can i set an interior for a specific bot?
3) - I recorder my self walking as a skin num 111, but when I test it on my server, I see a CJ walking. Why?
4) - I can't see the animations I recorded for my bots, why?

Can anyone help me please? thank you.
Reply
#2

Use the same functions as with other players: SetPlayerSkin, SetPlayerInterior etc.
Reply
#3

Quote:
Originally Posted by tomnidi
Hey! I got a few problems, hope you can help me :
1) - How can i set a virtual world for a specific bot?
2) - How can i set an interior for a specific bot?
3) - I recorder my self walking as a skin num 111, but when I test it on my server, I see a CJ walking. Why?
4) - I can't see the animations I recorded for my bots, why?

Can anyone help me please? thank you.
1) SetPlayerVirtualWorld
2) SetPlayerInterior
3)SetPlayerSkin
4)Leave your server and go in again, if it don't work reload the bot
Reply
#4

Quote:
Originally Posted by (ed!med!
Quote:
Originally Posted by tomnidi
Hey! I got a few problems, hope you can help me :
1) - How can i set a virtual world for a specific bot?
2) - How can i set an interior for a specific bot?
3) - I recorder my self walking as a skin num 111, but when I test it on my server, I see a CJ walking. Why?
4) - I can't see the animations I recorded for my bots, why?

Can anyone help me please? thank you.
1) SetPlayerVirtualWorld
2) SetPlayerInterior
3)SetPlayerSkin
4)Leave your server and go in again, if it don't work reload the bot
So I can code that OnFilterScriptInit will be (SetPlayerSkin(0,111) ??
And It still doesn' show the bots animations..
Someone?
Reply
#5

Quote:
Originally Posted by tomnidi
So I can code that OnFilterScriptInit will be (SetPlayerSkin(0,111) ??
No. Like this:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        SetPlayerSkin(playerid, 111);
    }
    return 1;
}
Reply
#6

Meh, you do that in the "OnPlayerSpawn"

Here an example:

pawn Код:
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "Bot1337", true)) // Name of your bot
    {
      SetPlayerSkin(playerid, 111);
      SetPlayerVirtualWorld(playerid, 2);
      SetPlayerInterior(playerid, 45353241);
    }
    return 1;
  }

  return 1;
Edit: Aww, MadeMan was faster^^
Reply
#7

Quote:
Originally Posted by (ed!med!
Meh, you do that in the "OnPlayerSpawn"

Here an example:

pawn Код:
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "Bot1337", true)) // Name of your bot
    {
      SetPlayerSkin(playerid, 111);
      SetPlayerVirtualWorld(playerid, 2);
      SetPlayerInterior(playerid, 45353241);
    }
    return 1;
  }

  return 1;
Edit: Aww, MadeMan was faster^^
Alright, thx I'll try it..
But there is no names for my bots IG, is that matter?
And what about the bot's animations? Why doesn't it work?
Reply
#8

Ehm i don't know what "IG" means but anyway. Your bot have a name.
Example:

(Under OnFilterScriptInt)
ConnectNPC("Speedy_Gonzales","Bot1337record"); // Speedy_Gonzales is the Botname, Bot1337record is the record(under npcrecords)

That is the name from the bot if i understood what you mean.

_______

I had the same problem with the animations... i did nothing about it, it should work after some time. I don't know what the problem was, it could be restart or whatever.
Reply
#9

Alright, I tried it but it still doesn't work:

Under my OnGameModeInit:
ConnectNPC("FirstBot_FirstBot","JailGuy");
ConnectNPC("SecondBot_SecondBot","Test");

And:


Код:
public OnPlayerSpawn(playerid)
{
  //if(IsPlayerNPC(playerid)) return 1;
  if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "FirstBot_FirstBot", true)) // Name of your bot
    {
      SetPlayerSkin(playerid, 62);
      SetPlayerVirtualWorld(playerid, 2);
      SetPlayerInterior(playerid, 6);
    }
    else if(!strcmp(npcname, "SecondBot_SecondBot", true)) // Name of your bot
    {
      SetPlayerSkin(playerid, 111);
      SetPlayerVirtualWorld(playerid, 0);
      SetPlayerInterior(playerid, 0);
    }
    return 1;
  }
	if(gPlayerLogged[playerid])
	{
		  SetPlayerSpawn(playerid);
		  Spawned[playerid] = 1;
	}
	return 1;
}
Still doesn't work for me, Do you know why?
Reply
#10

ConnectNPC(name[], script[]);
Quote:

name[] The NPC name.
script[] The NPC scriptname that is located in the npcmodes folder.

NPC script, not record.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)