create bots with this plugin

Started by habi, May 11, 2020, 12:49 PM

Previous topic - Next topic

habi

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
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.

habi

The bots will have ping 1 or 2.

MEGAMIND

#2
perfection implemented feels like samp bots but with no anims, Finally vcmp is somewhat going towards implementation of bots, nice work habi

MEGAMIND

@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

i think anims already there  megamind. These actors are actually players. Just do player.SetAnim


Sebastian

#6




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

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

habi

QuoteYep, they work indeed.
Looks great, @habi !
Thanks, mate

Eva

How does this work? i have it so far the actor connects but then it times out and my console spammed :D

habi

#9
Quote from: Eva on May 11, 2020, 04:27 PMHow does this work? i have it so far the actor connects but then it times out and my console spammed
Eva, post a screenshot

Eva

#10
i did set_port("2005");
then create_actor("Edward",1,-656,756,11.2,0);


habi

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.


Alpays

Quote from: Eva on May 11, 2020, 05:29 PMi 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

Quote from: Alpays on May 12, 2020, 12:01 PM
Quote from: Eva on May 11, 2020, 05:29 PMi 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
//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