Bots Buy Extra Items

Unpaid Requests, Public Plugins
Post Reply
InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

Bots Buy Extra Items

#1

Post by InsertSK » 2 Months Ago

Please any plugin on bots buy extra item or Force_buy please ? ZP

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 422
Joined: 3 Years Ago
Location: Morocco
Has thanked: 141 times
Been thanked: 48 times
Age: 20
Contact:

#2

Post by z0h1r-LK » 1 Month Ago

What do you mean?
These users thanked the author z0h1r-LK for the post:
InsertSK (1 Month Ago)

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#3

Post by InsertSK » 1 Month Ago

Z0uha1r_LK wrote:
1 Month Ago
What do you mean?
Any plugin where bots will be able to buy extra items

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 422
Joined: 3 Years Ago
Location: Morocco
Has thanked: 141 times
Been thanked: 48 times
Age: 20
Contact:

#4

Post by z0h1r-LK » 1 Month Ago

Tell me, Why you want make Bots bought Extra Items?

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#5

Post by InsertSK » 1 Month Ago

Z0uha1r_LK wrote:
1 Month Ago
Tell me, Why you want make Bots bought Extra Items?
to make the game a little more fun,I know it's possible but I don't know how, can u help me please?

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 422
Joined: 3 Years Ago
Location: Morocco
Has thanked: 141 times
Been thanked: 48 times
Age: 20
Contact:

#6

Post by z0h1r-LK » 1 Month Ago

I will try to create plugin

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#7

Post by InsertSK » 1 Month Ago

Z0uha1r_LK wrote:
1 Month Ago
I will try to create plugin
Thanks You!

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#8

Post by InsertSK » 1 Month Ago

Z0uha1r_LK wrote:
1 Month Ago
I will try to create plugin
How long does it take?

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 422
Joined: 3 Years Ago
Location: Morocco
Has thanked: 141 times
Been thanked: 48 times
Age: 20
Contact:

#9

Post by z0h1r-LK » 1 Month Ago

Not much, I so busy, But I will create that for you

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 254
Joined: 5 Years Ago
Has thanked: 17 times
Been thanked: 21 times
Age: 23
Contact:

#10

Post by sPe3doN » 1 Month Ago

Image

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#11

Post by InsertSK » 1 Month Ago

Z0uha1r_LK wrote:
1 Month Ago
Not much, I so busy, But I will create that for you
Thanks!

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#12

Post by InsertSK » 1 Month Ago


InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#13

Post by InsertSK » 1 Month Ago

Z0uha1r_LK wrote:
1 Month Ago
Not much, I so busy, But I will create that for you
How long will it take you to finish it, if I may ask?

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 254
Joined: 5 Years Ago
Has thanked: 17 times
Been thanked: 21 times
Age: 23
Contact:

#14

Post by sPe3doN » 1 Month Ago

try this, i don't know if this work or no cuz i didin't test it, i just convert this plugin from zp mod

Code: Select all

#include <zombie_escape>


/*================================================================================
 [Plugin Customization]
=================================================================================*/

// Items name (note: add exact item name)

new const EXTRA_ITEMS[][] = {
	"Item 1",
	"Item 2",
	"Item 3"
}

/*================================================================================
 Customization ends here! Yes, that's it. Editing anything beyond
 here is not officially supported. Proceed at your own risk...
=================================================================================*/

enum
{
	TASK_STARTGIVE = 298,
	TASK_GIVEITEM
}

#define ID_BOT (taskid - TASK_GIVEITEM)

new cvar_max_bots, g_botname[33][32], g_has_item[33], g_maxplayers;

public plugin_init()
{
	/* Plugin register */
	register_plugin("[ZE] Bot Addon: Force buy items", "v0.2", "Crazy");

	/* Cvars */
	cvar_max_bots = register_cvar("ze_force_buy_maxbots", "4");

	/* Max players */
	g_maxplayers = get_maxplayers()
}

public client_putinserver(id)
{
	if (is_user_bot(id))
		get_user_name(id, g_botname[id], charsmax(g_botname[]));
}

public ze_game_started()
{
	for (new id = 1; id <= g_maxplayers; id++)
		g_has_item[id] = false;

	set_task(2.0, "give_item_task", TASK_STARTGIVE);
}

public give_item_task(taskid)
{
	static id, iBots, iMaxBots;
	iBots = 0;
	iMaxBots = get_pcvar_num(cvar_max_bots);

	while (iBots <= iMaxBots)
	{
		id = get_random_bot(random_num(1, get_alive_bots()));

		if (!is_user_alive(id))
			continue;

		if (ze_is_user_zombie(id))
			continue;

		if (g_has_item[id])
			continue;

		set_task(1.0, "give_item", id+TASK_GIVEITEM);

		iBots++;
	}

	remove_task(TASK_STARTGIVE);
	remove_task(TASK_GIVEITEM);
}

public give_item(taskid)
{
	static id, random, itemid;
	id = ID_BOT;
	random = random_num(0, sizeof EXTRA_ITEMS - 1);
	itemid = ze_get_item_id(EXTRA_ITEMS[random]);

	if (itemid == -1)
	{
		set_task(0.5, "give_item", id+TASK_GIVEITEM);
		return;
	}

	ze_force_buy_item(id, itemid, 1);
	g_has_item[id] = true;
	remove_task(id+TASK_GIVEITEM);
}

get_alive_bots()
{
	static iBot, id;
	iBot = 0;

	for (id = 1; id <= g_maxplayers; id++)
	{
		if (is_user_alive(id) && is_user_bot(id))
			iBot++;
	}

	return iBot;
}

get_random_bot(n)
{
	static iBot, id;
	iBot = 0;

	for (id = 1; id <= g_maxplayers; id++)
	{
		if (is_user_alive(id) && is_user_bot(id))
			iBot++;

		if (iBot == n)
			return id;
	}

	return -1;
}
These users thanked the author sPe3doN for the post (total 2):
InsertSK (1 Month Ago) • z0h1r-LK (1 Month Ago)
Image

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#15

Post by InsertSK » 1 Month Ago

does not work :/

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#16

Post by InsertSK » 1 Month Ago

does not work also in compile

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 254
Joined: 5 Years Ago
Has thanked: 17 times
Been thanked: 21 times
Age: 23
Contact:

#17

Post by sPe3doN » 1 Month Ago

InsertSK wrote:
1 Month Ago
does not work also in compile
you sure ? cuz it's complie without any problem for me

Code: Select all

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// ze_bot_force_buy_items.sma
//
// Header size:            944 bytes
// Code size:             3024 bytes
// Data size:             5604 bytes
// Stack/heap size:      16384 bytes
// Total requirements:   25956 bytes
// Done.
//
// Compilation Time: 1.94 sec
// ----------------------------------------

Press enter to exit ...
These users thanked the author sPe3doN for the post:
z0h1r-LK (1 Month Ago)
Image

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#18

Post by InsertSK » 1 Month Ago

OKey It worked for me too in compile but in game doesnt work

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 422
Joined: 3 Years Ago
Location: Morocco
Has thanked: 141 times
Been thanked: 48 times
Age: 20
Contact:

#19

Post by z0h1r-LK » 1 Month Ago


It's working !!
Use it to compile any plugin from Escapers-Zone: viewtopic.php?f=6&t=221
And update your AMX Mod X, ReAPI, ReGameDLL, ReHLDS to last version : viewtopic.php?f=7&t=9
Last edited by z0h1r-LK on 13 Aug 2022, 22:24, edited 1 time in total.
Reason: correction

InsertSK
Member
Member
Czech Republic
Posts: 17
Joined: 2 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Contact:

#20

Post by InsertSK » 1 Month Ago

Work!!! Finally! Thanks You
These users thanked the author InsertSK for the post:
z0h1r-LK (1 Month Ago)

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 3 guests