How to script with bots?
#1

Hello, I was wondering how I script using bots, I kind of know the basics as I have read KC's tutorial but I want to go further and discover a lot more, I just don't know what to do and what to use.

It would be really good if someone could tell me what to do if I was to create a bot with these features:
- Stops in one place until someone has entered the bot's car - I think I have figured that one out TogglePlayerControllable();?
- Showing a dialog as soon as the player is inside of the bot's car - I know what to do there.
- Making the bot go to different locations depending on what the player chooses within the shown dialog - This is what I want to know.

Any help is highly appreciated.
Regards, Luis.
Reply
#2

You can make a bot do different recordings. Then, from within your server, you can tell the bot to playback whichever recording. What I did for something like this was SendClientMessage to whatever bot and then under the OnClientMessage in your NPC script, you can do whatever.
Reply
#3

Sorry, Could you possibly explain it a little easier?
Reply
#4

this should help you.
https://sampwiki.blast.hk/wiki/NPC:Main_Page
Reply
#5

I have actually read through that once but I still don't really know us to use the "npc pawn script".
Reply
#6

I would use something like CNPC for this, although never to use the CreateNPCPlayer.


"Player NPC's violate the TOS."
Reply
#7

I am sure I could do this if I knew how to use the stand alone script which is used for bots.
Reply
#8

You will have to record all routes you want the bot to take, and then make it play when their selected.
Reply
#9

Yes but what functions shall I use?
Reply
#10

Quote:
Originally Posted by -Luis
Посмотреть сообщение
Yes but what functions shall I use?
https://sampforum.blast.hk/showthread.php?tid=95034
Reply
#11

As I have state above I have already looked through this, I need to know how I can actually make the bot change routes when I tell it to.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)