habi

  • Sr. Member
  • Posts: 400
create bots with this plugin
« on May 11th, 2020, 01:49 PM »Last edited on June 21st, 2020, 10:50 AM
This is a squirrel plugin to create bots in the server.
Quote
Download plugins

actor32.dll

actor64.dll

Installation  ( very easy )

Copy the actor64.dll into plugins folder. Open server.cfg find the line plugins, add 'actor64' to the last. see pic below



Functions
Only two functions now,
create_actor(name, skinId, x, y, z, angle), set_actor_angle

Examples
Code: [Select]
function onScriptLoad()
{
create_actor( "medic", 5, -656, 756, 11.2, 1.5 );  //5 == ambulance man
create_actor( "emma", 65, -660, 758, 11.2, -1.5 ); 
}

create_actor("john");

create_actor("kevin",5); will spawn a medic with name 'kevin'

create_actor("Edward",1,-656,756,11.2,0); will spawn a cop at downtown facing north.

setport("8193"); ( in case your port is not 8192, but 8193 );

Notes
1. actorid and playerid are different.
2. create_actor returns an integer which is 0 for 1st bot, 1 for 2nd bot and so on. We can call it actor id. 
3. create_actor function will take a little time to create bots.
4. If your server has registration system, you must add the bots name to database. Otherwise the bots cannot spawn.

For detailed documentation, see click Source code below and view readme file.

Note: This project was built with Visual Studio 2019.           Source code


Linux Version

64 bit  actor64.so

32 bit  actor32.so

Source code

Functions are same except set_port. The parameter inside set_port must be integer. eg. set_port( 8193 ). Default is 8192.

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 807
Re: create bots with this plugin
« Reply #2, on May 11th, 2020, 02:45 PM »Last edited on May 11th, 2020, 02:51 PM
perfection implemented feels like samp bots but with no anims, Finally vcmp is somewhat going towards implementation of bots, nice work habi
Re: create bots with this plugin
« Reply #3, on May 11th, 2020, 03:33 PM »
@habi when anims? or any procedure to make them do anything as we want such as performing a drift on a track which makes bot do it repeatedly such as loop?, would be a greate feature ik its too early to ask but was a great possibility in nodejs :)..Good luck

habi

  • Sr. Member
  • Posts: 400
Re: create bots with this plugin
« Reply #4, on May 11th, 2020, 03:46 PM »
i think anims already there  megamind. These actors are actually players. Just do player.SetAnim

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,201
Re: create bots with this plugin
« Reply #6, on May 11th, 2020, 04:06 PM »Last edited on May 11th, 2020, 04:11 PM




Yep, they work indeed.
Looks great, @habi !

PS: Now it is posible to make some good looking videos

habi

  • Sr. Member
  • Posts: 400

Eva

  • Full Member
  • Posts: 167
Re: create bots with this plugin
« Reply #8, on May 11th, 2020, 05:27 PM »
How does this work? i have it so far the actor connects but then it times out and my console spammed :D

habi

  • Sr. Member
  • Posts: 400

Eva

  • Full Member
  • Posts: 167
Re: create bots with this plugin
« Reply #10, on May 11th, 2020, 06:29 PM »Last edited on May 11th, 2020, 06:32 PM
i did set_port("2005");
then create_actor("Edward",1,-656,756,11.2,0);


habi

  • Sr. Member
  • Posts: 400
Re: create bots with this plugin
« Reply #11, on May 11th, 2020, 06:41 PM »
Oh. there is a case I avoided, because of some reasons. Your server is pushing this case. Try on blank server for time being.

Razor.

  • Full Member
  • Posts: 101

Alpays

  • Newbie
  • Posts: 32
Re: create bots with this plugin
« Reply #13, on May 12th, 2020, 01:01 PM »
Quote from Eva on May 11th, 2020, 06:29 PM
i did set_port("2005");
then create_actor("Edward",1,-656,756,11.2,0);

Happened to me moved store folder and fixed but Bot didnt spawned deleted some of my codes and bot spawned

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 807
Re: create bots with this plugin
« Reply #14, on May 12th, 2020, 02:39 PM »
Quote from Alpays on May 12th, 2020, 01:01 PM
Quote from Eva on May 11th, 2020, 06:29 PM
i did set_port("2005");
then create_actor("Edward",1,-656,756,11.2,0);

Happened to me moved store folder and fixed but Bot didnt spawned deleted some of my codes and bot spawned
Idk where and what your guy are trying to do but for a basic server or ur server why not try using
Code: [Select]
//commands
case "npc":
{
        create_actor("Edward",45,-656,756,11.2,0);
        set_port("5192");
FindPlayer(1).SetAnim(0,2);
}
        break;
first create the actor then set ports and do whatever u like well this works for me