How do I set a BOT's skin and give him a weapon?
#1

Hello.
I got all my bots working now but, after looking up how to give my bots a weapon or change hes skin i didn't find anything.
Could anyone please show me how it's done?
Thanks.

P.S - If there's already a post about this i'm sorry.I haven't fully checked the forums.
Reply
#2

Read the tutorial on how to create an NPC. It's simple to figure out, just read carefully.
Reply
#3

Wait...so I need to create a new variable?
ex:
new botweapon;
new botskin;

botweapon = GivePlayerWeapon(playerid, 1, 1000);
botskin = Setplayerskin(playerid, 162);

Then use it on the playerspawn?

If i'm wrong can you please tell me where in the tutorial is that thanks.
Reply
#4

you don't need the new botweapon and new botskin.
Just the:
pawn Код:
GivePlayerWeapon(playerid, 1, 1000);
Setplayerskin(playerid, 162);
Reply
#5

Yeah, just place those lines anywhere which is called in the NPC script

So, let's say you put the lines which give the bot a weapon under the callback for when it's spawned, it will just give it to them

Another alternative is that your bot script somehow calls a function in another script which gives whichever playerid that calls it the weapon


Reply
#6

Something like
pawn Код:
public OnPlayerSpawn(playerid)
{
  if(IsNPC(playerid))
  {
   GivePlayerWeapon(playerid, XX, XX);
   SetPlayerSkin(playerid, XX);
  }
  return 1;
}
Reply
#7

I Have made it to set the bots skin but i'm still having problems with the guns.
I placed the giveweapon code in the bots it compiles and runs in server.
Sorry to ask all this questions but,
Are they supposed to appear with the weapon holded?
Or not?
If its not supposed to appear how do i make them hold the weapon?
I've seen it in a server.
Reply
#8

Ok guy i was wrong about the Weapons it works.
I think it only doesnt work with a chainsaw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)